Skip to content

Commit

Permalink
Improved tag test
Browse files Browse the repository at this point in the history
  • Loading branch information
jtc42 committed Jun 29, 2020
1 parent b0e17dc commit d7889d0
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions tests/test_server_spec_apispec.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,18 @@ def test_view_to_apispec_tags(spec):
class Index(View):
"""Index docstring"""

tags = ["tag1", "tag2"]
tags = set(["tag1", "tag2"])

def get(self):
return "GET"

def post(self):
return "POST"

assert apispec.view_to_apispec_operations(Index, spec) == {
"get": {
"description": "Index docstring",
"summary": "Index docstring",
"tags": ["tag1", "tag2"],
"responses": {
200: {"description": "OK", "content": {"application/json": {}}}
},
},
"post": {
"description": "Index docstring",
"summary": "Index docstring",
"tags": ["tag1", "tag2"],
"responses": {
200: {"description": "OK", "content": {"application/json": {}}}
},
},
}
spec_ops = apispec.view_to_apispec_operations(Index, spec)

assert set(spec_ops["get"]["tags"]) == Index.tags
assert set(spec_ops["post"]["tags"]) == Index.tags


def test_dict_to_apispec_operations_params(spec):
Expand Down

0 comments on commit d7889d0

Please sign in to comment.