Ejemplo n.º 1
0
 def test_just_missed_time(self):
     time_now = datetime.utcnow()
     time_start = time_now - timedelta(
         seconds=DAY_LEEWAY - 1
     )
     dates = get_list_of_dates(time_start, time_now)
     nt.assert_equal(len(dates), 0)
Ejemplo n.º 2
0
 def test_off_by_seconds(self):
     time_now = datetime.utcnow()
     time_start = time_now - timedelta(
         seconds=DAY_LEEWAY + 1
     )
     dates = get_list_of_dates(time_start, time_now)
     nt.assert_equal(len(dates), 1)
Ejemplo n.º 3
0
 def test_month_transition(self):
     time_now = datetime.utcnow()
     time_end = time_now - timedelta(
         days=(time_now.day - 2)
     )
     time_start = time_end - timedelta(days=5)
     dates = get_list_of_dates(time_start, time_end)
     nt.assert_equal(len(dates), 5)
Ejemplo n.º 4
0
 def test_five_days(self):
     time_now = datetime.utcnow()
     time_past = time_now - timedelta(days=5)
     dates = get_list_of_dates(time_past, time_now)
     nt.assert_equal(len(dates), 5)
     nt.assert_in(time_now, dates)