You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units/module_utils/urls
Martin Krizek 600c1e67b4
Exceptions clean up (#85176)
* replace usage of `IOError` as it is an alias to `OSError`
* replace usage of `socket.error` as it is an alias to `OSError`
* use subclasses of `OSError` rather than inspecting `errno`s
* utilize `exist_ok` parameter of `os.makedirs` rather than ignoring
  `FileExistsError`

Make the following changes to the exception handling this patch already
updates to be consistent with the new code:
* use `ex` as a name for exception being handled
* use `from ex` when re-raising exception for additional context
* use f-strings and `!r` for quoting
* pass exceptions to the `exception` parameter of `fail_json`
* use `display.error_as_warning` rather than passing stringified
  exception into `display.warning`

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
..
fixtures adding option for form-multipart data to switch multipart encoding (#80566) 12 months ago
__init__.py Add unit tests for ansible.module_utils.urls (#38059) 8 years ago
test_RedirectHandlerFactory.py Remove py2 support from urls.py (#81880) 2 years ago
test_Request.py Fix url encoded credentials in netloc (#82552) 2 years ago
test_channel_binding.py Require `from __future__ import annotations` (#81902) 2 years ago
test_fetch_file.py Require `from __future__ import annotations` (#81902) 2 years ago
test_fetch_url.py Exceptions clean up (#85176) 6 months ago
test_generic_urlparse.py Remove Python 2 compat (via six) from unit tests 2 years ago
test_gzip.py Update triple single quotes to triple double quotes (#84099) 1 year ago
test_prepare_multipart.py adding option for form-multipart data to switch multipart encoding (#80566) 12 months ago
test_split.py Require `from __future__ import annotations` (#81902) 2 years ago
test_urls.py Remove py2 support from urls.py (#81880) 2 years ago