mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
Fixing up v2 unit tests
This commit is contained in:
parent
361eb29146
commit
1ca8cb8553
4 changed files with 21 additions and 10 deletions
|
@ -23,6 +23,7 @@ from ansible.compat.tests import unittest
|
|||
from ansible.compat.tests.mock import patch, MagicMock
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleParserError
|
||||
from ansible.executor.connection_info import ConnectionInformation
|
||||
from ansible.executor.play_iterator import PlayIterator
|
||||
from ansible.playbook import Playbook
|
||||
|
||||
|
@ -67,19 +68,28 @@ class TestPlayIterator(unittest.TestCase):
|
|||
inventory.get_hosts.return_value = hosts
|
||||
inventory.filter_hosts.return_value = hosts
|
||||
|
||||
itr = PlayIterator(inventory, p._entries[0])
|
||||
task = itr.get_next_task_for_host(hosts[0])
|
||||
connection_info = ConnectionInformation(play=p._entries[0])
|
||||
|
||||
itr = PlayIterator(
|
||||
inventory=inventory,
|
||||
play=p._entries[0],
|
||||
connection_info=connection_info,
|
||||
all_vars=dict(),
|
||||
)
|
||||
|
||||
(host_state, task) = itr.get_next_task_for_host(hosts[0])
|
||||
print(task)
|
||||
self.assertIsNotNone(task)
|
||||
task = itr.get_next_task_for_host(hosts[0])
|
||||
(host_state, task) = itr.get_next_task_for_host(hosts[0])
|
||||
print(task)
|
||||
self.assertIsNotNone(task)
|
||||
task = itr.get_next_task_for_host(hosts[0])
|
||||
(host_state, task) = itr.get_next_task_for_host(hosts[0])
|
||||
print(task)
|
||||
self.assertIsNotNone(task)
|
||||
task = itr.get_next_task_for_host(hosts[0])
|
||||
(host_state, task) = itr.get_next_task_for_host(hosts[0])
|
||||
print(task)
|
||||
self.assertIsNotNone(task)
|
||||
task = itr.get_next_task_for_host(hosts[0])
|
||||
(host_state, task) = itr.get_next_task_for_host(hosts[0])
|
||||
print(task)
|
||||
self.assertIsNone(task)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue