Exemple #1
0
 def test_get_cutoff_negtive_value_months(self):
     fakenow = datetime(2015, 2, 3, 4, 5, 6)
     cutoff  = datetime(2015, 7, 1, 0, 0, 0)
     self.assertEqual(cutoff, curator.get_cutoff(-5, time_unit='months', utc_now=fakenow))
Exemple #2
0
 def test_get_cutoff_non_integer(self):
     self.assertFalse(curator.get_cutoff(unit_count='foo'))
Exemple #3
0
 def test_get_cutoff_weeks(self):
     fakenow = datetime(2015, 2, 3, 4, 5, 6)
     cutoff  = datetime(2015, 2, 2, 0, 0, 0)
     self.assertEqual(cutoff, curator.get_cutoff(1, time_unit='weeks', utc_now=fakenow))
Exemple #4
0
 def test_get_cutoff_param_check(self):
     # Testing for the omission of the unit_count param
     self.assertFalse(curator.get_cutoff())