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 5
5
import pytest
6
6
7
7
from aleph .services .ipfs .service import IpfsService
8
+ from aleph .types .message_status import FileContentUnavailable
8
9
9
10
10
11
@pytest .mark .asyncio
@@ -178,14 +179,15 @@ async def test_get_ipfs_size_timeout_error():
178
179
179
180
service = IpfsService (ipfs_client = ipfs_client )
180
181
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" )
185
187
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" )
189
191
190
192
191
193
@pytest .mark .asyncio
You can’t perform that action at this time.
0 commit comments