mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 12:51:25 -07:00
uri/win_uri: Make method a free text field (#49719)
* uri/win_uri: Make method a free text field Since various interfaces introduce their own HTTP method (e.g. like PROPFIND, LIST or TRACE) it's better to leave this up to the user. * Fix HTTP method check in module_utils urls * Add integration test for method UNKNOWN * Clarify the change as requested during review
This commit is contained in:
parent
81ec48c7b4
commit
4e6c113bf0
7 changed files with 50 additions and 11 deletions
|
@ -363,8 +363,14 @@ def test_Request_open_cookies(urlopen_mock, install_opener_mock):
|
|||
|
||||
|
||||
def test_Request_open_invalid_method(urlopen_mock, install_opener_mock):
|
||||
with pytest.raises(ConnectionError):
|
||||
r = Request().open('BOGUS', 'https://ansible.com/')
|
||||
r = Request().open('UNKNOWN', 'https://ansible.com/')
|
||||
|
||||
args = urlopen_mock.call_args[0]
|
||||
req = args[0]
|
||||
|
||||
assert req.data is None
|
||||
assert req.get_method() == 'UNKNOWN'
|
||||
# assert r.status == 504
|
||||
|
||||
|
||||
def test_Request_open_custom_method(urlopen_mock, install_opener_mock):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue