コード例 #1
0
 def test_timestamp_to_datetime_raises(self):
     with self.assertRaises(Exception) as cm:
         timestamp_to_datetime('01-01-15 09:00:00')
     expected = "Unable to parse timestamp '01-01-15 09:00:00'"
     self.assertEquals(cm.exception.message, expected)
コード例 #2
0
 def test_timestamp_to_datetime(self):
     out = timestamp_to_datetime('01-01-2015 09:00:00')
     expected = datetime(2015, 1, 1, 9, 0, 0)
     self.assertEquals(out, expected)