Skip to content

Commit 774963e

Browse files
Add failing unit test
Signed-off-by: brycegbrazen <bryce.gattis@brazenanimation.com> Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
1 parent 2c5ef7a commit 774963e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/rez/tests/test_shells.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,22 @@ def _make_alias(ex):
607607
out, _ = p.communicate()
608608
self.assertEqual(1, p.returncode)
609609

610+
@per_available_shell()
611+
def test_alias_non_existent_command_return_code(self, shell):
612+
"""Ensure return codes are correct while using aliases."""
613+
config.override("default_shell", shell)
614+
615+
def _make_alias(ex):
616+
ex.alias('my_alias', 'a_non_existent_executable')
617+
618+
r = self._create_context([])
619+
p = r.execute_shell(command='my_alias',
620+
actions_callback=_make_alias,
621+
stdout=subprocess.PIPE)
622+
623+
out, _ = p.communicate()
624+
self.assertNotEqual(0, p.returncode)
625+
610626

611627
if __name__ == '__main__':
612628
unittest.main()

0 commit comments

Comments
 (0)