Merge "Fix TypeError when there exists image with size None"

This commit is contained in:
Zuul 2020-12-07 22:25:00 +00:00 committed by Gerrit Code Review
commit 2262cced38
1 changed files with 2 additions and 1 deletions

View File

@ -402,7 +402,8 @@ class ListUserImagesTest(base.BaseV2ImageTest):
# Validate that the list was fetched sorted accordingly
msg = 'No images were found that met the filter criteria.'
self.assertNotEmpty(images_list, msg)
sorted_list = [image['size'] for image in images_list]
sorted_list = [image['size'] for image in images_list
if image['size'] is not None]
msg = 'The list of images was not sorted correctly.'
self.assertEqual(sorted(sorted_list, reverse=desc), sorted_list, msg)