def test_device_exists(self, exists): exists.return_value = True vol = gce_ephemeral.GceEphemeralVolume(name=device_name) vol.ensure() assert vol.device == '/dev/disk/by-id/%s' % device_name
def test_name_is_none(self, exists): vol = gce_ephemeral.GceEphemeralVolume() self.assertRaises(AssertionError, vol.ensure)
def test_device_exists(self, exists): exists.return_value = False vol = gce_ephemeral.GceEphemeralVolume(name=device_name) self.assertRaises(storage2.StorageError, vol.ensure) assert vol.device is None