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

Method test_local_address

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

Source from the content-addressed store, hash-verified

391
392 @pytest.mark.parametrize('addresses', [['127.0.0.1', '::ffff:127.0.0.1'], ['::1', '::1']])
393 def test_local_address(self, browser: Browser, addresses: tuple[str, str]) -> None:
394 port_holder = [0]
395 thread = threading.Thread(target=thread_server, args=(port_holder,))
396 thread.start()
397 time.sleep(0.1)
398
399 [local_address, remote_address] = addresses
400
401 impit = Client(browser=browser, local_address=local_address)
402
403 response = impit.get(f'http://localhost:{port_holder[0]}/', timeout=5)
404 assert response.text == remote_address
405 assert response.status_code == 200
406 thread.join()
407
408
409@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

getMethod · 0.95
ClientClass · 0.90

Tested by

no test coverage detected