From 567593d89549b45c5be1a599f2fa75d276353c59 Mon Sep 17 00:00:00 2001 From: Kayla Nguyen Date: Wed, 3 May 2023 15:21:49 -0700 Subject: [PATCH] chore: update unit tests with headers --- tests/test_cloud_event_functions.py | 3 ++- tests/test_functions.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_cloud_event_functions.py b/tests/test_cloud_event_functions.py index a673c6e4..691fe388 100644 --- a/tests/test_cloud_event_functions.py +++ b/tests/test_cloud_event_functions.py @@ -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() diff --git a/tests/test_functions.py b/tests/test_functions.py index c26cb625..501ea488 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -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