def _testing_check_verify(self, objects, expected): workflow_engine = InstanceWorkflowEngine(Mock(), Mock()) workflow_engine.status_cache[StatusConstants.NEW] = Status( id=StatusConstants.NEW, name="Test NEW", type=StatusTypes.SUCCESS) workflow_engine.status_cache[StatusConstants.SUCCESS] = Status( id=StatusConstants.SUCCESS, name="Test SUCCESS", type=StatusTypes.SUCCESS) workflow_engine.status_cache[StatusConstants.FAILED] = Status( id=StatusConstants.FAILED, name="Test FAILED", type=StatusTypes.FAILED) workflow_engine.status_cache[StatusConstants.CANCELED] = Status( id=StatusConstants.NEW, name="Test CANCELED", type=StatusTypes.CANCELED) if expected[2]: workflow_engine.status_cache[expected[2].id] = expected[2] all_complete, all_passed, failed_type = workflow_engine._check_and_verify_statuses( objects) eq_(expected[0], all_complete, "All Complete did not match") eq_(expected[1], all_passed, "All passed did not match.") eq_(expected[2], failed_type, "Failed Type did not match.")
def test_check_verify_statuses_simple(self): workflow_engine = InstanceWorkflowEngine(Mock(), Mock()) all_complete, all_passed, failed_type = workflow_engine._check_and_verify_statuses( [StageInstance(status_id=StatusConstants.NEW)]) eq_(False, all_complete) eq_(True, all_passed) eq_(None, failed_type)