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
open_at_time fix #166
open_at_time fix #166
Conversation
I am not sure I understand, if the schedule defines an open and close time, then if the open_at_time() is called with a time outside the open hours, shouldn't it return False? Isn't that the purpose of the open_at_time() to know if a time is open or not? |
Currently, if a schedule that has been calculated from "2001-01-08" to "2001-01-10" is used in open_at_time, with a timestamp before or after those dates (not covered by the schedule), it will return False. I am suggesting that it may be better to raise an error in that situtaion:
|
@Stryder-Git ok that makes sense and I agree we should implement this change. |
… datetime not covered by the schedule
…en_at_time assertions to fit the previous format
This is good to go but I will leave the versioning to you if that is fine? Thanks. |
Works for me. Will push a new version to PyPi shortly |
This would be my proposed solution for #164, including an update to the tests.
@rsheftel, I think that it would be better to raise an error if a timestamp is passed that falls outside of the range covered by the schedule instead of returning False. Some tests are failing because I already implemented that. I wanted to see if you agree before adjusting those tests?
Thanks