Browse Source

Update tests

pull/13786/head
Sebastián Ramírez 8 months ago
parent
commit
f7d88c09e5
  1. 2
      tests/test_security_api_key_cookie.py
  2. 2
      tests/test_security_api_key_cookie_description.py
  3. 2
      tests/test_security_api_key_header.py
  4. 2
      tests/test_security_api_key_header_description.py
  5. 2
      tests/test_security_api_key_query.py
  6. 2
      tests/test_security_api_key_query_description.py

2
tests/test_security_api_key_cookie.py

@ -34,7 +34,7 @@ def test_security_api_key_no_key():
response = client.get("/users/me") response = client.get("/users/me")
assert response.status_code == 401, response.text assert response.status_code == 401, response.text
assert response.json() == {"detail": "Not authenticated"} assert response.json() == {"detail": "Not authenticated"}
assert response.headers["WWW-Authenticate"] == 'ApiKey in="cookie", name="key"' assert response.headers["WWW-Authenticate"] == "APIKey"
def test_openapi_schema(): def test_openapi_schema():

2
tests/test_security_api_key_cookie_description.py

@ -34,7 +34,7 @@ def test_security_api_key_no_key():
response = client.get("/users/me") response = client.get("/users/me")
assert response.status_code == 401, response.text assert response.status_code == 401, response.text
assert response.json() == {"detail": "Not authenticated"} assert response.json() == {"detail": "Not authenticated"}
assert response.headers["WWW-Authenticate"] == 'ApiKey in="cookie", name="key"' assert response.headers["WWW-Authenticate"] == "APIKey"
def test_openapi_schema(): def test_openapi_schema():

2
tests/test_security_api_key_header.py

@ -35,7 +35,7 @@ def test_security_api_key_no_key():
response = client.get("/users/me") response = client.get("/users/me")
assert response.status_code == 401, response.text assert response.status_code == 401, response.text
assert response.json() == {"detail": "Not authenticated"} assert response.json() == {"detail": "Not authenticated"}
assert response.headers["WWW-Authenticate"] == 'ApiKey in="header", name="key"' assert response.headers["WWW-Authenticate"] == "APIKey"
def test_openapi_schema(): def test_openapi_schema():

2
tests/test_security_api_key_header_description.py

@ -35,7 +35,7 @@ def test_security_api_key_no_key():
response = client.get("/users/me") response = client.get("/users/me")
assert response.status_code == 401, response.text assert response.status_code == 401, response.text
assert response.json() == {"detail": "Not authenticated"} assert response.json() == {"detail": "Not authenticated"}
assert response.headers["WWW-Authenticate"] == 'ApiKey in="header", name="key"' assert response.headers["WWW-Authenticate"] == "APIKey"
def test_openapi_schema(): def test_openapi_schema():

2
tests/test_security_api_key_query.py

@ -35,7 +35,7 @@ def test_security_api_key_no_key():
response = client.get("/users/me") response = client.get("/users/me")
assert response.status_code == 401, response.text assert response.status_code == 401, response.text
assert response.json() == {"detail": "Not authenticated"} assert response.json() == {"detail": "Not authenticated"}
assert response.headers["WWW-Authenticate"] == 'ApiKey in="query", name="key"' assert response.headers["WWW-Authenticate"] == "APIKey"
def test_openapi_schema(): def test_openapi_schema():

2
tests/test_security_api_key_query_description.py

@ -35,7 +35,7 @@ def test_security_api_key_no_key():
response = client.get("/users/me") response = client.get("/users/me")
assert response.status_code == 401, response.text assert response.status_code == 401, response.text
assert response.json() == {"detail": "Not authenticated"} assert response.json() == {"detail": "Not authenticated"}
assert response.headers["WWW-Authenticate"] == 'ApiKey in="query", name="key"' assert response.headers["WWW-Authenticate"] == "APIKey"
def test_openapi_schema(): def test_openapi_schema():

Loading…
Cancel
Save