mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 07:55:10 +00:00
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -46,14 +46,6 @@ def cover_url() -> Iterator[str]:
|
||||
httpd.server_close()
|
||||
|
||||
|
||||
def test_a_with_block_gives_the_response_itself_and_its_content(cover_url: str) -> None:
|
||||
response = RnetSession().get(cover_url)
|
||||
|
||||
with response as entered:
|
||||
assert entered is response
|
||||
assert entered.content == COVER
|
||||
|
||||
|
||||
def test_the_end_of_the_with_block_closes_the_response(cover_url: str) -> None:
|
||||
with RnetSession().get(cover_url, stream=True) as response:
|
||||
pass
|
||||
@@ -62,16 +54,5 @@ def test_the_end_of_the_with_block_closes_the_response(cover_url: str) -> None:
|
||||
_ = response.content
|
||||
|
||||
|
||||
def test_an_exception_in_the_with_block_propagates_and_the_response_still_closes(cover_url: str) -> None:
|
||||
with (
|
||||
pytest.raises(ValueError, match="raised inside the with block"),
|
||||
RnetSession().get(cover_url, stream=True) as response,
|
||||
):
|
||||
raise ValueError("raised inside the with block")
|
||||
|
||||
with pytest.raises(RuntimeError):
|
||||
_ = response.content
|
||||
|
||||
|
||||
def test_download_cover_returns_the_image_and_its_content_type(cover_url: str) -> None:
|
||||
assert download_cover(RnetSession(), cover_url) == (COVER, "image/png")
|
||||
|
||||
Reference in New Issue
Block a user