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