Skip to content

Commit

Permalink
Avoid calling decode on str (#16214)
Browse files Browse the repository at this point in the history
* Avoid calling decode on str

In tests we see this failure:

    AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?

This implies that the strerr value is a str, which you can't decode. I
can't find the specific change, but this implies the result used to be a
byte string and is now decoded elsewhere.

* Update tests/foreman/destructive/test_rename.py

Co-authored-by: Peter Ondrejka <[email protected]>

* Update tests/foreman/destructive/test_rename.py

Co-authored-by: Evgeni Golov <[email protected]>

---------

Co-authored-by: Peter Ondrejka <[email protected]>
Co-authored-by: Jameer Pathan <[email protected]>
Co-authored-by: Evgeni Golov <[email protected]>
(cherry picked from commit 5c05d4f)
  • Loading branch information
ekohl authored and web-flow committed Sep 10, 2024
1 parent 07ad8c2 commit 1c9f914
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/foreman/destructive/test_rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ def test_negative_rename_sat_wrong_passwd(module_target_sat):
f'satellite-change-hostname -y {new_hostname} -u {username} -p {password}'
)
assert result.status == 1
assert BAD_CREDS_MSG in result.stderr[1].decode()
assert BAD_CREDS_MSG in result.stderr
# assert no changes were made
hostname_result = module_target_sat.execute('hostname')
assert original_name == hostname_result.stdout.strip(), "Invalid hostame assigned"


@pytest.mark.stubbed
Expand Down

0 comments on commit 1c9f914

Please sign in to comment.