diff --git a/conf/repos.yaml.template b/conf/repos.yaml.template index 4ec119343c..7d01866478 100644 --- a/conf/repos.yaml.template +++ b/conf/repos.yaml.template @@ -198,3 +198,7 @@ REPOS: GR_YUM_REPO: URL: GPG_URL: + + PYTHON: + SYNC: + URL: 'https://pypi.org/project/pytest' diff --git a/robottelo/config/validators.py b/robottelo/config/validators.py index 9c07b9b8dd..267ce0ee4d 100644 --- a/robottelo/config/validators.py +++ b/robottelo/config/validators.py @@ -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( diff --git a/robottelo/constants/__init__.py b/robottelo/constants/__init__.py index 2538371c32..9251265f50 100644 --- a/robottelo/constants/__init__.py +++ b/robottelo/constants/__init__.py @@ -215,6 +215,7 @@ 'docker': "docker", 'ansible_collection': "ansible_collection", 'file': "file", + 'python': 'python', } DOWNLOAD_POLICIES = { diff --git a/tests/foreman/api/test_repository.py b/tests/foreman/api/test_repository.py index 0171e9d305..59b7e80fd9 100644 --- a/tests/foreman/api/test_repository.py +++ b/tests/foreman/api/test_repository.py @@ -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()