Skip to content

Commit

Permalink
Improve test_cache_expired_with_etag
Browse files Browse the repository at this point in the history
  • Loading branch information
kingosticks authored Nov 1, 2023
1 parent 6e9c259 commit 723f3c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 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, None)]
"status,expected_unchanged", [(304, True), (200, False)]
)
@responses.activate
def test_cache_expired_with_etag(
Expand All @@ -645,8 +645,9 @@ def test_cache_expired_with_etag(
result = oauth_client.get("tracks/abc", cache)
assert len(responses.calls) == 1
assert responses.calls[0].request.headers["If-None-Match"] == '"1234"'
assert result.get("uri") == expected
assert cache["tracks/abc"] == result
assert result.status_unchanged is expected_unchanged
assert (result.items() == web_response_mock_etag.items()) == expected_unchanged


@responses.activate
Expand Down

0 comments on commit 723f3c3

Please sign in to comment.