Fix broken registry data interface tests
This commit is contained in:
parent
ed897626a2
commit
301532279c
1 changed files with 8 additions and 7 deletions
|
@ -12,9 +12,10 @@ def pre_oci_model(initialized_db):
|
|||
|
||||
@pytest.mark.parametrize('names, expected', [
|
||||
(['unknown'], None),
|
||||
(['latest'], 'latest'),
|
||||
(['latest', 'prod'], 'latest'),
|
||||
(['foo', 'prod'], 'prod'),
|
||||
(['latest'], {'latest'}),
|
||||
(['latest', 'prod'], {'latest', 'prod'}),
|
||||
(['latest', 'prod', 'another'], {'latest', 'prod'}),
|
||||
(['foo', 'prod'], {'prod'}),
|
||||
])
|
||||
def test_find_matching_tag(names, expected, pre_oci_model):
|
||||
repo = model.repository.get_repository('devtable', 'simple')
|
||||
|
@ -23,12 +24,12 @@ def test_find_matching_tag(names, expected, pre_oci_model):
|
|||
if expected is None:
|
||||
assert found is None
|
||||
else:
|
||||
assert found.name == expected
|
||||
assert found.name in expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize('repo_namespace, repo_name, expected', [
|
||||
('devtable', 'simple', 'latest'),
|
||||
('buynlarge', 'orgrepo', 'latest'),
|
||||
('devtable', 'simple', {'latest'}),
|
||||
('buynlarge', 'orgrepo', {'latest', 'prod'}),
|
||||
])
|
||||
def test_get_most_recent_tag(repo_namespace, repo_name, expected, pre_oci_model):
|
||||
repo = model.repository.get_repository(repo_namespace, repo_name)
|
||||
|
@ -37,4 +38,4 @@ def test_get_most_recent_tag(repo_namespace, repo_name, expected, pre_oci_model)
|
|||
if expected is None:
|
||||
assert found is None
|
||||
else:
|
||||
assert found.name == expected
|
||||
assert found.name in expected
|
||||
|
|
Reference in a new issue