def test_image_tag_get_all(self): db_api.image_tag_create(self.context, UUID1, 'snap') db_api.image_tag_create(self.context, UUID1, 'snarf') db_api.image_tag_create(self.context, UUID2, 'snarf') # Check the tags for the first image tag_refs = db_api.image_tag_get_all(self.context, UUID1) tags = [(t.image_id, t.value) for t in tag_refs] expected = [(UUID1, 'snap'), (UUID1, 'snarf')] self.assertEqual(expected, tags) # Check the tags for the second image tag_refs = db_api.image_tag_get_all(self.context, UUID2) tags = [(t.image_id, t.value) for t in tag_refs] expected = [(UUID2, 'snarf')] self.assertEqual(expected, tags)
def test_image_tag_get_all_no_tags(self): self.assertEqual([], db_api.image_tag_get_all(self.context, UUID1))