Skip to content

Commit e9f08b1

Browse files
committed
Simplify module_utils unit tests.
1 parent 3bc3a71 commit e9f08b1

File tree

2 files changed

+6
-78
lines changed

2 files changed

+6
-78
lines changed

tests/unit/plugins/module_utils/conftest.py

-73
This file was deleted.

tests/unit/plugins/module_utils/test_known_hosts.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@ def test_get_fqdn_and_port(url, fqdn, port):
9393
assert known_hosts.get_fqdn_and_port(url) == (fqdn, port)
9494

9595

96-
@pytest.mark.parametrize('fqdn, port, add_host_key_cmd, stdin',
97-
((URLS[k]['get_fqdn'], URLS[k]['port'], URLS[k]['add_host_key_cmd'], {})
98-
for k in sorted(URLS) if URLS[k]['is_ssh_url']),
99-
indirect=['stdin'])
100-
def test_add_host_key(am, mocker, fqdn, port, add_host_key_cmd):
96+
@pytest.mark.parametrize('fqdn, port, add_host_key_cmd',
97+
((URLS[k]['get_fqdn'], URLS[k]['port'], URLS[k]['add_host_key_cmd'])
98+
for k in sorted(URLS) if URLS[k]['is_ssh_url']))
99+
def test_add_host_key(mocker, fqdn, port, add_host_key_cmd):
100+
am = mocker.MagicMock()
101+
101102
get_bin_path = mocker.MagicMock()
102103
get_bin_path.return_value = keyscan_cmd = "/custom/path/ssh-keyscan"
103104
am.get_bin_path = get_bin_path

0 commit comments

Comments
 (0)