Skip to content

Commit

Permalink
#104 test routing for non-matching values
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Dec 5, 2015
1 parent c7a1105 commit 878fac2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_app.py
Expand Up @@ -530,8 +530,17 @@ def test_path_parameter_someint(app):
resp = app_client.get('/v1.0/test-int-path/123') # type: flask.Response
assert resp.data.decode() == '"int"'

# non-integer values will not match Flask route
resp = app_client.get('/v1.0/test-int-path/foo') # type: flask.Response
assert resp.status_code == 404


def test_path_parameter_somefloat(app):
app_client = app.app.test_client()
resp = app_client.get('/v1.0/test-float-path/123.45') # type: flask.Response
assert resp.data.decode() == '"float"'

# non-float values will not match Flask route
resp = app_client.get('/v1.0/test-float-path/123,45') # type: flask.Response
assert resp.status_code == 404

0 comments on commit 878fac2

Please sign in to comment.