Skip to content
Snippets Groups Projects
Commit 1287aff4 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

TST: Add unit tests for errors in case of references

parent 9fdfa254
No related branches found
No related tags found
2 merge requests!89ENH: JsonSchemaExporter accepts do_not_create parameter.,!80F simple schema export
......@@ -22,6 +22,8 @@
import linkahead as db
from pytest import raises
from caosadvancedtools.json_schema_exporter import recordtype_to_json_schema as rtjs
......@@ -51,3 +53,48 @@ def test_empty_rt():
assert "description" in schema["properties"]
assert schema["properties"]["name"]["type"] == "string"
assert schema["properties"]["description"]["type"] == "string"
def test_rt_with_scalar_props():
pass
def test_rt_with_list_props():
pass
def test_rt_with_references():
"""References and lists of references will come later, so test if the errors
are thrown correctly.
"""
rt = db.RecordType()
rt.add_property(name="RefProp", datatype=db.REFERENCE)
with raises(NotImplementedError):
rtjs(rt)
rt = db.RecordType()
rt.add_property(name="RefProp", datatype="OtherType")
with raises(NotImplementedError):
rtjs(rt)
rt = db.RecordType()
rt.add_property(name="RefProp", datatype=db.LIST(db.REFERENCE))
with raises(NotImplementedError):
rtjs(rt)
rt = db.RecordType()
rt.add_property(name="RefProp", datatype=db.LIST("OtherType"))
with raises(NotImplementedError):
rtjs(rt)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment