Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gdb committed Mar 24, 2016
1 parent 846b312 commit ea3b2c9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/api/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def route2():
def test_resolve_method(simple_app):
app_client = simple_app.app.test_client()
resp = app_client.get('/v1.0/resolver-test/method') # type: flask.Response
assert resp.data.decode() == '"DummyClass"'
assert resp.data.decode() == '"DummyClass"\n'


def test_resolve_classmethod(simple_app):
app_client = simple_app.app.test_client()
resp = app_client.get('/v1.0/resolver-test/classmethod') # type: flask.Response
assert resp.data.decode() == '"DummyClass"'
assert resp.data.decode() == '"DummyClass"\n'


def test_add_api_with_function_resolver_function_is_wrapped(simple_api_spec_dir):
Expand Down
4 changes: 2 additions & 2 deletions tests/api/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_array_query_param(simple_app):
def test_path_parameter_someint(simple_app):
app_client = simple_app.app.test_client()
resp = app_client.get('/v1.0/test-int-path/123') # type: flask.Response
assert resp.data.decode() == '"int"'
assert resp.data.decode() == '"int"\n'

# non-integer values will not match Flask route
resp = app_client.get('/v1.0/test-int-path/foo') # type: flask.Response
Expand All @@ -65,7 +65,7 @@ def test_path_parameter_someint(simple_app):
def test_path_parameter_somefloat(simple_app):
app_client = simple_app.app.test_client()
resp = app_client.get('/v1.0/test-float-path/123.45') # type: flask.Response
assert resp.data.decode() == '"float"'
assert resp.data.decode() == '"float"\n'

# non-float values will not match Flask route
resp = app_client.get('/v1.0/test-float-path/123,45') # type: flask.Response
Expand Down
2 changes: 1 addition & 1 deletion tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_parameter_validator(monkeypatch):
request.headers = {}
request.params = {}
app = MagicMock(name='app')
app.response_class = lambda a, mimetype, status: json.loads(a)['detail']
app.response_class = lambda a, mimetype, status: json.loads(''.join(a))['detail']
monkeypatch.setattr('flask.request', request)
monkeypatch.setattr('flask.current_app', app)

Expand Down

0 comments on commit ea3b2c9

Please sign in to comment.