def test_failing_non_blocking_hook(self): """Two failing hook, non blocking, all evaluated""" runner = hookrunner() runner.register(failinghook, blocking=False) runner.register(failinghook2) assert(runner.evaluate()) == False assert(runner.log.read()) == [ERROR_MSG, ERROR_MSG2]
def test_failing_stop_hook(self): """Two failing hook, second one should not run""" runner = hookrunner() runner.register(failinghook) runner.register(failinghook2) assert(runner.evaluate()) == False assert(runner.log.read()) == [ERROR_MSG]
def test_failing_hook(self): """Failing hook fails with error message recorded""" runner = hookrunner() runner.register(failinghook) assert(runner.evaluate()) == False assert(runner.log.read()) == [ERROR_MSG]
def test_passing_failing_hook(self): """Passing than failing hook, fails overall""" runner = hookrunner() runner.register(passinghook) runner.register(failinghook) assert(runner.evaluate()) == False
def test_passing_hook(self): """Passing hook works""" runner = hookrunner() runner.register(passinghook) assert(runner.evaluate()) == True