Remove a few glance client mocks we missed
Change-Id: Id4b5bc89e8829b3aebe67053b16c49abc60248c6
This commit is contained in:
parent
790d8d8a82
commit
dd25a3c416
@ -599,9 +599,8 @@ class TestMemoryCache(base.TestCase):
|
|||||||
|
|
||||||
@mock.patch.object(occ.cloud_config.CloudConfig, 'get_api_version')
|
@mock.patch.object(occ.cloud_config.CloudConfig, 'get_api_version')
|
||||||
@mock.patch.object(shade.OpenStackCloud, '_image_client')
|
@mock.patch.object(shade.OpenStackCloud, '_image_client')
|
||||||
@mock.patch.object(shade.OpenStackCloud, 'glance_client')
|
|
||||||
def test_create_image_put_meta_int(
|
def test_create_image_put_meta_int(
|
||||||
self, glance_mock, mock_image_client, mock_api_version):
|
self, mock_image_client, mock_api_version):
|
||||||
mock_api_version.return_value = '2'
|
mock_api_version.return_value = '2'
|
||||||
self.cloud.image_api_use_tasks = False
|
self.cloud.image_api_use_tasks = False
|
||||||
|
|
||||||
@ -663,9 +662,8 @@ class TestMemoryCache(base.TestCase):
|
|||||||
|
|
||||||
@mock.patch.object(occ.cloud_config.CloudConfig, 'get_api_version')
|
@mock.patch.object(occ.cloud_config.CloudConfig, 'get_api_version')
|
||||||
@mock.patch.object(shade.OpenStackCloud, '_image_client')
|
@mock.patch.object(shade.OpenStackCloud, '_image_client')
|
||||||
@mock.patch.object(shade.OpenStackCloud, 'glance_client')
|
|
||||||
def test_create_image_put_user_prop(
|
def test_create_image_put_user_prop(
|
||||||
self, glance_mock, mock_image_client, mock_api_version):
|
self, mock_image_client, mock_api_version):
|
||||||
mock_api_version.return_value = '2'
|
mock_api_version.return_value = '2'
|
||||||
self.cloud.image_api_use_tasks = False
|
self.cloud.image_api_use_tasks = False
|
||||||
|
|
||||||
|
@ -1021,24 +1021,24 @@ class TestShadeOperator(base.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@mock.patch.object(shade.OpenStackCloud, '_image_client')
|
@mock.patch.object(shade.OpenStackCloud, '_image_client')
|
||||||
def test_get_image_name(self, glance_mock):
|
def test_get_image_name(self, mock_client):
|
||||||
|
|
||||||
fake_image = munch.Munch(
|
fake_image = munch.Munch(
|
||||||
id='22',
|
id='22',
|
||||||
name='22 name',
|
name='22 name',
|
||||||
status='success')
|
status='success')
|
||||||
glance_mock.get.return_value = [fake_image]
|
mock_client.get.return_value = [fake_image]
|
||||||
self.assertEqual('22 name', self.op_cloud.get_image_name('22'))
|
self.assertEqual('22 name', self.op_cloud.get_image_name('22'))
|
||||||
self.assertEqual('22 name', self.op_cloud.get_image_name('22 name'))
|
self.assertEqual('22 name', self.op_cloud.get_image_name('22 name'))
|
||||||
|
|
||||||
@mock.patch.object(shade.OpenStackCloud, '_image_client')
|
@mock.patch.object(shade.OpenStackCloud, '_image_client')
|
||||||
def test_get_image_id(self, glance_mock):
|
def test_get_image_id(self, mock_client):
|
||||||
|
|
||||||
fake_image = munch.Munch(
|
fake_image = munch.Munch(
|
||||||
id='22',
|
id='22',
|
||||||
name='22 name',
|
name='22 name',
|
||||||
status='success')
|
status='success')
|
||||||
glance_mock.get.return_value = [fake_image]
|
mock_client.get.return_value = [fake_image]
|
||||||
self.assertEqual('22', self.op_cloud.get_image_id('22'))
|
self.assertEqual('22', self.op_cloud.get_image_id('22'))
|
||||||
self.assertEqual('22', self.op_cloud.get_image_id('22 name'))
|
self.assertEqual('22', self.op_cloud.get_image_id('22 name'))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user