8000 chore: update unit tests with headers by KaylaNguyen · Pull Request #239 · GoogleCloudPlatform/functions-framework-python · GitHub
[go: up one dir, main page]

Skip to content

chore: update unit tests with headers #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/test_cloud_event_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ def test_invalid_fields_binary(client, create_headers_binary, data_payload):


def test_unparsable_cloud_event(client):
resp = client.post("/", headers={}, data="")
headers = {"Content-Type": "application/cloudevents+json"}
resp = client.post("/", headers=headers, data="")

assert resp.status_code == 400
assert "Bad Request" in resp.data.decode()
Expand Down
3 changes: 2 additions & 1 deletion tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ def test_pubsub_payload(background_event_client, background_json):


def test_background_function_no_data(background_event_client, background_json):
resp = background_event_client.post("/")
headers = {"Content-Type": "application/json"}
resp = background_event_client.post("/", headers=headers)
assert resp.status_code == 400


Expand Down
0