mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Reverse monkeypatching after test_symlink_list finishes
On Windows, in test_symlink_list we monkeypatch the file_roots. However, we don't ever reverse that monkeypatching. This would not have affected other test classes, because the opts we are monkeypatching are ones created specifically for that test class. And due to the lexicographic order in which the tests are run, test_symlink_list is run last. However, if we were to ever add a test to that test class which would run after test_symlink_list, it would be affected by the monkeypatching.
This commit is contained in:
parent
053b019a8f
commit
6fe711ad76
@ -174,10 +174,15 @@ class RootsTest(TestCase, AdaptedConfigurationTestCaseMixin, LoaderModuleMockMix
|
||||
self.assertIn('empty_dir', ret)
|
||||
|
||||
def test_symlink_list(self):
|
||||
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…
Reference in New Issue
Block a user