Skip to content

Commit d3b3cda

Browse files
vanridalmaxnbk
authored andcommitted
Added test to check find_executable config override works correctly
Signed-off-by: george.ridal <george.ridal@findesign.com.au>
1 parent dc916f8 commit d3b3cda

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/rez/tests/test_shells.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,18 @@ def _make_alias(ex):
641641
out, _ = p.communicate()
642642
self.assertEqual(1, p.returncode)
643643

644+
@per_available_shell()
645+
def test_find_executable_config_override(self, shell):
646+
"""Test the shell plugin returns correct exec override from settings."""
647+
config.override("default_shell", shell)
648+
override_attr = "plugins.shell.{}.executable_fullpath".format(shell)
649+
cls = type(create_shell(shell))
650+
with tempfile.TemporaryDirectory() as td:
651+
exe_path = os.path.join(td, cls.executable_name())
652+
with open(exe_path, 'w'):
653+
config.override(override_attr, exe_path)
654+
assert cls.find_executable(cls.executable_name()) == exe_path
655+
644656

645657
if __name__ == '__main__':
646658
unittest.main()

0 commit comments

Comments
 (0)