Пример #1
0
 def test_tuple_4(self):
     c = datetime.datetime(2018, 11, 24, 0, 0, 0)
     r = to_datetime((2018, 11, 24), c)
     d = r - c
     self.assertLess(abs(d.total_seconds()), 1)
Пример #2
0
 def test_string_yyyymmdd_2(self):
     c = datetime.datetime(2018, 11, 24, 0, 0, 0)
     r = to_datetime("2018-11-24", c)
     d = r - c
     self.assertLess(abs(d.total_seconds()), 1)
Пример #3
0
 def test_string_yyyymmddhhmmss_2(self):
     c = datetime.datetime(2018, 11, 24, 16, 39, 13)
     r = to_datetime("2018-11-24 16:39:13", c)
     d = r - c
     self.assertLess(abs(d.total_seconds()), 1)
Пример #4
0
 def test_string_yyyymmddhhmm_1(self):
     c = datetime.datetime(2018, 11, 24, 16, 39, 0)
     r = to_datetime("201811241639", c)
     d = r - c
     self.assertLess(abs(d.total_seconds()), 1)
Пример #5
0
 def test_none(self):
     c = datetime.datetime(2018, 11, 24, 16, 39, 13)
     r = to_datetime(None, c)
     d = r - c
     self.assertLess(abs(d.total_seconds()), 1)