Skip to content

Commit

Permalink
Add failing unit test
Browse files Browse the repository at this point in the history
Signed-off-by: brycegbrazen <[email protected]>
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
brycegbrazen authored and JeanChristopheMorinPerso committed Oct 14, 2024
1 parent 2c5ef7a commit 774963e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/rez/tests/test_shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,22 @@ def _make_alias(ex):
out, _ = p.communicate()
self.assertEqual(1, p.returncode)

@per_available_shell()
def test_alias_non_existent_command_return_code(self, shell):
"""Ensure return codes are correct while using aliases."""
config.override("default_shell", shell)

def _make_alias(ex):
ex.alias('my_alias', 'a_non_existent_executable')

r = self._create_context([])
p = r.execute_shell(command='my_alias',
actions_callback=_make_alias,
stdout=subprocess.PIPE)

out, _ = p.communicate()
self.assertNotEqual(0, p.returncode)


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

0 comments on commit 774963e

Please sign in to comment.