Skip to content

Commit

Permalink
Fix tests after responses upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
rebkwok committed Jan 15, 2025
1 parent 3e3cee1 commit 7244c3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/integration/test_old_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_old_api_upload_file(responses):

old_api.upload_file("release-id", relpath, abspath, "testuser")
request = responses.calls[0].request
assert request.body.read() == b"test"
assert request.body == b"test"
assert request.headers["Content-Disposition"] == f'attachment; filename="{relpath}"'
assert request.headers["OS-User"] == "testuser"

Expand Down
8 changes: 4 additions & 4 deletions tests/integration/views/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,8 +1484,8 @@ def test_request_release_files_success(airlock_client, release_files_stubber, st
assert response.url == f"/requests/view/{release_request.id}/"
assert response.status_code == 302

assert api_responses.calls[1].request.body.read() == b"test1"
assert api_responses.calls[2].request.body.read() == b"test2"
assert api_responses.calls[1].request.body == b"test1"
assert api_responses.calls[2].request.body == b"test2"


@pytest.mark.parametrize("status", [RequestStatus.REVIEWED, RequestStatus.APPROVED])
Expand All @@ -1510,8 +1510,8 @@ def test_request_release_files_success_htmx(
assert response.headers["HX-Redirect"] == f"/requests/view/{release_request.id}/"
assert response.status_code == 200

assert api_responses.calls[1].request.body.read() == b"test1"
assert api_responses.calls[2].request.body.read() == b"test2"
assert api_responses.calls[1].request.body == b"test1"
assert api_responses.calls[2].request.body == b"test2"


def test_requests_release_workspace_403(airlock_client):
Expand Down

0 comments on commit 7244c3f

Please sign in to comment.