tconnectsync
tconnectsync copied to clipboard
Initial attempt at handling user tz in tests
#56 Put a common replace_with_user_tz() function in tests/util/utilities.py that defaults to using the TIMEZONE_NAME tz in the users .env file (TIMEZONE_NAME defaults to 'America/New_York' if no .env file).
Updated the applicable date strings with -04:00 in test_therapy_event.py as a trial and it seems to work for me, test come back ok. Easy to update for relavant datestamps in the test files.
This change would need to be accounted for in the following files to make tests return ok in timezones outside of EST...
- domain/test_therapy_event.py (handled in this PR)
- parser/test_tconnect.py
- sync/test_bolus.py
- sync/test_cgm.py
- sync/test_iob.py
- test_process.py
Codecov Report
Merging #59 (37e3b3f) into master (ec84afd) will increase coverage by
0.03%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #59 +/- ##
==========================================
+ Coverage 82.69% 82.72% +0.03%
==========================================
Files 46 47 +1
Lines 3039 3045 +6
==========================================
+ Hits 2513 2519 +6
Misses 526 526
Impacted Files | Coverage Δ | |
---|---|---|
tests/domain/test_therapy_event.py | 100.00% <100.00%> (ø) |
|
tests/util/utilities.py | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
I'll take a look at updating the Github actions configuration so that tests run with both the default America/New_York and something custom.