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)
def test_validate_delorean_object(self): from delorean import Delorean data = Delorean() now = Timestamp.validate(data) self.assertIsInstance(now, Timestamp) self.assertEqual(data, now)
def test_validate_object(self): data = Timestamp.now() now = Timestamp.validate(data) self.assertIs(now, data) self.assertEqual(now, data)