Skip to content

Commit

Permalink
improved webhook event trigger test
Browse files Browse the repository at this point in the history
  • Loading branch information
pondrejk committed Nov 9, 2023
1 parent 034dcac commit 7d3c631
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/foreman/api/test_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ def test_positive_end_to_end(self, target_sat):
(not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url'
)
@pytest.mark.tier2
def test_positive_event_triggered(self, module_org, module_target_sat):
@pytest.mark.e2e
@pytest.mark.parametrize('setting_update', ['safemode_render=False'], indirect=True)
def test_positive_event_triggered(self, module_org, target_sat, setting_update):
"""Create a webhook and trigger the event
associated with it.
Expand All @@ -159,13 +161,14 @@ def test_positive_event_triggered(self, module_org, module_target_sat):
:CaseImportance: Critical
"""
hook = module_target_sat.api.Webhooks(
hook = target_sat.api.Webhooks(
event='actions.katello.repository.sync_succeeded', http_method='GET'
).create()
repo = module_target_sat.api.Repository(
repo = target_sat.api.Repository(
organization=module_org, content_type='yum', url=settings.repos.yum_0.url
).create()
with module_target_sat.api.session.shell() as shell:
with target_sat.api.session.shell() as shell:
shell.send('foreman-tail')
repo.sync()
assert_event_triggered(shell, hook.event)
target_sat.wait_for_tasks(f'Deliver webhook {hook.name}')

0 comments on commit 7d3c631

Please sign in to comment.