Fix name of reversion field in new Tag table and add a test
This commit is contained in:
parent
114e2c3bf2
commit
e8ed43b46f
4 changed files with 19 additions and 3 deletions
|
@ -146,6 +146,7 @@ def assert_tags(repository, *args):
|
|||
oci_tag = _get_oci_tag(tag)
|
||||
assert oci_tag.name == tag.name
|
||||
assert not oci_tag.hidden
|
||||
assert oci_tag.reversion == tag.reversion
|
||||
|
||||
if tag.lifetime_end_ts:
|
||||
assert oci_tag.lifetime_end_ms == (tag.lifetime_end_ts * 1000)
|
||||
|
@ -156,6 +157,21 @@ def assert_tags(repository, *args):
|
|||
assert expected in tags_dict
|
||||
|
||||
|
||||
def test_create_reversion_tag(initialized_db):
|
||||
repository = create_repository('devtable', 'somenewrepo', None)
|
||||
manifest = Manifest.get()
|
||||
image1 = find_create_or_link_image('foobarimage1', repository, None, {}, 'local_us')
|
||||
|
||||
footag = create_or_update_tag_for_repo(repository, 'foo', image1.docker_image_id,
|
||||
oci_manifest=manifest, reversion=True)
|
||||
assert footag.reversion
|
||||
|
||||
oci_tag = _get_oci_tag(footag)
|
||||
assert oci_tag.name == footag.name
|
||||
assert not oci_tag.hidden
|
||||
assert oci_tag.reversion == footag.reversion
|
||||
|
||||
|
||||
def test_list_active_tags(initialized_db):
|
||||
# Create a new repository.
|
||||
repository = create_repository('devtable', 'somenewrepo', None)
|
||||
|
|
Reference in a new issue