Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik authored and pondrejk committed Nov 16, 2023
1 parent d1ad648 commit 3e1f600
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/foreman/api/test_reporttemplates.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,9 +861,10 @@ def test_positive_installed_products(
2. A RHEL content host.
:steps:
1. Register the content host using the AK.
2. Generate 'Host - Installed Products' report.
3. Verify the report generated from the template.
1. Set syspurpose tags of the content host via subman.
2. Register the content host using the AK.
3. Generate 'Host - Installed Products' report.
4. Verify the report generated from the template.
:expectedresults:
1. Report is generated with correct values.
Expand Down Expand Up @@ -917,7 +918,7 @@ def test_positive_installed_products(
assert report[0]['Role'] == sys_tags['role'], 'Incorrect role was reported.'
assert report[0]['Usage'] == sys_tags['usage'], 'Incorrect usage was reported.'

# Get the installed products via rake and compare them with report
# Get the installed products via rake and compare them with generated report
rake = target_sat.execute(
f'echo "Host.find_by(name: \'{rhel_contenthost.hostname}\').'
'subscription_facet.installed_products" | foreman-rake console'
Expand All @@ -926,7 +927,7 @@ def test_positive_installed_products(

pattern = re.compile(r'name: "(.*?)".*?cp_product_id: "(.*?)"')
matches = pattern.findall(rake.stdout)
products = [f"{match[0]} ({match[1]})" for match in matches]
products = [f'{match[0]} ({match[1]})' for match in matches]
assert len(products), 'No installed products to compare.'

assert set(products) == set(report[0]['Products']), 'Reported products do not match.'

0 comments on commit 3e1f600

Please sign in to comment.