Skip to content

Commit

Permalink
add container repo test
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Nov 5, 2024
1 parent 9d49f32 commit 982dfc5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ def file_repository(product, organization, foremanapi):
repo = foremanapi.create('repositories', {'name': str(uuid.uuid4()), 'product_id': product['id'], 'content_type': 'file', 'url': 'https://fixtures.pulpproject.org/file/'})
yield repo
foremanapi.delete('repositories', repo)

@pytest.fixture
def container_repository(product, organization, foremanapi):
repo = foremanapi.create('repositories', {'name': str(uuid.uuid4()), 'product_id': product['id'], 'content_type': 'docker', 'url': 'https://quay.io/', 'docker_upstream_name': 'foreman/busybox-test'})
yield repo
foremanapi.delete('repositories', repo)
5 changes: 5 additions & 0 deletions tests/foreman_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ def test_foreman_file_repository(file_repository, foremanapi, ssh_config):
foremanapi.resource_action('repositories', 'sync', {'id': file_repository['id']})
repo_url = _repo_url(file_repository, ssh_config)
assert requests.get(f'{repo_url}/1.iso', verify=False)


def test_foreman_container_repository(container_repository, foremanapi, ssh_config):
assert container_repository
foremanapi.resource_action('repositories', 'sync', {'id': container_repository['id']})

0 comments on commit 982dfc5

Please sign in to comment.