diff options
author | Zuul <zuul@review.opendev.org> | 2022-08-30 14:57:55 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-08-30 14:57:55 +0000 |
commit | f2999ce752e111d93a74c73cae5cccfceb4467c2 (patch) | |
tree | 28e183bf4b754028144f467468b8f1d99db39324 /glanceclient/tests/unit/v2/test_images.py | |
parent | 219568c2a4b21c26ca4c160a7cf4d71cae524255 (diff) | |
parent | 92cd70a2240dd5106ebfffecd6007942e898903a (diff) | |
download | python-glanceclient-4.1.0.tar.gz |
Merge "Add support for glance-download import method"4.1.0
Diffstat (limited to 'glanceclient/tests/unit/v2/test_images.py')
-rw-r--r-- | glanceclient/tests/unit/v2/test_images.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/glanceclient/tests/unit/v2/test_images.py b/glanceclient/tests/unit/v2/test_images.py index 199d6ec..60ddb3a 100644 --- a/glanceclient/tests/unit/v2/test_images.py +++ b/glanceclient/tests/unit/v2/test_images.py @@ -1201,7 +1201,7 @@ class TestController(testtools.TestCase): body = ''.join([b for b in body]) self.assertEqual('GOODCHECKSUM', body) - def test_image_import(self): + def test_image_import_web_download(self): uri = 'http://example.com/image.qcow' data = [('method', {'name': 'web-download', 'uri': uri})] @@ -1211,6 +1211,24 @@ class TestController(testtools.TestCase): data)] self.assertEqual(expect, self.api.calls) + def test_image_import_glance_download(self): + region = 'REGION2' + remote_image_id = '75baf7b6-253a-11ed-8307-4b1057986a78' + image_id = '606b0e88-7c5a-4d54-b5bb-046105d4de6f' + service_interface = 'public' + data = [('method', + {'name': 'glance-download', + 'glance_region': region, + 'glance_image_id': remote_image_id, + 'glance_service_interface': service_interface})] + self.controller.image_import( + image_id, 'glance-download', remote_region=region, + remote_image_id=remote_image_id, + remote_service_interface=service_interface) + expect = [('POST', '/v2/images/%s/import' % image_id, {}, + data)] + self.assertEqual(expect, self.api.calls) + def test_download_no_data(self): resp = utils.FakeResponse(headers={}, status_code=204) self.controller.controller.http_client.get = mock.Mock( |