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

Add tests for pyhton content type #17704

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions conf/repos.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,7 @@ REPOS:
GR_YUM_REPO:
URL:
GPG_URL:

PYTHON:
SYNC:
URL: 'https://pypi.org/project/pytest'
6 changes: 6 additions & 0 deletions robottelo/config/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@
must_exist=True,
is_type_of=str,
),
Validator(
'repos.python.sync.url',
must_exist=True,
is_type_of=str,
default='https://pypi.org/project/pytest',
),
],
rhev=[
Validator(
Expand Down
1 change: 1 addition & 0 deletions robottelo/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
'docker': "docker",
'ansible_collection': "ansible_collection",
'file': "file",
'python': 'python',
}

DOWNLOAD_POLICIES = {
Expand Down
28 changes: 28 additions & 0 deletions tests/foreman/api/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -2512,3 +2512,31 @@ def clean_repos():
synced_repo = repo.read()
assert synced_repo.content_counts['docker_manifest'] >= 1
assert synced_repo.content_counts['docker_tag'] == 1


class TestPythonRepository:
"""Specific tests for Python Repositories"""

@pytest.mark.tier1
@pytest.mark.parametrize(
'repo_options',
**parametrized(
[{'content_type': constants.REPO_TYPE['python'], 'url': settings.repos.python.sync.url}]
),
indirect=True,
)
def test_positive_sync(self, repo, target_sat):
"""Check python repository can be synced.

:id: e521a7a4-2502-4fe2-b297-a13fc99e679f

:steps:
1. Sync python repo

:expectedresults: Pyhton repo is synced

:CaseImportance: Critical

:CaseAutomation: Automated
"""
repo.sync()