diff options
author | Pranali Deore <pdeore@redhat.com> | 2022-08-26 04:18:31 +0000 |
---|---|---|
committer | Pranali Deore <pdeore@redhat.com> | 2022-08-30 11:20:40 +0000 |
commit | 92cd70a2240dd5106ebfffecd6007942e898903a (patch) | |
tree | d0e492d705ae60b8ca97f626afda8d6f184e349b /glanceclient/tests/unit/v2/test_images.py | |
parent | 75218d289ed27b4eddd645436275b1e51aed0fab (diff) | |
download | python-glanceclient-92cd70a2240dd5106ebfffecd6007942e898903a.tar.gz |
Add support for glance-download import method
Implements: blueprint glance-download-import-support
Change-Id: Ia2bfad82bccf9acb6103b21112e680c44e295d39
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( |