MCPcopy Create free account
hub / github.com/apify/impit / test_local_address

Method test_local_address

impit-python/test/async_client_test.py:413–426  ·  view source on GitHub ↗
(self, browser: Browser, addresses: tuple[str, str])

Source from the content-addressed store, hash-verified

411 @pytest.mark.asyncio
412 @pytest.mark.parametrize('addresses', [['127.0.0.1', '::ffff:127.0.0.1'], ['::1', '::1']])
413 async def test_local_address(self, browser: Browser, addresses: tuple[str, str]) -> None:
414 port_holder = [0]
415 thread = threading.Thread(target=thread_server, args=(port_holder,))
416 thread.start()
417 await asyncio.sleep(0.1)
418
419 [local_address, remote_address] = addresses
420
421 impit = AsyncClient(browser=browser, local_address=local_address)
422
423 response = await impit.get(f'http://localhost:{port_holder[0]}/', timeout=5)
424 assert response.text == remote_address
425 assert response.status_code == 200
426 thread.join()
427
428
429@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

getMethod · 0.95
AsyncClientClass · 0.90

Tested by

no test coverage detected