Skip to content

Commit

Permalink
Improved spec utilities coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Apr 23, 2020
1 parent cac6050 commit 9c723c3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_server_spec_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ def test_update_spec(view_cls):
}


def test_tag_spec(view_cls):
utilities.tag_spec(view_cls, set(["tag1"]))
assert view_cls.__apispec__.get("tags") == set(["tag1"])
utilities.tag_spec(view_cls, set(["tag2"]))
assert view_cls.__apispec__.get("tags") == set(["tag1", "tag2"])


def test_tag_spec_string(view_cls):
utilities.tag_spec(view_cls, "tag1")
assert view_cls.__apispec__.get("tags") == set(["tag1"])


def test_tag_spec_invalid(view_cls):
with pytest.raises(TypeError):
utilities.tag_spec(view_cls, set([object(), "tag"]))


def test_get_spec(view_cls):
assert utilities.get_spec(None) == {}
assert utilities.get_spec(view_cls) == {}
Expand Down

0 comments on commit 9c723c3

Please sign in to comment.