def test_timestamp_invalid(self): """Test timestamp method fails with an invalid date.""" with self.assertRaises(ValueError): OCIGenerator.timestamp("invalid")
def test_timestamp_valid(self): """Test timestamp method returns a date string.""" generator = OCIGenerator(self.six_hours_ago, self.now, self.currency) tag_date = generator.timestamp(self.now) self.assertIsInstance(tag_date, str) self.assertEqual(tag_date, self.now.strftime("%Y-%m-%dT%H:%MZ"))
def test_timestamp_none(self): """Test the timestamp method fails with none.""" with self.assertRaises(ValueError): OCIGenerator.timestamp(None)