Skip to content

Commit 3a2b677

Browse files
authored
test: correct mock after upgrade to eodag 3.9 (#61)
`StreamResponse` requires the use of parameter `filename` to set the `content-disposition` header. The change on EODAG was done by CS-SI/eodag@182cdc0 Signed-off-by: Aubin Lambaré <aubin.lambare@cs-soprasteria.com>
1 parent 8389893 commit 3a2b677

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ async def stream_response():
9696
"""
9797
return StreamResponse(
9898
content=iter(ascii_uppercase),
99-
headers={"content-disposition": "attachment; filename=alphabet.txt", "content-type": "text/plain"},
99+
filename="alphabet.txt",
100+
headers={"content-type": "text/plain"},
100101
)
101102

102103

tests/test_download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def test_download_item_from_collection_stream(
3535

3636
resp = await request_valid_raw(f"data/peps/{defaults.product_type}/foo/downloadLink")
3737
assert resp.content == b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
38-
assert resp.headers["content-disposition"] == "attachment; filename=alphabet.txt"
38+
assert resp.headers["content-disposition"] == 'attachment; filename="alphabet.txt"'
3939
assert resp.headers["content-type"] == "text/plain"
4040

4141

0 commit comments

Comments
 (0)