tests: updated tests for new authentication protocols and for new sample short info
This commit is contained in:
1 parent
c3bc745210
commit
076c796b4d
6 files changed
+134
-117
No files matched your search
@@ -49,9 +49,13 @@ def test_omega_put(client):
|
||||
|
||||
|
||||
def test_login_success(client):
|
||||
with patch("aare.daq.auth.authenticate_user") as mock_auth:
|
||||
mock_auth.return_value = "fake-access-token"
|
||||
response = client.post("/token", data={"username": "user", "password": "pwd"})
|
||||
with patch("aare.daq.auth.authenticate_from_proxy_header", return_value="user"), \
|
||||
patch("aare.daq.auth.authenticate_user", return_value="fake-access-token"):
|
||||
response = client.post(
|
||||
"/token",
|
||||
data={"username": "user", "password": "pwd"},
|
||||
headers={"X-Remote-User": "user"},
|
||||
)
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"access_token": "fake-access-token", "token_type": "bearer"}
|
||||
|
||||
|
||||
Reference in new issue
Block a user