Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content updates #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tests/test_content_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,17 @@ def test_available_errata(katello_client, entities, api, os_release_major):
katello_client.run('yum -y install walrus-0.71')

host = foreman_host(katello_client, api)
errata = api.resource('errata').call('index', {'host_id': host['id']})
errata_ids = [erratum['errata_id'] for erratum in errata['results']]

retries = 0
while retries < 5:
retries += 1
Comment on lines +108 to +110
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this equal to:

Suggested change
retries = 0
while retries < 5:
retries += 1
for attempt in range(5):

errata = api.resource('errata').call('index', {'host_id': host['id']})
errata_ids = [erratum['errata_id'] for erratum in errata['results']]

if not errata_ids:
time.sleep(3)
else:
break

assert entities['errata_id'] in errata_ids

Expand Down