mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #48091 from terminalmage/fix-file_roots-monkeypatching
Reverse monkeypatching after test_symlink_list finishes
This commit is contained in:
commit
5a0e3d46e7
1 changed files with 9 additions and 4 deletions
|
@ -174,10 +174,15 @@ class RootsTest(TestCase, AdaptedConfigurationTestCaseMixin, LoaderModuleMockMix
|
|||
self.assertIn('empty_dir', ret)
|
||||
|
||||
def test_symlink_list(self):
|
||||
if self.test_symlink_list_file_roots:
|
||||
self.opts['file_roots'] = self.test_symlink_list_file_roots
|
||||
ret = roots.symlink_list({'saltenv': 'base'})
|
||||
self.assertDictEqual(ret, {'dest_sym': 'source_sym'})
|
||||
orig_file_roots = self.opts['file_roots']
|
||||
try:
|
||||
if self.test_symlink_list_file_roots:
|
||||
self.opts['file_roots'] = self.test_symlink_list_file_roots
|
||||
ret = roots.symlink_list({'saltenv': 'base'})
|
||||
self.assertDictEqual(ret, {'dest_sym': 'source_sym'})
|
||||
finally:
|
||||
if self.test_symlink_list_file_roots:
|
||||
self.opts['file_roots'] = orig_file_roots
|
||||
|
||||
|
||||
class RootsLimitTraversalTest(TestCase, AdaptedConfigurationTestCaseMixin):
|
||||
|
|
Loading…
Add table
Reference in a new issue