Skip to content

Commit

Permalink
fixed flake 8 issues with too many chars
Browse files Browse the repository at this point in the history
  • Loading branch information
ColeHiggins2 authored and sambible committed Nov 29, 2023
1 parent 0f657fb commit d723587
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions tests/foreman/cli/test_repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
:Upstream: No
"""
import pytest
import time
from requests.exceptions import HTTPError



@pytest.mark.rhel_ver_match('[^6]')
def test_positive_custom_products_disabled_by_default(
setup_content,
Expand Down Expand Up @@ -64,8 +62,8 @@ def test_negative_invalid_repo_fails_publish(
:steps:
1. Create custom product and upload repository
2. Run Katello commands to make repository invalid
3. Create content view and add repository
4. Verify Publish fails
3. Create content view and add repository
4. Verify Publish fails
:expectedresults: Publishing a content view with an invalid repository fails
Expand All @@ -74,19 +72,16 @@ def test_negative_invalid_repo_fails_publish(
:BZ: 2032040
"""
repo = module_repository
with target_sat.session.shell() as sh:
sh.send('foreman-rake console')
time.sleep(30) # sleep to allow time for console to open
sh.send(f'root = ::Katello::RootRepository.last')
time.sleep(3) # give enough time for the command to complete
sh.send(f'::Katello::Resources::Candlepin::Product.remove_content(root.product.organization.label, root.product.cp_id, root.content_id)')
time.sleep(3)
sh.send(f'::Katello::Resources::Candlepin::Content.destroy(root.product.organization.label, root.content_id)')
time.sleep(3)
target_sat.execute(
'echo "root = ::Katello::RootRepository.last; ::Katello::Resources::Candlepin::Product.'
'remove_content(root.product.organization.label, root.product.cp_id, root.content_id); '
'::Katello::Resources::Candlepin::Content.destroy(root.product.organization.label, '
'root.content_id)" | foreman-rake console'
)
cv = target_sat.api.ContentView(
organization=module_org.name,
repository=[repo.id],
).create()
with pytest.raises(HTTPError) as context:
cv.publish()
assert 'Remove the invalid repository before publishing again' in context.value.response.text
assert 'Remove the invalid repository before publishing again' in context.value.response.text

0 comments on commit d723587

Please sign in to comment.