File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 44#
55# pip-compile pyproject.toml
66#
7- aiohttp == 3.9.5
7+ aiohappyeyeballs == 2.4.4
8+ # via aiohttp
9+ aiohttp == 3.11.11
810 # via edi_energy_scraper (pyproject.toml)
9- aiosignal == 1.3.1
11+ aiosignal == 1.3.2
1012 # via aiohttp
1113annotated-types == 0.7.0
1214 # via pydantic
13- attrs == 24.2 .0
15+ attrs == 24.3 .0
1416 # via aiohttp
1517efoli == 1.4.0
1618 # via edi_energy_scraper (pyproject.toml)
@@ -27,8 +29,10 @@ multidict==6.1.0
2729 # aiohttp
2830 # yarl
2931propcache == 0.2.1
30- # via yarl
31- pydantic == 2.10.4
32+ # via
33+ # aiohttp
34+ # yarl
35+ pydantic == 2.10.5
3236 # via edi_energy_scraper (pyproject.toml)
3337pydantic-core == 2.27.2
3438 # via pydantic
Original file line number Diff line number Diff line change 66from typing import Awaitable , Union
77
88import aiohttp
9+ from aiohttp import ClientTimeout
910from efoli import get_edifact_format_version
1011from more_itertools import chunked
1112
@@ -40,12 +41,13 @@ def __init__(
4041 self ._root_dir = path_to_mirror_directory
4142 self .tcp_connector = aiohttp .TCPConnector (limit_per_host = connection_limit )
4243 self ._session = aiohttp .ClientSession (connector = self .tcp_connector )
44+ self ._timeout = ClientTimeout (total = 30.0 )
4345
4446 async def get_documents_overview (self ) -> list [Document ]:
4547 """
4648 download meta information about all available documents
4749 """
48- documents_response = await self ._session .get (f"{ self ._root_url } /api/documents" , timeout = 5 )
50+ documents_response = await self ._session .get (f"{ self ._root_url } /api/documents" , timeout = self . _timeout )
4951 response_body = await documents_response .json ()
5052 response_model = ResponseModel .model_validate (response_body )
5153 return response_model .data
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ async def test_download_file(tmp_path: Path) -> None:
6464 assert actual .suffix == ".pdf"
6565
6666
67- def test_cleanup (tmp_path : Path ) -> None :
67+ async def test_cleanup (tmp_path : Path ) -> None : # test is async to avoid RuntimeError: no running event loop
6868 test_folder = tmp_path / "test"
6969 test_folder .mkdir ()
7070 a_directory = test_folder / "adir"
You can’t perform that action at this time.
0 commit comments