Skip to content

Commit

Permalink
[6.14.z] Fix TestRepository test cases (#12090)
Browse files Browse the repository at this point in the history
  • Loading branch information
Satellite-QE authored Aug 2, 2023
1 parent 5edb2bb commit a0aee97
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/foreman/cli/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,16 +1560,19 @@ def test_positive_upload_content(self, repo, target_sat):
local_path=DataFile.RPM_TO_UPLOAD,
remote_path=f"/tmp/{RPM_TO_UPLOAD}",
)
result = Repository.upload_content(
result = target_sat.cli.Repository.upload_content(
{
'name': repo['name'],
'organization': repo['organization'],
'path': f"/tmp/{RPM_TO_UPLOAD}",
'product-id': repo['product']['id'],
}
)
assert f"Successfully uploaded file '{RPM_TO_UPLOAD}'" in result[0]['message']
assert int(Repository.info({'id': repo['id']})['content-counts']['packages']) == 1
assert f"Successfully uploaded file {RPM_TO_UPLOAD}" == result[0]['message']
assert (
int(target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['packages'])
== 1
)

@pytest.mark.tier1
@pytest.mark.parametrize(
Expand All @@ -1592,24 +1595,24 @@ def test_positive_upload_content_to_file_repo(self, repo, target_sat):
:CaseImportance: Critical
"""
Repository.synchronize({'id': repo['id']})
target_sat.cli.Repository.synchronize({'id': repo['id']})
# Verify it has finished
new_repo = Repository.info({'id': repo['id']})
new_repo = target_sat.cli.Repository.info({'id': repo['id']})
assert int(new_repo['content-counts']['files']) == CUSTOM_FILE_REPO_FILES_COUNT
target_sat.put(
local_path=DataFile.OS_TEMPLATE_DATA_FILE,
remote_path=f"/tmp/{OS_TEMPLATE_DATA_FILE}",
)
result = Repository.upload_content(
result = target_sat.cli.Repository.upload_content(
{
'name': new_repo['name'],
'organization': new_repo['organization'],
'path': f"/tmp/{OS_TEMPLATE_DATA_FILE}",
'product-id': new_repo['product']['id'],
}
)
assert f"Successfully uploaded file '{OS_TEMPLATE_DATA_FILE}'" in result[0]['message']
new_repo = Repository.info({'id': new_repo['id']})
assert f"Successfully uploaded file {OS_TEMPLATE_DATA_FILE}" == result[0]['message']
new_repo = target_sat.cli.Repository.info({'id': new_repo['id']})
assert int(new_repo['content-counts']['files']) == CUSTOM_FILE_REPO_FILES_COUNT + 1

@pytest.mark.skip_if_open("BZ:1410916")
Expand Down

0 comments on commit a0aee97

Please sign in to comment.