コード例 #1
0
    def test_create_volume(self):
        mgr = fakes.FakeManager()
        mgr.api.region_name = "FAKE"
        sav = pyrax.connect_to_cloudservers
        fakenovavol = utils.random_unicode()

        class FakeVol(object):
            def __init__(self, *args, **kwargs):
                self.volumes = fakenovavol

        pyrax.connect_to_cloudservers = Mock(return_value=FakeVol())
        vol = CloudBlockStorageVolume(mgr, {})
        self.assertTrue(isinstance(vol, CloudBlockStorageVolume))
        self.assertEqual(vol._nova_volumes, fakenovavol)
        pyrax.connect_to_cloudservers = sav
コード例 #2
0
 def test_create_volume(self):
     vol = CloudBlockStorageVolume(fakes.FakeManager(), {})
     self.assertTrue(isinstance(vol, CloudBlockStorageVolume))