Skip to content

Commit 85c409f

Browse files
committed
Rename test_swagger -> test_openapi; add test for passing spec...
...with no MarshmallowPlugin
1 parent 435cc03 commit 85c409f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_swagger.py renamed to tests/test_openapi.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ def spec(marshmallow_plugin):
2727
def openapi(marshmallow_plugin):
2828
return marshmallow_plugin.openapi
2929

30+
31+
def test_error_if_spec_does_not_have_marshmallow_plugin(app):
32+
bad_spec = APISpec(
33+
title='title',
34+
version='v1',
35+
plugins=[], # oh no! no MarshmallowPlugin
36+
)
37+
with pytest.raises(RuntimeError):
38+
ViewConverter(app=app, spec=bad_spec)
39+
with pytest.raises(RuntimeError):
40+
ResourceConverter(app=app, spec=bad_spec)
41+
42+
3043
class TestFunctionView:
3144

3245
@pytest.fixture

0 commit comments

Comments
 (0)