예제 #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")
예제 #2
0
 def test_encode_time_pass_0(self):
     result = unit.encode_time(2006, 1, 15, 12, 6, 0)
     self.assertEqual(result, 159019560.0)
예제 #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))
예제 #4
0
 def test_encode_time_pass_0(self):
     result = unit.encode_time(2006, 1, 15, 12, 6, 0)
     self.assertEqual(result, 159019560.0)
예제 #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")
예제 #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))
예제 #7
0
파일: test_unit.py 프로젝트: Jozhogg/iris
 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))