def test_create_cg_snapshot_task_revert(self, client, mocked): store_spec = { 'client': client, 'cg_name': 'test_cg', 'cg_snap_name': 'my_snap_name' } self.work_flow.add(vnx_taskflow.CreateCGSnapshotTask()) engine = taskflow.engines.load(self.work_flow, store=store_spec) self.assertRaises(vnx_ex.VNXCreateSnapError, engine.run)
def test_create_cg_snapshot_task(self, client, mocked): store_spec = { 'client': client, 'cg_name': 'test_cg', 'cg_snap_name': 'my_snap_name' } self.work_flow.add(vnx_taskflow.CreateCGSnapshotTask()) engine = taskflow.engines.load(self.work_flow, store=store_spec) engine.run() snap_name = engine.storage.fetch('new_cg_snap_name') self.assertIsInstance(snap_name, res_mock.StorageObjectMock)