Skip to content

Commit 584a3e0

Browse files
committed
fix immediate login test
1 parent f214209 commit 584a3e0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/pbench/test/unit/server/test_user_auth.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,24 +171,24 @@ def test_user_relogin(client, server_config):
171171
assert data["message"] == "Retry login after some time"
172172
assert response.status_code == 403
173173

174-
# Immediate re-login without auth header
174+
# Re-login after a second
175+
time.sleep(1)
175176
response = client.post(
176177
f"{server_config.rest_uri}/login",
177178
json={"username": "user", "password": "12345"},
178179
)
179180
data = response.json
180-
assert data["message"] == "Retry login after some time"
181-
assert response.status_code == 409
181+
assert data["auth_token"]
182+
assert data["status"] == "success"
182183

183-
# Re-login after a second
184-
time.sleep(1)
184+
# Immediate re-login without auth header
185185
response = client.post(
186186
f"{server_config.rest_uri}/login",
187187
json={"username": "user", "password": "12345"},
188188
)
189189
data = response.json
190-
assert data["auth_token"]
191-
assert data["status"] == "success"
190+
assert data["message"] == "Retry login after some time"
191+
assert response.status_code == 409
192192

193193
@staticmethod
194194
def test_user_login_with_wrong_password(client, server_config):

0 commit comments

Comments
 (0)