Commit befb344f authored by ozzeh's avatar ozzeh
Browse files

Minor changes, add test to verify empty model works

parent 36cddddd
......@@ -127,7 +127,6 @@ class SchemaRegistry:
try:
response = self.schema_client.update_schema(**opts)
except self.schema_client.exceptions.ConflictException:
logger.info("Schema did not change so we don't have to worry")
schema_info = self._schemas[schema_name].get()
self._model_schemas[model] = schema_info
return schema_info
......@@ -174,7 +173,7 @@ class SchemaRegistry:
entry = dict(
Source=sender,
Detail=json.dumps(model.dict()),
Detail=model.json(),
Resources=resources,
DetailType=detail_type_formatted,
EventBusName=event_bus,
......
......@@ -25,6 +25,15 @@ def named_registry():
yield _registry
@pytest.fixture(scope="module")
def empty_model():
item = {
"title": "RoleAddedEvent",
"type": "object",
"properties": {}
}
yield item
@pytest.fixture(scope="module")
def simple_model():
item = {
......@@ -106,6 +115,15 @@ def complex_referenced_model():
yield item
@pytest.fixture(scope="module")
def reflected_empty_model(empty_model, named_registry):
from schema_registry.reflection import SchemaReflector
model = SchemaReflector(empty_model).create_model_for_jsonschema()
named_registry.register_model("com.pleaseignore.tvm.test.reflection", model)
yield model
@pytest.fixture(scope="module")
def reflected_simple_model(simple_model, named_registry):
from schema_registry.reflection import SchemaReflector
......@@ -133,6 +151,10 @@ def reflected_complex_referenced_model(complex_referenced_model, named_registry)
yield model
def test_empty_reflection(reflected_empty_model):
pass
def test_simple_reflection(reflected_simple_model):
pass
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment