Skip to content

Commit

Permalink
Clarify test output slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
fbrennen committed Jun 5, 2020
1 parent 27b4b68 commit c54c655
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/unit/test_elfpatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@ def test_set_rpath(self, check_call, check_output, _):
assert check_call.call_args_list == check_call_expected_args

def test_set_additional_rpath(self, check_call, check_output, _):
existing_rpath = b"$ORIGIN/.existinglibdir"
patcher = Patchelf()
# The first call to check_call will be to print the existing rpath
# When that is non-empty the existing rpaths should be present in the
# subsequent call to patchelf
check_output.return_value = b"$ORIGIN/.existinglibdir"
# When a library has an existing RPATH entry
check_output.return_value = existing_rpath
patcher.set_rpath("test.so", "$ORIGIN/.lib")
check_output_expected_args = [call(['patchelf', '--print-rpath',
'test.so'])]
# Then that entry is preserved when updating the RPATH
check_call_expected_args = [call(['patchelf', '--remove-rpath',
'test.so']),
call(['patchelf', '--force-rpath',
'--set-rpath',
'$ORIGIN/.existinglibdir:$ORIGIN/.lib',
'${}:$ORIGIN/.lib'.format(existing_rpath),
'test.so'])]

assert check_output.call_args_list == check_output_expected_args
Expand Down

0 comments on commit c54c655

Please sign in to comment.