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]>
  • Loading branch information
brycegbrazen committed Jul 23, 2024
1 parent a13f7bb commit 9b7d8ba
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 @@ -591,6 +591,22 @@ def _make_alias(ex):
out, _ = p.communicate()
self.assertEqual(0, 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 9b7d8ba

Please sign in to comment.