karan5291 commented on a change in pull request #5173: AIRFLOW-4295. Make
comparison of `method` case insensitive in HttpHook
URL: https://github.com/apache/airflow/pull/5173#discussion_r279288558
##########
File path: tests/hooks/test_http_hook.py
##########
@@ -131,6 +132,28 @@ def test_hook_contains_header_from_extra_field(self, m):
self.assertDictContainsSubset(json.loads(expected_conn.extra),
conn.headers)
self.assertEqual(conn.headers.get('bareer'), 'test')
+ @requests_mock.mock()
+ @mock.patch('requests.Request')
+ def test_hook_with_method_in_lowercase(self, m, request_mock):
+ from requests.exceptions import MissingSchema
+ with mock.patch(
+ 'airflow.hooks.base_hook.BaseHook.get_connection',
+ side_effect=get_airflow_connection_with_port
+ ):
+ data = "test params"
+ try:
+ self.get_lowercase_hook.run('v1/test', data=data)
+ except MissingSchema:
+ pass
+ request_mock.assert_called_once_with(
+ mock.ANY,
+ mock.ANY,
+ headers=mock.ANY,
+ params=data
+ )
+
+
+
Review comment:
Travis build failed
```
No output has been received in the last 10m0s, this potentially indicates a
stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on:
https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated
```
Maybe it need to be restarted?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services