Merge master into bitbucket
This commit is contained in:
commit
b96e35b28c
44 changed files with 695 additions and 110 deletions
|
@ -308,6 +308,16 @@ class TestConvertToOrganization(ApiTestCase):
|
|||
|
||||
self.assertEqual('The admin user is not valid', json['message'])
|
||||
|
||||
def test_sameadminuser_by_email(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
json = self.postJsonResponse(ConvertToOrganization,
|
||||
data={'adminUser': 'no1@thanks.com',
|
||||
'adminPassword': 'password',
|
||||
'plan': 'free'},
|
||||
expected_code=400)
|
||||
|
||||
self.assertEqual('The admin user is not valid', json['message'])
|
||||
|
||||
def test_invalidadminuser(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
json = self.postJsonResponse(ConvertToOrganization,
|
||||
|
|
|
@ -91,6 +91,28 @@ class TestImageTree(unittest.TestCase):
|
|||
self.assertEquals('staging', tree.tag_containing_image(result[0]))
|
||||
|
||||
|
||||
def test_longest_path_simple_repo_direct_lookup(self):
|
||||
repository = model.get_repository(NAMESPACE, SIMPLE_REPO)
|
||||
all_images = list(model.get_repository_images(NAMESPACE, SIMPLE_REPO))
|
||||
all_tags = list(model.list_repository_tags(NAMESPACE, SIMPLE_REPO))
|
||||
|
||||
base_image = self._get_base_image(all_images)
|
||||
tag_image = all_tags[0].image
|
||||
|
||||
def checker(index, image):
|
||||
return True
|
||||
|
||||
filtered_images = model.get_repository_images_without_placements(repository,
|
||||
with_ancestor=base_image)
|
||||
self.assertEquals(set([f.id for f in filtered_images]), set([a.id for a in all_images]))
|
||||
|
||||
tree = ImageTree(filtered_images, all_tags)
|
||||
|
||||
ancestors = tag_image.ancestors.split('/')[2:-1] # Skip the first image.
|
||||
result = tree.find_longest_path(base_image.id, checker)
|
||||
self.assertEquals(3, len(result))
|
||||
self.assertEquals('latest', tree.tag_containing_image(result[-1]))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
|
Reference in a new issue