|
|
@ -13,7 +13,7 @@ def test_get_users_happy_path(auth: AuthActions, client: FlaskClient): |
|
|
|
result = client.get( |
|
|
|
'/user', |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1] |
|
|
|
auth_header.header: auth_header.data |
|
|
|
}) |
|
|
|
assert 200 == result.status_code |
|
|
|
assert result.json is not None |
|
|
@ -30,7 +30,7 @@ def test_get_users_nonexistent_page(auth: AuthActions, client: FlaskClient): |
|
|
|
result = client.get( |
|
|
|
'/user?page=2', |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1] |
|
|
|
auth_header.header: auth_header.data |
|
|
|
}) |
|
|
|
assert 404 == result.status_code |
|
|
|
assert result.json is not None |
|
|
@ -42,7 +42,7 @@ def test_get_user_happy_path(auth: AuthActions, client: FlaskClient): |
|
|
|
result = client.get( |
|
|
|
'/user/{}'.format(client.application.config['test_username']), |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1] |
|
|
|
auth_header.header: auth_header.data |
|
|
|
}) |
|
|
|
assert 200 == result.status_code |
|
|
|
assert result.json is not None |
|
|
@ -57,7 +57,7 @@ def test_patch_user_happy_path(auth: AuthActions, client: FlaskClient): |
|
|
|
user = client.get( |
|
|
|
'/user/{}'.format(client.application.config['test_username']), |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1] |
|
|
|
auth_header.header: auth_header.data |
|
|
|
}) |
|
|
|
|
|
|
|
patched_user = client.patch( |
|
|
@ -67,7 +67,7 @@ def test_patch_user_happy_path(auth: AuthActions, client: FlaskClient): |
|
|
|
'lastLoginTime': last_login_time |
|
|
|
}), |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1], |
|
|
|
auth_header.header: auth_header.data, |
|
|
|
'Content-Type': 'application/json' |
|
|
|
}) |
|
|
|
|
|
|
@ -85,7 +85,7 @@ def test_register_user_happy_path(auth: AuthActions, client: FlaskClient): |
|
|
|
'name': 'test_registered_user' |
|
|
|
}), |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1], |
|
|
|
auth_header.header: auth_header.data, |
|
|
|
'Content-Type': 'application/json' |
|
|
|
}) |
|
|
|
assert 200 == result.status_code |
|
|
@ -104,7 +104,7 @@ def test_register_user_invalid_password( |
|
|
|
'password': '' |
|
|
|
}), |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1], |
|
|
|
auth_header.header: auth_header.data, |
|
|
|
'Content-Type': 'application/json' |
|
|
|
}) |
|
|
|
assert 400 == result.status_code |
|
|
@ -121,7 +121,7 @@ def test_register_user_twice_failure(auth: AuthActions, client: FlaskClient): |
|
|
|
'name': 'test_registered_user' |
|
|
|
}), |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1], |
|
|
|
auth_header.header: auth_header.data, |
|
|
|
'Content-Type': 'application/json' |
|
|
|
}) |
|
|
|
result2 = client.post( |
|
|
@ -130,7 +130,7 @@ def test_register_user_twice_failure(auth: AuthActions, client: FlaskClient): |
|
|
|
'name': 'test_registered_user' |
|
|
|
}), |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1], |
|
|
|
auth_header.header: auth_header.data, |
|
|
|
'Content-Type': 'application/json' |
|
|
|
}) |
|
|
|
assert 200 == result1.status_code |
|
|
@ -150,13 +150,13 @@ def test_delete_user_happy_path(auth: AuthActions, client: FlaskClient): |
|
|
|
'name': 'test_registered_user' |
|
|
|
}), |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1], |
|
|
|
auth_header.header: auth_header.data, |
|
|
|
'Content-Type': 'application/json' |
|
|
|
}) |
|
|
|
result2 = client.delete( |
|
|
|
'/user/'+result1.json['name'], |
|
|
|
headers={ |
|
|
|
auth_header[0]: auth_header[1] |
|
|
|
auth_header.header: auth_header.data |
|
|
|
}) |
|
|
|
assert 200 == result1.status_code |
|
|
|
assert result1.json is not None |
|
|
|