diff options
author | Matt Clay <matt@mystile.com> | 2020-03-12 23:23:00 -0700 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2020-03-12 23:56:11 -0700 |
commit | f240531bdaf17666f7efd4e13d3ec341e89d50a3 (patch) | |
tree | db0861c426a68633e2cbd2dc50c8f4b45c528856 /test/units/modules/packaging/os/conftest.py | |
parent | 7c27ae4702ab6434946c6632a0bf8528b9347e1f (diff) | |
download | ansible-f240531bdaf17666f7efd4e13d3ec341e89d50a3.tar.gz |
Remove unused unit test files.
Diffstat (limited to 'test/units/modules/packaging/os/conftest.py')
-rw-r--r-- | test/units/modules/packaging/os/conftest.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/test/units/modules/packaging/os/conftest.py b/test/units/modules/packaging/os/conftest.py deleted file mode 100644 index 1c5560a909..0000000000 --- a/test/units/modules/packaging/os/conftest.py +++ /dev/null @@ -1,29 +0,0 @@ -from units.compat.mock import patch -from ansible.module_utils.six.moves import xmlrpc_client - -import pytest - - -def get_method_name(request_body): - return xmlrpc_client.loads(request_body)[1] - - -@pytest.fixture -def mock_request(request, mocker): - responses = request.getfixturevalue('testcase')['calls'] - module_name = request.module.TESTED_MODULE - - def transport_request(host, handler, request_body, verbose=0): - """Fake request""" - method_name = get_method_name(request_body) - excepted_name, response = responses.pop(0) - if method_name == excepted_name: - if isinstance(response, Exception): - raise response - else: - return response - else: - raise Exception('Expected call: %r, called with: %r' % (excepted_name, method_name)) - - target = '{0}.xmlrpc_client.Transport.request'.format(module_name) - mocker.patch(target, side_effect=transport_request) |