Blackened test_app.py
This commit is contained in:
parent
c831937b05
commit
d7d7a8cc8d
1 changed files with 4 additions and 6 deletions
|
|
@ -23,19 +23,17 @@ def test_microscope_creation():
|
||||||
def test_openapi_valid():
|
def test_openapi_valid():
|
||||||
assert validate_spec(labthing.spec)
|
assert validate_spec(labthing.spec)
|
||||||
|
|
||||||
|
|
||||||
def test_thing_description_valid():
|
def test_thing_description_valid():
|
||||||
# TODO: it would be nice to put this into LabThings
|
# TODO: it would be nice to put this into LabThings
|
||||||
# First load the schema from file and check it validates
|
# First load the schema from file and check it validates
|
||||||
schema_fname = os.path.join(
|
schema_fname = os.path.join(os.path.dirname(__file__), "w3c_td_schema.json")
|
||||||
os.path.dirname(__file__),
|
|
||||||
"w3c_td_schema.json"
|
|
||||||
)
|
|
||||||
schema = json.load(open(schema_fname, "r"))
|
schema = json.load(open(schema_fname, "r"))
|
||||||
jsonschema.Draft7Validator.check_schema(schema)
|
jsonschema.Draft7Validator.check_schema(schema)
|
||||||
|
|
||||||
# Build a TD dictionary
|
# Build a TD dictionary
|
||||||
with labthing.app.test_request_context():
|
with labthing.app.test_request_context():
|
||||||
td_dict = labthing.thing_description.to_dict()
|
td_dict = labthing.thing_description.to_dict()
|
||||||
|
|
||||||
# Allow our LabThingsJSONEncoder to encode the RD
|
# Allow our LabThingsJSONEncoder to encode the RD
|
||||||
td_json = encode_json(td_dict)
|
td_json = encode_json(td_dict)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue