|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | | -import base64 |
4 | 3 | import json |
5 | 4 | import os |
6 | 5 | import pathlib |
@@ -232,7 +231,7 @@ def test_action__pull_request__store_comment_not_targeting_default( |
232 | 231 | session.register( |
233 | 232 | "GET", |
234 | 233 | "/repos/py-cov-action/foobar/contents/data.json", |
235 | | - )(json={"content": base64.b64encode(payload.encode()).decode()}) |
| 234 | + )(text=payload, headers={"content-type": "application/vnd.github.raw+json"}) |
236 | 235 |
|
237 | 236 | # Who am I |
238 | 237 | session.register("GET", "/user")(json={"login": "foo"}) |
@@ -293,7 +292,7 @@ def test_action__pull_request__post_comment( |
293 | 292 | session.register( |
294 | 293 | "GET", |
295 | 294 | "/repos/py-cov-action/foobar/contents/data.json", |
296 | | - )(json={"content": base64.b64encode(payload.encode()).decode()}) |
| 295 | + )(text=payload, headers={"content-type": "application/vnd.github.raw+json"}) |
297 | 296 |
|
298 | 297 | # Who am I |
299 | 298 | session.register("GET", "/user")(json={"login": "foo"}) |
@@ -355,7 +354,7 @@ def test_action__push__non_default_branch( |
355 | 354 | session.register( |
356 | 355 | "GET", |
357 | 356 | "/repos/py-cov-action/foobar/contents/data.json", |
358 | | - )(json={"content": base64.b64encode(payload.encode()).decode()}) |
| 357 | + )(text=payload, headers={"content-type": "application/vnd.github.raw+json"}) |
359 | 358 |
|
360 | 359 | session.register( |
361 | 360 | "GET", |
@@ -444,7 +443,7 @@ def test_action__push__non_default_branch__no_pr( |
444 | 443 | session.register( |
445 | 444 | "GET", |
446 | 445 | "/repos/py-cov-action/foobar/contents/data.json", |
447 | | - )(json={"content": base64.b64encode(payload.encode()).decode()}) |
| 446 | + )(text=payload, headers={"content-type": "application/vnd.github.raw+json"}) |
448 | 447 |
|
449 | 448 | session.register( |
450 | 449 | "GET", |
@@ -498,7 +497,7 @@ def test_action__pull_request__force_store_comment( |
498 | 497 | session.register( |
499 | 498 | "GET", |
500 | 499 | "/repos/py-cov-action/foobar/contents/data.json", |
501 | | - )(json={"content": base64.b64encode(payload.encode()).decode()}) |
| 500 | + )(text=payload, headers={"content-type": "application/vnd.github.raw+json"}) |
502 | 501 |
|
503 | 502 | git.register("git fetch origin main --depth=1000")() |
504 | 503 | git.register("git diff --unified=0 FETCH_HEAD -- .")(stdout=DIFF_STDOUT) |
|
0 commit comments