Ejemplo n.º 1
0
 def test_delete_snapshot(self, mock_snapshot, mock_wait):
     mock_snapshot.side_effect = gce_mock.delete_anything
     mock_wait.side_effect = gce_mock.wait_for_operation
     self.assertIsNone(self._driver.delete_snapshot(self.fake_snapshot))
     mock_wait.assert_called_once_with(self._driver.gce_svc,
                                       self._driver.gce_project,
                                       gce_mock.fake_operation())
Ejemplo n.º 2
0
 def _create_snapshot(self, mock_snapshot, mock_wait):
     mock_snapshot.side_effect = gce_mock.create_anything
     mock_wait.side_effect = gce_mock.wait_for_operation
     self._driver.create_snapshot(self.fake_snapshot)
     mock_wait.assert_called_once_with(self._driver.gce_svc,
                                       self._driver.gce_project,
                                       gce_mock.fake_operation())
Ejemplo n.º 3
0
 def test_volume_deletion_success(self, mock_disk, mock_wait):
     mock_disk.side_effect = gce_mock.delete_anything
     mock_wait.side_effect = gce_mock.wait_for_operation
     self.assertIsNone(self._driver.delete_volume(self.fake_volume))
     mock_wait.assert_called_once_with(self._driver.gce_svc,
                                       self._driver.gce_project,
                                       gce_mock.fake_operation())
Ejemplo n.º 4
0
 def test_create_volume_from_snapshot(self, mock_get_snapshot,
                                      mock_snapshot, mock_wait):
     mock_get_snapshot.side_effect = gce_mock.get_snapshot
     mock_snapshot.side_effect = gce_mock.create_anything
     mock_wait.side_effect = gce_mock.wait_for_operation
     self.assertIsNone(
         self._driver.create_volume_from_snapshot(self.fake_volume,
                                                  self.fake_snapshot))
     mock_wait.assert_called_once_with(self._driver.gce_svc,
                                       self._driver.gce_project,
                                       gce_mock.fake_operation())