Skip to content

Commit 26be347

Browse files
committed
Fixed flake8 complaints
1 parent 4e50645 commit 26be347

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

mrmat_python_api_flask/apis/resource/v1/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def modify(i: int):
109109
if resource is None:
110110
return {'status': 404, 'message': 'Unable to find requested resource'}, 404
111111
if resource.owner.client_id != client_id:
112-
return { 'status': 401, 'message': 'You do not own this resource'}, 401
112+
return {'status': 401, 'message': 'You do not own this resource'}, 401
113113
resource.name = body['name']
114114

115115
db.session.add(resource)
@@ -127,7 +127,7 @@ def remove(i: int):
127127
if resource is None:
128128
return {'status': 410, 'message': 'Unable to find requested resource'}, 410
129129
if resource.owner.client_id != client_id:
130-
return { 'status': 401, 'message': 'You do not own this resource'}, 401
130+
return {'status': 401, 'message': 'You do not own this resource'}, 401
131131

132132
db.session.delete(resource)
133133
db.session.commit()

tests/test_resource_v1.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def test_create(client: FlaskClient, oidc_token_write: Dict):
3535
(resp, resp_body) = rac.create(name='Test Resource 1')
3636
assert resp.status_code == 201
3737
assert resp_body['id'] == 1
38-
#assert resp_body['owner'] == oidc_token_write['jwt']['sub']
3938
assert resp_body['name'] == 'Test Resource 1'
4039

4140

@@ -47,13 +46,11 @@ def test_modify(client: FlaskClient, oidc_token_write):
4746
(resp, resp_body) = rac.create(name='Test Resource Original')
4847
assert resp.status_code == 201
4948
assert resp_body['id'] == 1
50-
#assert resp_body['owner'] == oidc_token_write['jwt']['sub']
5149
assert resp_body['name'] == 'Test Resource Original'
5250

5351
(resp, resp_body) = rac.modify(1, name='Test Resource Modified')
5452
assert resp.status_code == 200
5553
assert resp_body['id'] == 1
56-
#assert resp_body['owner'] == oidc_token_write['jwt']['sub']
5754
assert resp_body['name'] == 'Test Resource Modified'
5855

5956

@@ -107,5 +104,4 @@ def test_get_one(client: FlaskClient, oidc_token_read, oidc_token_write):
107104
(resp, resp_body) = rac_read.get_one(1)
108105
assert resp.status_code == 200
109106
assert resp_body['id'] == 1
110-
#assert resp_body['owner'] == oidc_token_write['jwt']['sub']
111107
assert resp_body['name'] == 'Test Resource 3'

0 commit comments

Comments
 (0)