From d7d7a8cc8d18549fc1dd874a734b77b85f0ac7ef Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 9 Aug 2021 22:01:14 +0100 Subject: [PATCH] Blackened test_app.py --- tests/test_app.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/test_app.py b/tests/test_app.py index c3f5b2e8..0e16c58b 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -23,23 +23,21 @@ def test_microscope_creation(): def test_openapi_valid(): assert validate_spec(labthing.spec) + def test_thing_description_valid(): # TODO: it would be nice to put this into LabThings # First load the schema from file and check it validates - schema_fname = os.path.join( - os.path.dirname(__file__), - "w3c_td_schema.json" - ) + schema_fname = os.path.join(os.path.dirname(__file__), "w3c_td_schema.json") schema = json.load(open(schema_fname, "r")) jsonschema.Draft7Validator.check_schema(schema) # Build a TD dictionary 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 td_json = encode_json(td_dict) # Decode the JSON back into a primitive dictionary td_json_dict = json.loads(td_json) # Validate - jsonschema.validate(instance=td_json_dict, schema=schema) \ No newline at end of file + jsonschema.validate(instance=td_json_dict, schema=schema)