Skip to content

Commit 7ef0088

Browse files
committed
Added test to check find_executable config override works correctly
Signed-off-by: george.ridal <[email protected]>
1 parent 6b52c95 commit 7ef0088

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/rez/tests/test_shells.py

+12
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,18 @@ def _make_alias(ex):
607607
out, _ = p.communicate()
608608
self.assertEqual(1, p.returncode)
609609

610+
@per_available_shell()
611+
def test_find_executable_config_override(self, shell):
612+
"""Test the shell plugin returns correct exec override from settings."""
613+
config.override("default_shell", shell)
614+
override_attr = "plugins.shell.{}.executable_fullpath".format(shell)
615+
cls = type(create_shell(shell))
616+
with tempfile.TemporaryDirectory() as td:
617+
exe_path = os.path.join(td, cls.executable_name())
618+
with open(exe_path, 'w'):
619+
config.override(override_attr, exe_path)
620+
assert cls.find_executable(cls.executable_name()) == exe_path
621+
610622

611623
if __name__ == '__main__':
612624
unittest.main()

0 commit comments

Comments
 (0)