mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Tweak variable manager use in role includes to avoid test failures
This commit is contained in:
parent
a89412ecb1
commit
dfa33d0f23
3 changed files with 18 additions and 7 deletions
|
@ -56,7 +56,11 @@ class TestPlayIterator(unittest.TestCase):
|
|||
""",
|
||||
})
|
||||
|
||||
p = Playbook.load('test_play.yml', loader=fake_loader)
|
||||
mock_var_manager = MagicMock()
|
||||
mock_var_manager._fact_cache = dict()
|
||||
mock_var_manager.get_vars.return_value = dict()
|
||||
|
||||
p = Playbook.load('test_play.yml', loader=fake_loader, variable_manager=mock_var_manager)
|
||||
|
||||
hosts = []
|
||||
for i in range(0, 10):
|
||||
|
@ -68,9 +72,6 @@ class TestPlayIterator(unittest.TestCase):
|
|||
inventory.get_hosts.return_value = hosts
|
||||
inventory.filter_hosts.return_value = hosts
|
||||
|
||||
mock_var_manager = MagicMock()
|
||||
mock_var_manager._fact_cache = dict()
|
||||
|
||||
play_context = PlayContext(play=p._entries[0])
|
||||
|
||||
itr = PlayIterator(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue