Add manifest creation to new registry data model interface

This commit is contained in:
Joseph Schorr 2018-09-20 17:49:00 -04:00
parent 818ed32f87
commit 0ae062be62
9 changed files with 195 additions and 5 deletions

View file

@ -167,6 +167,23 @@ def test_manifest_labels(pre_oci_model):
assert created not in pre_oci_model.list_manifest_labels(found_manifest)
def test_manifest_label_handlers(pre_oci_model):
repo = model.repository.get_repository('devtable', 'simple')
repository_ref = RepositoryReference.for_repo_obj(repo)
found_tag = pre_oci_model.get_repo_tag(repository_ref, 'latest')
found_manifest = pre_oci_model.get_manifest_for_tag(found_tag)
# Ensure the tag has no expiration.
assert found_tag.lifetime_end_ts is None
# Create a new label with an expires-after.
pre_oci_model.create_manifest_label(found_manifest, 'quay.expires-after', '2h', 'api')
# Ensure the tag now has an expiration.
updated_tag = pre_oci_model.get_repo_tag(repository_ref, 'latest')
assert updated_tag.lifetime_end_ts == (updated_tag.lifetime_start_ts + (60 * 60 * 2))
def test_batch_labels(pre_oci_model):
repo = model.repository.get_repository('devtable', 'history')
repository_ref = RepositoryReference.for_repo_obj(repo)
@ -554,7 +571,6 @@ def test_torrent_info(pre_oci_model):
assert torrent_info.pieces == 'foo'
<<<<<<< HEAD
def test_blob_uploads(pre_oci_model):
repository_ref = pre_oci_model.lookup_repository('devtable', 'simple')