Skip to content

Commit

Permalink
lce/cv
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Nov 5, 2024
1 parent 982dfc5 commit 973fde9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,16 @@ 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)

@pytest.fixture
def lifecycle_environment(organization, foremanapi):
library = foremanapi.list('lifecycle_environments', 'name=Library', {'organization_id': organization['id']})[0]
lce = foremanapi.create('lifecycle_environments', {'name': str(uuid.uuid4()), 'organization_id': organization['id'], 'prior_id': library['id']})
yield lce
foremanapi.delete('lifecycle_environments', lce)

@pytest.fixture
def content_view(organization, foremanapi):
cv = foremanapi.create('content_views', {'name': str(uuid.uuid4()), 'organization_id': organization['id']})
yield cv
foremanapi.delete('content_views', cv)
9 changes: 9 additions & 0 deletions tests/foreman_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ def test_foreman_file_repository(file_repository, foremanapi, ssh_config):
def test_foreman_container_repository(container_repository, foremanapi, ssh_config):
assert container_repository
foremanapi.resource_action('repositories', 'sync', {'id': container_repository['id']})


def test_foreman_lifecycle_environment(lifecycle_environment):
assert lifecycle_environment


def test_foreman_content_view(content_view, yum_repository, foremanapi):
assert content_view
foremanapi.update('content_views', {'id': content_view['id'], 'repository_ids': [yum_repository['id']]})

0 comments on commit 973fde9

Please sign in to comment.