Ejemplo n.º 1
0
 def test_strtime_and_back(self):
     orig_t = datetime.datetime(1997, 8, 29, 6, 14, 0)
     s = timeutils.strtime(orig_t)
     t = timeutils.parse_strtime(s)
     self.assertEqual(orig_t, t)
Ejemplo n.º 2
0
 def test_parse_strtime(self):
     perfect_time_format = self.skynet_self_aware_time_perfect_str
     expect = timeutils.parse_strtime(perfect_time_format)
     self.assertEqual(self.skynet_self_aware_time_perfect, expect)
Ejemplo n.º 3
0
 def test_parse_strtime(self):
     perfect_time_format = self.skynet_self_aware_time_perfect_str
     expect = timeutils.parse_strtime(perfect_time_format)
     self.assertEqual(self.skynet_self_aware_time_perfect, expect)
Ejemplo n.º 4
0
 def test_strtime_and_back(self):
     orig_t = datetime.datetime(1997, 8, 29, 6, 14, 0)
     s = timeutils.strtime(orig_t)
     t = timeutils.parse_strtime(s)
     self.assertEqual(orig_t, t)
Ejemplo n.º 5
0
def convert_datetimes(values, *datetime_keys):
    for key in values:
        if key in datetime_keys and isinstance(values[key], basestring):
            values[key] = timeutils.parse_strtime(values[key])
    return values