Skip to content

Commit

Permalink
#104 add test for int path parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Dec 5, 2015
1 parent b194539 commit 247658f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/fakeapi/api.yaml
Expand Up @@ -555,6 +555,10 @@ paths:
get:
summary: Test class instance method
operationId: fakeapi.hello.DummyClass.test_classmethod
/test-int-path/{someint}:
get:
summary: Test type casting of path parameter
operationId: fakeapi.hello.test_get_someint
definitions:
new_stack:
type: object
Expand Down
4 changes: 4 additions & 0 deletions tests/fakeapi/hello.py
Expand Up @@ -183,3 +183,7 @@ def test_schema_array(test_array):

def test_schema_int(test_int):
return test_int


def test_get_someint(someint):
return str(type(someint))
6 changes: 6 additions & 0 deletions tests/test_app.py
Expand Up @@ -523,3 +523,9 @@ def test_resolve_classmethod(app):
app_client = app.app.test_client()
resp = app_client.get('/v1.0/resolver-test/classmethod') # type: flask.Response
assert resp.data.decode() == '"DummyClass"'


def test_path_parameter_someint(app):
app_client = app.app.test_client()
resp = app_client.get('/v1.0/test-int-path/123') # type: flask.Response
assert resp.data.decode() == '"<type \'int\'>"'

0 comments on commit 247658f

Please sign in to comment.