Fix deletion of labels and add tests

This commit is contained in:
Joseph Schorr 2016-08-26 16:07:49 -04:00
parent b3c592c09a
commit 1a2666be07
4 changed files with 151 additions and 105 deletions

View file

@ -1768,6 +1768,8 @@ class TestDeleteRepository(ApiTestCase):
date=datetime.datetime.now() - datetime.timedelta(days=5), count=6)
# Create some labels.
pre_delete_label_count = database.Label.select().count()
tag_manifest = model.tag.load_tag_manifest(ADMIN_ACCESS_USER, 'complex', 'prod')
model.label.create_manifest_label(tag_manifest, 'foo', 'bar', 'manifest')
model.label.create_manifest_label(tag_manifest, 'foo', 'baz', 'manifest')
@ -1785,6 +1787,10 @@ class TestDeleteRepository(ApiTestCase):
params=dict(repository=self.COMPLEX_REPO),
expected_code=404)
# Verify the labels are gone.
post_delete_label_count = database.Label.select().count()
self.assertEquals(post_delete_label_count, pre_delete_label_count)
class TestGetRepository(ApiTestCase):
PUBLIC_REPO = PUBLIC_USER + '/publicrepo'