File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 55import pytest
66
77from aleph .services .ipfs .service import IpfsService
8+ from aleph .types .message_status import FileContentUnavailable
89
910
1011@pytest .mark .asyncio
@@ -178,14 +179,15 @@ async def test_get_ipfs_size_timeout_error():
178179
179180 service = IpfsService (ipfs_client = ipfs_client )
180181
181- # Mock asyncio.sleep to not actually sleep during test
182- with patch ("asyncio.sleep" , new_callable = AsyncMock ):
183- # Execute
184- result = await service .get_ipfs_size ("test_hash" )
182+ with pytest .raises (FileContentUnavailable ):
183+ # Mock asyncio.sleep to not actually sleep during test
184+ with patch ("asyncio.sleep" , new_callable = AsyncMock ):
185+ # Execute
186+ result = await service .get_ipfs_size ("test_hash" )
185187
186- # Assert
187- assert result is None
188- ipfs_client .dag .get .assert_called_once_with ("test_hash" )
188+ # Assert
189+ assert result is None
190+ ipfs_client .dag .get .assert_called_once_with ("test_hash" )
189191
190192
191193@pytest .mark .asyncio
You can’t perform that action at this time.
0 commit comments