Example #1
0
 def test_decade(self):
     ct = get_time_unit_from_string('decade')
     self.assertEqual(ct, TimeUnit.DECADE)
Example #2
0
 def test_month(self):
     ct = get_time_unit_from_string('month')
     self.assertEqual(ct, TimeUnit.MONTH)
Example #3
0
 def test_year(self):
     ct = get_time_unit_from_string('year')
     self.assertEqual(ct, TimeUnit.YEAR)
Example #4
0
 def test_day(self):
     ct = get_time_unit_from_string('day')
     self.assertEqual(ct, TimeUnit.DAY)
Example #5
0
 def test_week(self):
     ct = get_time_unit_from_string('week')
     self.assertEqual(ct, TimeUnit.WEEK)
Example #6
0
 def test_hour(self):
     ct = get_time_unit_from_string('hour')
     self.assertEqual(ct, TimeUnit.HOUR)
Example #7
0
 def test_minute(self):
     ct = get_time_unit_from_string('minute')
     self.assertEqual(ct, TimeUnit.MINUTE)
Example #8
0
 def test_second(self):
     ct = get_time_unit_from_string('second')
     self.assertEqual(ct, TimeUnit.SECOND)
Example #9
0
 def test_none_or_empty(self):
     ct = get_time_unit_from_string(None)
     self.assertIsNone(ct)
     ct = get_time_unit_from_string('')
     self.assertIsNone(ct)
Example #10
0
 def test_invalid(self):
     with self.assertRaises(InvalidArgument):
         get_time_unit_from_string('foo')