Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
crisog committed Mar 7, 2024
1 parent d93da82 commit 025bfa9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/e2e/test_option_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def handler() -> None:
with create_test_client(handler, cors_config=CORSConfig(allow_origins=["http://testserver.local"])) as client:
response = client.options("/", headers={"Origin": "http://testserver.local"})
assert response.status_code == HTTP_204_NO_CONTENT
assert response.headers.get("Access-Control-Allow-Methods") == "DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT"
assert response.headers.get("Access-Control-Allow-Methods") == "*"
assert response.headers.get("Access-Control-Allow-Origin") == "http://testserver.local"
assert response.headers.get("Vary") == "Origin"

Expand All @@ -60,7 +60,7 @@ def handler() -> None:
with create_test_client(handler, cors_config=CORSConfig(allow_origins=["*"])) as client:
response = client.options("/", headers={"Origin": "http://testserver.local"})
assert response.status_code == HTTP_204_NO_CONTENT
assert response.headers.get("Access-Control-Allow-Methods") == "DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT"
assert response.headers.get("Access-Control-Allow-Methods") == "*"
assert response.headers.get("Access-Control-Allow-Origin") == "*"
assert "Vary" not in response.headers

Expand Down Expand Up @@ -172,8 +172,7 @@ def handler() -> None:
)
assert response.status_code == HTTP_204_NO_CONTENT
assert (
response.headers.get("Access-Control-Allow-Headers")
== "Accept, Accept-Language, Content-Language, Content-Type, X-Another-Header, X-My-Header"
response.headers.get("Access-Control-Allow-Headers") == "*"
)


Expand Down

0 comments on commit 025bfa9

Please sign in to comment.