Beispiel #1
0
 def test_offset_by_time_pass_0(self):
     u = Unit("hour")
     v = u.offset_by_time(unit.encode_time(2007, 1, 15, 12, 6, 0))
     self.assertEqual(v, "(3600 s) @ 20070115T120600.00000000 UTC")
Beispiel #2
0
 def test_encode_time_pass_0(self):
     result = unit.encode_time(2006, 1, 15, 12, 6, 0)
     self.assertEqual(result, 159019560.0)
Beispiel #3
0
 def test_offset_by_time_fail_3(self):
     u = Unit('no unit')
     self.assertRaises(ValueError, u.offset_by_time, unit.encode_time(1970, 1, 1, 0, 0, 0))
Beispiel #4
0
 def test_encode_time_pass_0(self):
     result = unit.encode_time(2006, 1, 15, 12, 6, 0)
     self.assertEqual(result, 159019560.0)
Beispiel #5
0
 def test_offset_by_time_pass_0(self):
     u = Unit("hour")
     v = u.offset_by_time(unit.encode_time(2007, 1, 15, 12, 6, 0))
     self.assertEqual(v, "(3600 s) @ 20070115T120600.00000000 UTC")
Beispiel #6
0
 def test_offset_by_time_fail_3(self):
     u = Unit('no unit')
     self.assertRaises(ValueError, u.offset_by_time, unit.encode_time(1970, 1, 1, 0, 0, 0))
Beispiel #7
0
 def test_offset_by_time_fail_2(self):
     u = Unit("unknown")
     self.assertRaises(ValueError, u.offset_by_time, unit.encode_time(1970, 1, 1, 0, 0, 0))