mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add has_hostkey to mock objects to fix broken unit tests
This commit is contained in:
parent
e5c2c03dea
commit
d7f2f606e1
1 changed files with 4 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue