Skip to content

Commit

Permalink
Test: Remove skip of static test case and fix options route test
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjr0719 committed Jun 20, 2019
1 parent d65f0bb commit 86a8a4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion sanic_openapi/swagger.py
Expand Up @@ -99,7 +99,8 @@ def build_spec(app, loop):
if route.uri.startswith(swagger_blueprint.url_prefix):
continue

if "static" in route.name:
# route.name will be None when using class based view
if route.name and "static" in route.name:
# TODO: add static flag in sanic routes
continue

Expand Down
5 changes: 1 addition & 4 deletions tests/test_swagger.py
Expand Up @@ -257,9 +257,6 @@ def test_configs(app, configs):
assert info["license"]["url"] == configs["API_LICENSE_URL"]


@pytest.mark.skip(
reason="The uri '/static' still in swagger.json now. This might already fixed by #80."
)
def test_skip_static_file(app):
app.static("/static", __file__)

Expand Down Expand Up @@ -294,4 +291,4 @@ def test(request):
assert response.content_type == "application/json"

swagger_json = response.json
assert swagger_json["paths"]["/"] == {}
assert swagger_json["paths"] == {}

0 comments on commit 86a8a4a

Please sign in to comment.