Ejemplo n.º 1
0
 def test_datetime_to_string_compact(self):
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 123456)
     self.assertEqual(datetime_2_string(dt, True), "2008,358,01:30:22.1234")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22)
     self.assertEqual(datetime_2_string(dt, True), "2008,358,01:30:22")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30)
     self.assertEqual(datetime_2_string(dt, True), "2008,358,01:30")
     dt = UTCDateTime(2008, 12, 23, 0o1)
     self.assertEqual(datetime_2_string(dt, True), "2008,358,01")
     dt = UTCDateTime(2008, 12, 23)
     self.assertEqual(datetime_2_string(dt, True), "2008,358")
Ejemplo n.º 2
0
 def test_DateTime2StringCompact(self):
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 123456)
     self.assertEqual(datetime_2_string(dt, True), "2008,358,01:30:22.1234")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22)
     self.assertEqual(datetime_2_string(dt, True), "2008,358,01:30:22")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30)
     self.assertEqual(datetime_2_string(dt, True), "2008,358,01:30")
     dt = UTCDateTime(2008, 12, 23, 0o1)
     self.assertEqual(datetime_2_string(dt, True), "2008,358,01")
     dt = UTCDateTime(2008, 12, 23)
     self.assertEqual(datetime_2_string(dt, True), "2008,358")
Ejemplo n.º 3
0
 def test_datetime_to_string(self):
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 123456)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.1234")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 98765)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.0987")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 1234)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.0012")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 123)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.0001")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 9)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.0000")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 21)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:21.0000")
     dt = UTCDateTime(2008, 12, 23, 0o1, 0, 0, 0)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:00:00.0000")
     dt = UTCDateTime(2008, 12, 23)
     self.assertEqual(datetime_2_string(dt), "2008,358")
Ejemplo n.º 4
0
 def test_datetime_to_string(self):
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 123456)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.1234")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 98765)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.0987")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 1234)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.0012")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 123)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.0001")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 22, 9)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:22.0000")
     dt = UTCDateTime(2008, 12, 23, 0o1, 30, 21)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:30:21.0000")
     dt = UTCDateTime(2008, 12, 23, 0o1, 0, 0, 0)
     self.assertEqual(datetime_2_string(dt), "2008,358,01:00:00.0000")
     dt = UTCDateTime(2008, 12, 23)
     self.assertEqual(datetime_2_string(dt), "2008,358")