示例#1
0
 def test_incomplete_fraction_time(self):
     hour, minute, second, microsecond, \
         in_nanoseconds = comtrade._get_time(self.incomplete_fraction_time)
     self.assertEqual(hour, 0)
     self.assertEqual(minute, 0)
     self.assertEqual(second, 0)
     self.assertEqual(microsecond, 230000)
     self.assertFalse(in_nanoseconds)
示例#2
0
 def test_complete_time(self):
     hour, minute, second, microsecond, \
         in_nanoseconds = comtrade._get_time(self.complete_time)
     self.assertEqual(hour, 10)
     self.assertEqual(minute, 30)
     self.assertEqual(second, 0)
     self.assertEqual(microsecond, 228000)
     self.assertFalse(in_nanoseconds)
示例#3
0
 def test_nanoseconds(self):
     ignore = True
     hour, minute, second, microsecond, \
         in_nanoseconds = comtrade._get_time(self.nanoseconds, ignore)
     self.assertEqual(hour, 0)
     self.assertEqual(minute, 0)
     self.assertEqual(second, 0)
     self.assertEqual(microsecond, 123456)  # s the decimal .789
     self.assertTrue(in_nanoseconds)