mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-24 21:14:00 -07:00
Fix mock loader for osx /etc symlinks (#16074)
Fix role based unit tests for osx via mock.patch
This commit is contained in:
parent
c06884eff0
commit
373b23cc24
5 changed files with 21 additions and 0 deletions
|
|
@ -28,6 +28,8 @@ from ansible.playbook.play import Play
|
|||
from ansible.playbook.role import Role
|
||||
|
||||
from units.mock.loader import DictDataLoader
|
||||
from units.mock.path import mock_unfrackpath_noop
|
||||
|
||||
|
||||
class TestPlay(unittest.TestCase):
|
||||
|
||||
|
|
@ -102,6 +104,7 @@ class TestPlay(unittest.TestCase):
|
|||
post_tasks=[dict(action='shell echo "hello world"')],
|
||||
))
|
||||
|
||||
@patch('ansible.playbook.role.definition.unfrackpath', mock_unfrackpath_noop)
|
||||
def test_play_with_roles(self):
|
||||
fake_loader = DictDataLoader({
|
||||
'/etc/ansible/roles/foo/tasks.yml': """
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue