mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Creating playbook executor and dependent classes
This commit is contained in:
parent
b6c3670f8a
commit
62d79568be
158 changed files with 22486 additions and 2353 deletions
|
@ -23,12 +23,12 @@ from ansible.compat.tests import unittest
|
|||
from ansible.compat.tests.mock import patch, MagicMock
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleParserError
|
||||
from ansible.executor.playbook_iterator import PlaybookIterator
|
||||
from ansible.executor.play_iterator import PlayIterator
|
||||
from ansible.playbook import Playbook
|
||||
|
||||
from test.mock.loader import DictDataLoader
|
||||
|
||||
class TestPlaybookIterator(unittest.TestCase):
|
||||
class TestPlayIterator(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
@ -36,10 +36,11 @@ class TestPlaybookIterator(unittest.TestCase):
|
|||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def test_playbook_iterator(self):
|
||||
def test_play_iterator(self):
|
||||
fake_loader = DictDataLoader({
|
||||
"test_play.yml": """
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
roles:
|
||||
- test_role
|
||||
pre_tasks:
|
||||
|
@ -64,8 +65,9 @@ class TestPlaybookIterator(unittest.TestCase):
|
|||
|
||||
inventory = MagicMock()
|
||||
inventory.get_hosts.return_value = hosts
|
||||
inventory.filter_hosts.return_value = hosts
|
||||
|
||||
itr = PlaybookIterator(inventory, None, p)
|
||||
itr = PlayIterator(inventory, p._entries[0])
|
||||
task = itr.get_next_task_for_host(hosts[0])
|
||||
print(task)
|
||||
self.assertIsNotNone(task)
|
Loading…
Add table
Add a link
Reference in a new issue