Пример #1
0
 def test_validate_datetime_object(self):
     from datetime import datetime
     data = datetime.utcnow()
     now = Timestamp.validate(data)
     self.assertIsInstance(now, Timestamp)
     dnow = Timestamp(data, "UTC")
     self.assertEqual(now, dnow)
Пример #2
0
 def test_validate_delorean_object(self):
     from delorean import Delorean
     data = Delorean()
     now = Timestamp.validate(data)
     self.assertIsInstance(now, Timestamp)
     self.assertEqual(data, now)
Пример #3
0
 def test_validate_object(self):
     data = Timestamp.now()
     now = Timestamp.validate(data)
     self.assertIs(now, data)
     self.assertEqual(now, data)