Skip to content

Commit b4e9fc5

Browse files
authored
chore: update unit tests with headers (#239)
1 parent b826b2a commit b4e9fc5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/test_cloud_event_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ def test_invalid_fields_binary(client, create_headers_binary, data_payload):
187187

188188

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

192193
assert resp.status_code == 400
193194
assert "Bad Request" in resp.data.decode()

tests/test_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ def test_pubsub_payload(background_event_client, background_json):
251251

252252

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

257258

0 commit comments

Comments
 (0)