Skip to content

Commit d7889d0

Browse files
committed
Improved tag test
1 parent b0e17dc commit d7889d0

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

tests/test_server_spec_apispec.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,18 @@ def test_view_to_apispec_tags(spec):
3838
class Index(View):
3939
"""Index docstring"""
4040

41-
tags = ["tag1", "tag2"]
41+
tags = set(["tag1", "tag2"])
4242

4343
def get(self):
4444
return "GET"
4545

4646
def post(self):
4747
return "POST"
4848

49-
assert apispec.view_to_apispec_operations(Index, spec) == {
50-
"get": {
51-
"description": "Index docstring",
52-
"summary": "Index docstring",
53-
"tags": ["tag1", "tag2"],
54-
"responses": {
55-
200: {"description": "OK", "content": {"application/json": {}}}
56-
},
57-
},
58-
"post": {
59-
"description": "Index docstring",
60-
"summary": "Index docstring",
61-
"tags": ["tag1", "tag2"],
62-
"responses": {
63-
200: {"description": "OK", "content": {"application/json": {}}}
64-
},
65-
},
66-
}
49+
spec_ops = apispec.view_to_apispec_operations(Index, spec)
50+
51+
assert set(spec_ops["get"]["tags"]) == Index.tags
52+
assert set(spec_ops["post"]["tags"]) == Index.tags
6753

6854

6955
def test_dict_to_apispec_operations_params(spec):

0 commit comments

Comments
 (0)