def test_success(cls): ''' A release that always succeeds. ''' step = release.Step( name='success', check=lambda: {}, precondition=lambda _: True, expected={}, action=lambda: None, rollback_action=lambda: None, ) rel = release.Release(name='test', steps=[step]) rel.execute()
def test_failure_postcondition(self): ''' A release that always fails on the postcondition phase. ''' step = release.Step( name='success', check=lambda: {}, precondition=lambda _: True, expected={'a': 1}, action=lambda: None, rollback_action=lambda: None, ) rel = release.Release(name='test', steps=[step]) try: rel.execute() except release.PostconditionError: self.assertEqual(len(rel.executed_steps), 1)
def plugin_app(parent): this.Release = release.Release(VERSION, init) return