Import module instead of object

Change-Id: I43f997bf33a10ea5a6ef032e54821b1a110bb3d5
This commit is contained in:
Anh Tran
2016-09-27 13:18:00 +07:00
parent a85ea63de7
commit 02e224fcfb

View File

@@ -18,8 +18,7 @@
from cinderclient import api_versions
from cinderclient.tests.unit import utils
from cinderclient.tests.unit.v3 import fakes
from cinderclient.v3.volumes import Volume
from cinderclient.v3.volumes import VolumeManager
from cinderclient.v3 import volumes
cs = fakes.FakeClient()
@@ -36,10 +35,10 @@ class VolumesTest(utils.TestCase):
'protected': True}}
api_version = api_versions.APIVersion('3.1')
cs = fakes.FakeClient(api_version)
manager = VolumeManager(cs)
fake_volume = Volume(manager, {'id': 1234,
'name': 'sample-volume'},
loaded=True)
manager = volumes.VolumeManager(cs)
fake_volume = volumes.Volume(manager,
{'id': 1234, 'name': 'sample-volume'},
loaded=True)
fake_volume.upload_to_image(False, 'name', 'bare', 'raw',
visibility='public', protected=True)
cs.assert_called_anytime('POST', '/volumes/1234/action', body=expected)