Go back to using time.time everywhere; time_now() is unnecessary
Created by: pastly
It's very likely that tests I'm about to write will work better if time is predictable.
Instances of time.time()
in code should be replaced with something like time_now()
defined in sbws/globals.py
as simply:
def time_now():
return time.time()
Then I can use the standard library's unittest.mock.Mock to replace time_now()
with various things, depending on what exactly I need. I could ...
- Always return the exact same time
- Return times with only tiny increments in them
- Work through a list of arbitrary times and return each one as called