async def ping( digits_list: List[int], aiohttp_client: aiohttp.ClientSession, history: ResponseHistory, ) -> None: x_correlation_id = get_x_correlation_id() response = await aiohttp_client.post( url=build_url(getenv("SERVICE_A_BASE_URL", DEFAULT_SERVICE_A_BASE_URL), "/ping"), json={"digits": digits_list}, headers={"x-correlation-id": x_correlation_id}, ) await history.add(x_correlation_id, response)
def test_no_slashes(self): self.assertEqual( build_url(base_url="https://example.com", path="foobar"), "https://example.com/foobar", )
def test_leading_slash_path(self): self.assertEqual( build_url(base_url="https://example.com/", path="foobar"), "https://example.com/foobar", )