Lee-W commented on code in PR #37696:
URL: https://github.com/apache/airflow/pull/37696#discussion_r1502268210
##########
tests/providers/http/hooks/test_http.py:
##########
@@ -648,3 +648,25 @@ def test_process_extra_options_from_connection(self):
"max_redirects": 3,
}
assert actual == {"bearer": "test"}
+
+ @pytest.mark.asyncio
+ async def test_build_request_url_from_connection(self):
+ conn = get_airflow_connection()
+ schema = conn.schema or "http" # default to http
+ with mock.patch("airflow.hooks.base.BaseHook.get_connection",
side_effect=get_airflow_connection):
+ hook = HttpAsyncHook()
+ with mock.patch("aiohttp.ClientSession.post",
new_callable=mock.AsyncMock) as mocked_function:
+ await hook.run("v1/test")
+ assert mocked_function.call_args.args[0] == schema + "://" +
conn.host + "v1/test"
Review Comment:
```suggestion
assert mocked_function.call_args.args[0] ==
f"{schema}://{conn.host}v1/test"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]