Skip to content

Commit

Permalink
Add tests for pyhton content type
Browse files Browse the repository at this point in the history
  • Loading branch information
dosas committed Feb 26, 2025
1 parent 9fb897a commit d99a74a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
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=list,
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()

0 comments on commit d99a74a

Please sign in to comment.