Skip to content

Commit d99a74a

Browse files
committed
Add tests for pyhton content type
1 parent 9fb897a commit d99a74a

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

conf/repos.yaml.template

+4
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,7 @@ REPOS:
198198
GR_YUM_REPO:
199199
URL:
200200
GPG_URL:
201+
202+
PYTHON:
203+
SYNC:
204+
URL: 'https://pypi.org/project/pytest'

robottelo/config/validators.py

+6
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@
316316
must_exist=True,
317317
is_type_of=str,
318318
),
319+
Validator(
320+
'repos.python.sync.url',
321+
must_exist=True,
322+
is_type_of=list,
323+
default='https://pypi.org/project/pytest',
324+
),
319325
],
320326
rhev=[
321327
Validator(

robottelo/constants/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@
215215
'docker': "docker",
216216
'ansible_collection': "ansible_collection",
217217
'file': "file",
218+
'python': 'python',
218219
}
219220

220221
DOWNLOAD_POLICIES = {

tests/foreman/api/test_repository.py

+28
Original file line numberDiff line numberDiff line change
@@ -2512,3 +2512,31 @@ def clean_repos():
25122512
synced_repo = repo.read()
25132513
assert synced_repo.content_counts['docker_manifest'] >= 1
25142514
assert synced_repo.content_counts['docker_tag'] == 1
2515+
2516+
2517+
class TestPythonRepository:
2518+
"""Specific tests for Python Repositories"""
2519+
2520+
@pytest.mark.tier1
2521+
@pytest.mark.parametrize(
2522+
'repo_options',
2523+
**parametrized(
2524+
[{'content_type': constants.REPO_TYPE['python'], 'url': settings.repos.python.sync.url}]
2525+
),
2526+
indirect=True,
2527+
)
2528+
def test_positive_sync(self, repo, target_sat):
2529+
"""Check python repository can be synced.
2530+
2531+
:id: e521a7a4-2502-4fe2-b297-a13fc99e679f
2532+
2533+
:steps:
2534+
1. Sync python repo
2535+
2536+
:expectedresults: Pyhton repo is synced
2537+
2538+
:CaseImportance: Critical
2539+
2540+
:CaseAutomation: Automated
2541+
"""
2542+
repo.sync()

0 commit comments

Comments
 (0)