Skip to content

Commit 50b2fda

Browse files
committed
tests update
1 parent f85d811 commit 50b2fda

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/unit/test_configuration.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ def test_global_configuration_works() -> None:
2424
is service_locator.get_configuration()
2525
)
2626

27+
assert (
28+
service_locator.get_configuration()
29+
is service_locator.get_configuration()
30+
is Configuration.get_global_configuration()
31+
is Configuration.get_global_configuration()
32+
)
33+
2734

2835
async def test_storage_not_persisted_when_disabled(tmp_path: Path, httpbin: URL) -> None:
2936
config = Configuration(
@@ -32,9 +39,8 @@ async def test_storage_not_persisted_when_disabled(tmp_path: Path, httpbin: URL)
3239
crawlee_storage_dir=str(tmp_path), # type: ignore[call-arg]
3340
)
3441
storage_client = MemoryStorageClient.from_config(config)
35-
service_locator.set_storage_client(storage_client)
3642

37-
crawler = HttpCrawler()
43+
crawler = HttpCrawler(storage_client=storage_client)
3844

3945
@crawler.router.default_handler
4046
async def default_handler(context: HttpCrawlingContext) -> None:
@@ -54,9 +60,8 @@ async def test_storage_persisted_when_enabled(tmp_path: Path, httpbin: URL) -> N
5460
crawlee_storage_dir=str(tmp_path), # type: ignore[call-arg]
5561
)
5662
storage_client = MemoryStorageClient.from_config(config)
57-
service_locator.set_storage_client(storage_client)
5863

59-
crawler = HttpCrawler()
64+
crawler = HttpCrawler(storage_client=storage_client)
6065

6166
@crawler.router.default_handler
6267
async def default_handler(context: HttpCrawlingContext) -> None:

0 commit comments

Comments
 (0)