Fix synology_dsm test side effects (#114722)

This commit is contained in:
Robert Resch 2024-04-03 11:11:56 +02:00 committed by GitHub
parent be3c923c7f
commit 74d8c6cce4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -428,6 +428,8 @@ async def test_media_view(
# success
dsm_with_photos.photos.download_item = AsyncMock(return_value=b"xxxx")
tempfile.tempdir = tmp_path
result = await view.get(request, "mocked_syno_dsm_entry", "10_1298753/filename.jpg")
assert isinstance(result, web.Response)
with patch.object(tempfile, "tempdir", tmp_path):
result = await view.get(
request, "mocked_syno_dsm_entry", "10_1298753/filename.jpg"
)
assert isinstance(result, web.Response)