Пример #1
0
 def test_normalize_zulu_aware_to_naive(self):
     dt = datetime.datetime(2011, 2, 14, 20, 53, 7)
     time_str = '2011-02-14T19:53:07Z'
     aware = timeutils.parse_isotime(time_str)
     naive = timeutils.normalize_time(aware)
     self.assertLess(naive, dt)
Пример #2
0
 def test_normalize_naive(self):
     dt = datetime.datetime(2011, 2, 14, 20, 53, 7)
     dtn = datetime.datetime(2011, 2, 14, 19, 53, 7)
     naive = timeutils.normalize_time(dtn)
     self.assertLess(naive, dt)
Пример #3
0
 def test_east_normalize(self):
     time_str = '2012-02-14T20:53:07-07:00'
     east = timeutils.parse_isotime(time_str)
     normed = timeutils.normalize_time(east)
     self._instaneous(normed, 2012, 2, 15, 3, 53, 7, 0)
Пример #4
0
 def test_west_normalize(self):
     time_str = '2012-02-14T20:53:07+21:00'
     west = timeutils.parse_isotime(time_str)
     normed = timeutils.normalize_time(west)
     self._instaneous(normed, 2012, 2, 13, 23, 53, 7, 0)
Пример #5
0
 def test_normalize_naive(self):
     dt = datetime.datetime(2011, 2, 14, 20, 53, 7)
     dtn = datetime.datetime(2011, 2, 14, 19, 53, 7)
     naive = timeutils.normalize_time(dtn)
     self.assertTrue(naive < dt)
Пример #6
0
 def test_zulu_normalize(self):
     time_str = '2012-02-14T20:53:07Z'
     zulu = timeutils.parse_isotime(time_str)
     normed = timeutils.normalize_time(zulu)
     self._instaneous(normed, 2012, 2, 14, 20, 53, 7, 0)
Пример #7
0
 def test_west_normalize(self):
     time_str = '2012-02-14T20:53:07+21:00'
     west = timeutils.parse_isotime(time_str)
     normed = timeutils.normalize_time(west)
     self._instaneous(normed, 2012, 2, 13, 23, 53, 7, 0)
Пример #8
0
 def test_normalize_zulu_aware_to_naive(self):
     dt = datetime.datetime(2011, 2, 14, 20, 53, 7)
     time_str = '2011-02-14T19:53:07Z'
     aware = timeutils.parse_isotime(time_str)
     naive = timeutils.normalize_time(aware)
     self.assertTrue(naive < dt)
Пример #9
0
 def test_east_normalize(self):
     time_str = '2012-02-14T20:53:07-07:00'
     east = timeutils.parse_isotime(time_str)
     normed = timeutils.normalize_time(east)
     self._instaneous(normed, 2012, 2, 15, 3, 53, 7, 0)
Пример #10
0
 def test_zulu_normalize(self):
     time_str = '2012-02-14T20:53:07Z'
     zulu = timeutils.parse_isotime(time_str)
     normed = timeutils.normalize_time(zulu)
     self._instaneous(normed, 2012, 2, 14, 20, 53, 7, 0)
Пример #11
0
 def _to_datetime(obj):
     return timeutils.normalize_time(timeutils.parse_isotime(obj))
Пример #12
0
 def _to_datetime(obj):
     return timeutils.normalize_time(timeutils.parse_isotime(obj))
Пример #13
0
 def test_normalize_aware_to_naive(self):
     dt = datetime.datetime(2011, 2, 14, 20, 53, 7)
     time_str = '2011-02-14T20:53:07+21:00'
     aware = timeutils.parse_isotime(time_str)
     naive = timeutils.normalize_time(aware)
     self.assertLess(naive, dt)