Fix host owner checking and test name typo #15143
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not needed. Fixed by SatelliteQE/nailgun#1153
Problem Statement
There are a couple API test failures related to host owner checking, like the following from PRT job 7043:
These tests that compare
host.owner
to auser
instance, but the comparison fails because they are instances of different classes:host.owner
is anailgun.entity.User
instancemodule_user
and other entities returned frommodule_target_sat.api.ENTITY_NAME
are wrapped in arobottelo.hosts.DecClass
instance.This CLI test also has a typo in the name:
tests/foreman/cli/test_user.py::TestUser::test_positive_create_with_defaut_org
Solution
Update tests to compare
host.owner
tomodule_user
and similar objects:tests/foreman/api/test_host.py::test_positive_update_owner_type[User]
tests/foreman/api/test_host.py::test_positive_update_owner_type[Usergroup]
tests/foreman/api/test_host.py::test_positive_create_and_update_with_user
Update test name (
defaut
->default
):tests/foreman/cli/test_user.py::TestUser::test_positive_create_with_default_org
Related Issues