Exemplo n.º 1
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)
Exemplo n.º 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)
Exemplo n.º 3
0
 def assertIsInvalid(self, event, msg=None):
     """Assert that capsule 'event' object fails validation."""
     with self.assertRaises(eventlogging.ValidationError, msg):
         eventlogging.validate(event)
Exemplo n.º 4
0
 def assertIsValid(self, event, msg=None):
     """Assert that capsule 'event' object validates."""
     return self.assertIsNone(eventlogging.validate(event), msg)
Exemplo n.º 5
0
 def assertIsInvalid(self, event, msg=None):
     """Assert that capsule 'event' object fails validation."""
     with self.assertRaises(eventlogging.ValidationError, msg):
         eventlogging.validate(event)
Exemplo n.º 6
0
 def assertIsValid(self, event, msg=None):
     """Assert that capsule 'event' object validates."""
     return self.assertIsNone(eventlogging.validate(event), msg)