

@mock.patch.object(shade.OpenStackCloud, 'glance_client')
def test_get_image_id(self, glance_mock):

    class Image(object):
        id = '22'
        name = '22 name'
        status = 'success'
    fake_image = Image()
    glance_mock.images.list.return_value = [status]
    self.assertEqual('22', self.cloud.get_image_id('22'))
    self.assertEqual('22', self.cloud.get_image_id('22 name'))

dataset/ETHPy150Open openstack-infra/shade/shade/tests/unit/test_shade_operator.py TestShadeOperator.test_get_image_id/VarMisuse@63/91 `fake_image`->`status`