Skip to content

Commit

Permalink
Fix code formatting with make format
Browse files Browse the repository at this point in the history
  • Loading branch information
victorwu95 committed Nov 10, 2018
1 parent 0a7afc3 commit dc4e3c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bounce/server/api/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions tests/api/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit dc4e3c2

Please sign in to comment.