mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Add has_hostkey to mock objects to fix broken unit tests
This commit is contained in:
@@ -76,6 +76,7 @@ class TestStrategyBase(unittest.TestCase):
|
||||
for i in range(0, 5):
|
||||
mock_host = MagicMock()
|
||||
mock_host.name = "host%02d" % (i+1)
|
||||
mock_host.has_hostkey = True
|
||||
mock_hosts.append(mock_host)
|
||||
|
||||
mock_inventory = MagicMock()
|
||||
@@ -111,6 +112,7 @@ class TestStrategyBase(unittest.TestCase):
|
||||
fake_loader = DictDataLoader()
|
||||
mock_var_manager = MagicMock()
|
||||
mock_host = MagicMock()
|
||||
mock_host.has_hostkey = True
|
||||
mock_inventory = MagicMock()
|
||||
mock_options = MagicMock()
|
||||
mock_options.module_path = None
|
||||
@@ -171,6 +173,7 @@ class TestStrategyBase(unittest.TestCase):
|
||||
mock_host = MagicMock()
|
||||
mock_host.name = 'test01'
|
||||
mock_host.vars = dict()
|
||||
mock_host.has_hostkey = True
|
||||
|
||||
mock_task = MagicMock()
|
||||
mock_task._role = None
|
||||
@@ -347,6 +350,7 @@ class TestStrategyBase(unittest.TestCase):
|
||||
|
||||
mock_host = MagicMock(Host)
|
||||
mock_host.name = "test01"
|
||||
mock_host.has_hostkey = True
|
||||
|
||||
mock_inventory = MagicMock()
|
||||
mock_inventory.get_hosts.return_value = [mock_host]
|
||||
|
||||
Reference in New Issue
Block a user