Skip to content

Commit

Permalink
Fix assertions in file repo tests (#15138)
Browse files Browse the repository at this point in the history
(cherry picked from commit fe65df5)
  • Loading branch information
vsedmik authored and web-flow committed May 22, 2024
1 parent 28f6ac5 commit 89bec5c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/foreman/cli/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,7 @@ def test_positive_upload_remove_srpm_content(self, repo, target_sat):
'content-type': 'srpm',
}
)
assert f"Successfully uploaded file '{SRPM_TO_UPLOAD}'" in result[0]['message']
assert f'Successfully uploaded file {SRPM_TO_UPLOAD}' in result[0]['message']
assert (
int(target_sat.cli.Repository.info({'id': repo['id']})['content-counts']['source-rpms'])
== 1
Expand Down Expand Up @@ -2621,7 +2621,7 @@ def test_positive_upload_file_to_file_repo(self, repo_options, repo, target_sat)
'product-id': repo['product']['id'],
}
)
assert f"Successfully uploaded file '{RPM_TO_UPLOAD}'" in result[0]['message']
assert f'Successfully uploaded file {RPM_TO_UPLOAD}' in result[0]['message']
repo = target_sat.cli.Repository.info({'id': repo['id']})
assert repo['content-counts']['files'] == '1'
filesearch = entities.File().search(
Expand Down Expand Up @@ -2666,7 +2666,7 @@ def test_positive_remove_file(self, repo, target_sat):
'product-id': repo['product']['id'],
}
)
assert f"Successfully uploaded file '{RPM_TO_UPLOAD}'" in result[0]['message']
assert f'Successfully uploaded file {RPM_TO_UPLOAD}' in result[0]['message']
repo = target_sat.cli.Repository.info({'id': repo['id']})
assert int(repo['content-counts']['files']) > 0
files = target_sat.cli.File.list({'repository-id': repo['id']})
Expand Down Expand Up @@ -2831,7 +2831,7 @@ def test_file_repo_contains_only_newer_file(self, repo_options, repo, target_sat
'product-id': repo['product']['id'],
}
)
assert f"Successfully uploaded file '{text_file_name}'" in result[0]['message']
assert f"Successfully uploaded file {text_file_name}" in result[0]['message']
repo = target_sat.cli.Repository.info({'id': repo['id']})
# Assert there is only one file
assert repo['content-counts']['files'] == '1'
Expand All @@ -2849,7 +2849,7 @@ def test_file_repo_contains_only_newer_file(self, repo_options, repo, target_sat
'product-id': repo['product']['id'],
}
)
assert f"Successfully uploaded file '{text_file_name}'" in result[0]['message']
assert f"Successfully uploaded file {text_file_name}" in result[0]['message']
repo = target_sat.cli.Repository.info({'id': repo['id']})
# Assert there is still only one file
assert repo['content-counts']['files'] == '1'
Expand Down

0 comments on commit 89bec5c

Please sign in to comment.