Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial attempt at handling user tz in tests #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jyaw
Copy link
Contributor

@jyaw jyaw commented Aug 29, 2022

#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

…faults to using the TIMEZONE_NAME tz in the users .env file, defaults to 'America/New_York' if no .env file. Updated the applicable date strings with -04:00 in test_therapy_event.py and it seems to work for me, test come back ok
@codecov-commenter
Copy link

Codecov Report

Merging #59 (37e3b3f) into master (ec84afd) will increase coverage by 0.03%.
The diff coverage is 100.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.

@jwoglom
Copy link
Owner

jwoglom commented Aug 29, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants