Skip to content

Commit

Permalink
Whitespace fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rwb27 committed Jul 22, 2021
1 parent 8490acb commit a27e16a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ def test_build_action_schema_typeerror():
with pytest.raises(TypeError):
action_schema = schema.build_action_schema(input_schema, output_schema)


def test_nest_if_needed():
nested_schema = schema.nest_if_needed(schema.ActionSchema())
assert isinstance(nested_schema, fields.Field)
nested_dict = schema.nest_if_needed({"name": fields.Integer()})
assert isinstance(nested_schema, fields.Field)
nested_field = schema.nest_if_needed(fields.Boolean())
assert isinstance(nested_schema, fields.Field)
assert isinstance(nested_schema, fields.Field)
16 changes: 11 additions & 5 deletions tests/test_td.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def test_td_init(helpers, thing, thing_description, app_ctx, schemas_path):
validate_spec(thing.spec)


def test_td_add_link(helpers, thing, thing_description, view_cls, app_ctx, schemas_path):
def test_td_add_link(
helpers, thing, thing_description, view_cls, app_ctx, schemas_path
):
thing.add_view(view_cls, "/test_view_cls")
thing_description.add_link(view_cls, "rel")
assert {
Expand Down Expand Up @@ -71,7 +73,9 @@ def post(self):
validate_spec(thing.spec)


def test_td_action_with_schema(helpers, thing, app, thing_description, app_ctx, schemas_path):
def test_td_action_with_schema(
helpers, thing, app, thing_description, app_ctx, schemas_path
):
class Index(ActionView):
args = {"integer": fields.Int()}
semtype = "ToggleAction"
Expand All @@ -87,7 +91,7 @@ def post(self):
with app_ctx.test_request_context():
assert "index" in thing_description.to_dict().get("actions")
helpers.validate_thing_description(thing_description, app_ctx, schemas_path)

validate_spec(thing.spec)


Expand Down Expand Up @@ -145,7 +149,9 @@ def get(self):
validate_spec(thing.spec)


def test_td_property_write_only(helpers, app, thing, thing_description, app_ctx, schemas_path):
def test_td_property_write_only(
helpers, app, thing, thing_description, app_ctx, schemas_path
):
class Index(PropertyView):
schema = fields.Int()

Expand All @@ -160,7 +166,7 @@ def put(self):
with app_ctx.test_request_context():
assert "index" in thing_description.to_dict().get("properties")
helpers.validate_thing_description(thing_description, app_ctx, schemas_path)

validate_spec(thing.spec)


Expand Down

0 comments on commit a27e16a

Please sign in to comment.