Skip to content

Commit

Permalink
Add some asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
LadislavVasina1 committed Feb 15, 2024
1 parent ee3f578 commit ff08d2c
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions tests/foreman/ui/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -2432,7 +2432,6 @@ def change_content_source_prep(
Fixture returns module_target_sat, org, lce, capsule, content_view, loc, ak
"""
product_name, lce_name = (gen_string('alpha') for _ in range(2))
repos_to_enable = ['rhae2.9_el8']

org = module_sca_manifest_org
loc = module_location
Expand All @@ -2448,17 +2447,6 @@ def change_content_source_prep(
url=CUSTOM_FILE_REPO,
).create()

for repo in repos_to_enable:
module_target_sat.cli.RepositorySet.enable(
{
'organization-id': org.id,
'name': constants.REPOS[repo]['reposet'],
'product': constants.REPOS[repo]['product'],
'releasever': constants.REPOS[repo]['version'],
'basearch': constants.DEFAULT_ARCHITECTURE,
}
)

lce = module_target_sat.cli_factory.make_lifecycle_environment(
{'name': lce_name, 'organization-id': org.id}
)
Expand Down Expand Up @@ -2564,3 +2552,18 @@ def test_change_content_source(session, change_content_source_prep, rhel_content
== 'Configure host for new content source'
)
assert selected_targeted_hosts['selected_hosts'] == [rhel_contenthost.hostname]

session.jobinvocation.submit_prefilled_view()
rhel_contenthost_post_values = rhel_contenthost.nailgun_host.content_facet_attributes
assert (
rhel_contenthost_post_values['content_source']['name']
== rhel_contenthost_pre_values['content_source']['name']
)
assert (
rhel_contenthost_post_values['content_view']['name']
== rhel_contenthost_post_values['content_view']['name']
)
assert (
rhel_contenthost_post_values['lifecycle_environment']['name']
== rhel_contenthost_post_values['lifecycle_environment']['name']
)

0 comments on commit ff08d2c

Please sign in to comment.