mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 16:04:09 -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
|
@ -29,6 +29,7 @@ from ansible.playbook.play import Play
|
|||
from ansible.vars import VariableManager
|
||||
|
||||
from units.mock.loader import DictDataLoader
|
||||
from units.mock.path import mock_unfrackpath_noop
|
||||
|
||||
class TestVariableManager(unittest.TestCase):
|
||||
|
||||
|
@ -181,6 +182,7 @@ class TestVariableManager(unittest.TestCase):
|
|||
self.assertEqual(v.get_vars(loader=fake_loader, task=mock_task, use_cache=False).get("foo"), "bar")
|
||||
|
||||
@patch.object(Inventory, 'basedir')
|
||||
@patch('ansible.playbook.role.definition.unfrackpath', mock_unfrackpath_noop)
|
||||
def test_variable_manager_precedence(self, mock_basedir):
|
||||
'''
|
||||
Tests complex variations and combinations of get_vars() with different
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue