Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
facutuesca committed Sep 3, 2024
1 parent 1bc7aa7 commit f0e12da
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/unit/packaging/test_metadata_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,9 @@ def test_verify_url_pypi(url, project_name, project_normalized_name, expected):
def test_get_url_content(monkeypatch):
url = rfc3986.api.uri_reference("https://example.com")

def iter_content():
yield "content"

response = pretend.stub(
drain_conn=pretend.call_recorder(lambda: None),
release_conn=pretend.call_recorder(lambda: None),
stream=lambda amt: iter_content(),
close=pretend.call_recorder(lambda: None),
read=lambda amt: "content",
)
pool = pretend.stub(request=lambda *args, **kwargs: response)
monkeypatch.setattr(
Expand All @@ -163,8 +159,7 @@ def iter_content():
)
== "content"
)
assert response.drain_conn.calls == [pretend.call()]
assert response.release_conn.calls == [pretend.call()]
assert response.close.calls == [pretend.call()]


def test_verify_url_meta_tag_urllib_raises(monkeypatch):
Expand Down

0 comments on commit f0e12da

Please sign in to comment.