def test_schema_retrieval(self):
     """Schemas missing from the cache are retrieved via HTTP."""
     # Pop the schema from the cache.
     eventlogging.schema.schema_cache.pop(TEST_SCHEMA_SCID)
     with self.assertRaises(HttpRequestAttempted) as context:
         eventlogging.validate(self.event)
         self.assertEqual(context.exception.rev_id, 123)
Exemple #2
0
 def test_schema_retrieval(self):
     """Schemas missing from the cache are retrieved via HTTP."""
     # Pop the schema from the cache.
     eventlogging.schema.schema_cache.pop(TEST_SCHEMA_SCID)
     with self.assertRaises(HttpRequestAttempted) as context:
         eventlogging.validate(self.event)
         self.assertEqual(context.exception.rev_id, 123)
Exemple #3
0
 def assertIsInvalid(self, event, msg=None):
     """Assert that capsule 'event' object fails validation."""
     with self.assertRaises(eventlogging.ValidationError, msg):
         eventlogging.validate(event)
Exemple #4
0
 def assertIsValid(self, event, msg=None):
     """Assert that capsule 'event' object validates."""
     return self.assertIsNone(eventlogging.validate(event), msg)
Exemple #5
0
 def assertIsInvalid(self, event, msg=None):
     """Assert that capsule 'event' object fails validation."""
     with self.assertRaises(eventlogging.ValidationError, msg):
         eventlogging.validate(event)
Exemple #6
0
 def assertIsValid(self, event, msg=None):
     """Assert that capsule 'event' object validates."""
     return self.assertIsNone(eventlogging.validate(event), msg)