Ejemplo n.º 1
0
 def __init__(self):
     self._meta = {}
     # configuration no longer initialized here
     self.modules = []
     self.fires = []  # this intitializes self._fires and self._num_fires
     self._num_fires = 0
     # call setters for today and run_id, to trigger setting in Config()
     self.today = datetimeutils.today_utc()
     self.run_id = str(uuid.uuid4())
Ejemplo n.º 2
0
 def test_local_time_day_ahead_of_utc(self):
     assert datetime.datetime.now() == self.NOON_4_20
     assert datetimeutils.today_midnight_utc() == self.MN_4_19
     assert datetimeutils.today_utc() == self.MN_4_19.date()
     assert datetimeutils.yesterday_midnight_utc() == self.MN_4_18
     assert datetimeutils.yesterday_utc() == self.MN_4_18.date()
Ejemplo n.º 3
0
 def test_local_time_day_before_utc(self):
     assert datetime.datetime.now() == self.NOON_4_20
     assert datetimeutils.today_midnight_utc() == self.MN_4_21
     assert datetimeutils.today_utc() == self.MN_4_21.date()
     assert datetimeutils.yesterday_midnight_utc() == self.MN_4_20
     assert datetimeutils.yesterday_utc() == self.MN_4_20.date()
Ejemplo n.º 4
0
 def test_local_time_behind_but_same_day_as_utc(self):
     assert datetime.datetime.now() == self.NOON_4_20
     assert datetimeutils.today_midnight_utc() == self.MN_4_20
     assert datetimeutils.today_utc() == self.MN_4_20.date()
     assert datetimeutils.yesterday_midnight_utc() == self.MN_4_19
     assert datetimeutils.yesterday_utc() == self.MN_4_19.date()
Ejemplo n.º 5
0
 def _initialize_today(self):
     self._manually_set_today = False
     self._processed_today = True
     self._today = datetimeutils.today_utc()
     Config.set_today(self._today)