def test_to_string(self): snapshot = mock.MagicMock() self.assertIn("Volume Snapshot ", cinder.Snapshots(self.creds_manager).to_str(snapshot))
def test_delete(self): snapshot = mock.MagicMock() self.assertIsNone( cinder.Snapshots(self.creds_manager).delete(snapshot)) self.cloud.delete_volume_snapshot.assert_called_once_with( snapshot['id'])
def test_disable(self): snapshot = mock.MagicMock() with self.assertLogs(level='WARNING'): cinder.Snapshots(self.creds_manager).disable(snapshot)
def test_list(self): self.assertIs(self.cloud.list_volume_snapshots.return_value, cinder.Snapshots(self.creds_manager).list()) self.cloud.list_volume_snapshots.assert_called_once_with()