Add additional logs and an additional test for verbs

This commit is contained in:
Joseph Schorr 2017-12-07 15:22:20 -05:00
parent b2db266747
commit a706d99849
2 changed files with 26 additions and 2 deletions

View file

@ -2180,11 +2180,27 @@ class ACIConversionTests(RegistryTestCaseMixin, V1RegistryPushMixin, LiveServerT
class SquashingTests(RegistryTestCaseMixin, V1RegistryPushMixin, LiveServerTestCase):
""" Tests for registry squashing. """
def get_squashed_image(self):
response = self.conduct('GET', '/c1/squash/devtable/newrepo/latest', auth='sig')
def get_squashed_image(self, auth='sig'):
response = self.conduct('GET', '/c1/squash/devtable/newrepo/latest', auth=auth)
tar = tarfile.open(fileobj=StringIO(response.content))
return tar, response.content
def test_squashed_with_credentials(self):
initial_images = [
{
'id': 'initialid',
'contents': 'the initial image',
},
]
# Create the repo.
self.do_push('devtable', 'newrepo', 'devtable', 'password', images=initial_images)
initial_image_id = '91081df45b58dc62dd207441785eef2b895f0383fbe601c99a3cf643c79957dc'
# Pull the squashed version of the tag.
tar, _ = self.get_squashed_image(auth=('devtable', 'password'))
self.assertTrue(initial_image_id in tar.getnames())
def test_squashed_changes(self):
initial_images = [
{