Skip to content

Commit

Permalink
addFinalizer in test body
Browse files Browse the repository at this point in the history
  • Loading branch information
pondrejk committed Feb 12, 2024
1 parent d9c5ea8 commit 4340533
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/foreman/cli/test_hammer.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ def test_positive_disable_hammer_defaults(request, function_product, target_sat)
:BZ: 1640644, 1368173
"""

@request.addfinalizer
def _finalize():
target_sat.cli.Defaults.delete({'param-name': 'organization_id'})
result = target_sat.execute('hammer defaults list')
assert str(function_product.organization.id) not in result.stdout

target_sat.cli.Defaults.add(
{'param-name': 'organization_id', 'param-value': function_product.organization.id}
)
Expand All @@ -154,12 +161,6 @@ def test_positive_disable_hammer_defaults(request, function_product, target_sat)
assert result.status == 0
assert function_product.name in result.stdout

@request.addfinalizer
def _finalize():
target_sat.cli.Defaults.delete({'param-name': 'organization_id'})
result = target_sat.execute('hammer defaults list')
assert str(function_product.organization.id) not in result.stdout


@pytest.mark.upgrade
def test_positive_check_debug_log_levels(target_sat):
Expand Down

0 comments on commit 4340533

Please sign in to comment.