Exemplo n.º 1
0
 def test_timestamp_invalid(self):
     """Test timestamp method fails with an invalid date."""
     with self.assertRaises(ValueError):
         OCIGenerator.timestamp("invalid")
Exemplo n.º 2
0
 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"))
Exemplo n.º 3
0
 def test_timestamp_none(self):
     """Test the timestamp method fails with none."""
     with self.assertRaises(ValueError):
         OCIGenerator.timestamp(None)