Skip to content

Commit

Permalink
Fixed 304 mock response
Browse files Browse the repository at this point in the history
304 response cannot set a body
  • Loading branch information
kingosticks authored Nov 1, 2023
1 parent 4e0f5eb commit 661b40c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def test_cache_normalised_query_string(


@pytest.mark.parametrize(
"status,expected", [(304, "spotify:track:abc"), (200, "spotify:track:xyz")]
"status,json,expected", [(304, None, "spotify:track:abc"), (200, {"uri": "spotify:track:xyz"}, "spotify:track:xyz")]
)
@responses.activate
def test_cache_expired_with_etag(
Expand All @@ -637,7 +637,7 @@ def test_cache_expired_with_etag(
responses.add(
responses.GET,
"https://api.spotify.com/v1/tracks/abc",
json={"uri": "spotify:track:xyz hello"},
json=json,
status=status,
)
mock_time.return_value = 1001
Expand Down

0 comments on commit 661b40c

Please sign in to comment.