Add has_hostkey to mock objects to fix broken unit tests

pull/13586/head
James Cammarata 9 years ago
parent e5c2c03dea
commit d7f2f606e1

@ -76,6 +76,7 @@ class TestStrategyBase(unittest.TestCase):
for i in range(0, 5): for i in range(0, 5):
mock_host = MagicMock() mock_host = MagicMock()
mock_host.name = "host%02d" % (i+1) mock_host.name = "host%02d" % (i+1)
mock_host.has_hostkey = True
mock_hosts.append(mock_host) mock_hosts.append(mock_host)
mock_inventory = MagicMock() mock_inventory = MagicMock()
@ -111,6 +112,7 @@ class TestStrategyBase(unittest.TestCase):
fake_loader = DictDataLoader() fake_loader = DictDataLoader()
mock_var_manager = MagicMock() mock_var_manager = MagicMock()
mock_host = MagicMock() mock_host = MagicMock()
mock_host.has_hostkey = True
mock_inventory = MagicMock() mock_inventory = MagicMock()
mock_options = MagicMock() mock_options = MagicMock()
mock_options.module_path = None mock_options.module_path = None
@ -171,6 +173,7 @@ class TestStrategyBase(unittest.TestCase):
mock_host = MagicMock() mock_host = MagicMock()
mock_host.name = 'test01' mock_host.name = 'test01'
mock_host.vars = dict() mock_host.vars = dict()
mock_host.has_hostkey = True
mock_task = MagicMock() mock_task = MagicMock()
mock_task._role = None mock_task._role = None
@ -347,6 +350,7 @@ class TestStrategyBase(unittest.TestCase):
mock_host = MagicMock(Host) mock_host = MagicMock(Host)
mock_host.name = "test01" mock_host.name = "test01"
mock_host.has_hostkey = True
mock_inventory = MagicMock() mock_inventory = MagicMock()
mock_inventory.get_hosts.return_value = [mock_host] mock_inventory.get_hosts.return_value = [mock_host]

Loading…
Cancel
Save