From dc4e3c293817ce5832f8d11492be45daf4ed2cf3 Mon Sep 17 00:00:00 2001 From: Victor Wu <14853635+victorwu95@users.noreply.github.com> Date: Sat, 10 Nov 2018 11:22:23 -0800 Subject: [PATCH] Fix code formatting with make format --- bounce/server/api/users.py | 4 +++- tests/api/test_endpoints.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bounce/server/api/users.py b/bounce/server/api/users.py index b79daa3..692f711 100644 --- a/bounce/server/api/users.py +++ b/bounce/server/api/users.py @@ -53,7 +53,9 @@ async def put(self, request, username, id_from_token=None): if not util.check_password(body['password'], user_row.secret): raise APIError('Unauthorized', status=401) if body.get('new_password'): - raise APIError('New password should not be provided for email change', status=400) + raise APIError( + 'New password should not be provided for email change', + status=400) email = body['email'] elif body.get('new_password'): # Check that user current password is provided diff --git a/tests/api/test_endpoints.py b/tests/api/test_endpoints.py index 4ce1af6..548cac5 100644 --- a/tests/api/test_endpoints.py +++ b/tests/api/test_endpoints.py @@ -36,6 +36,7 @@ def test_post_users__failure(server): assert response.status == 400 assert 'error' in response.json + def test_put_user__success(server): username = 'test' token = util.create_jwt(1, server.config.secret) @@ -51,6 +52,7 @@ def test_put_user__success(server): assert response.json['id'] == 1 assert isinstance(response.json['created_at'], int) + def test_put_user_update_email__success(server): username = 'test' token = util.create_jwt(1, server.config.secret) @@ -69,6 +71,7 @@ def test_put_user_update_email__success(server): assert response.json['id'] == 1 assert isinstance(response.json['created_at'], int) + def test_put_user_update_email__failure(server): username = 'test' token = util.create_jwt(1, server.config.secret) @@ -107,6 +110,7 @@ def test_put_user_update_email__failure(server): headers={'Authorization': token}) assert response.status == 400 + def test_get_user__success(server): _, response = server.app.test_client.get('/users/test') assert response.status == 200 @@ -155,6 +159,7 @@ def test_put_users_update_password__failure(server): headers={'Authorization': token}) assert response.status == 401 + def test_login__success(server): _, response = server.app.test_client.post( '/auth/login',