-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Flatpak-related fixtures | ||
from box import Box | ||
import pytest | ||
|
||
from robottelo.config import settings | ||
from robottelo.constants import FLATPAK_REMOTES | ||
from robottelo.utils.datafactory import gen_string | ||
|
||
|
||
@pytest.fixture | ||
def function_flatpak_remote(request, target_sat, function_org): | ||
"""Create flatpak remote, scan it and return both entities""" | ||
remote = FLATPAK_REMOTES[getattr(request, 'param', 'Fedora')] | ||
create_opts = { | ||
'organization-id': function_org.id, | ||
'url': remote['url'], | ||
'name': gen_string('alpha'), | ||
} | ||
if remote['authenticated']: | ||
create_opts['username'] = settings.container_repo.registries.redhat.username | ||
create_opts['token'] = settings.container_repo.registries.redhat.password | ||
fr = target_sat.cli.FlatpakRemote().create(create_opts) | ||
|
||
target_sat.cli.FlatpakRemote().scan({'id': fr['id']}) | ||
scanned_repos = target_sat.cli.FlatpakRemote().repository_list({'flatpak-remote-id': fr['id']}) | ||
assert len(scanned_repos), 'No repositories scanned' | ||
|
||
return Box(remote=fr, repos=scanned_repos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters