Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 def test_name_is_none(self, exists):
     vol = gce_ephemeral.GceEphemeralVolume()
     self.assertRaises(AssertionError, vol.ensure)
Exemplo n.º 3
0
 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