def test_v2_runner_on_unreachable(self): """ Verify UNREACHABLE results uses the logger. """ result = TaskResult('127.0.0.1', Task(), {}) result._host = Host('127.0.0.1') self.logforward.v2_runner_on_unreachable(result) self.assertEqual(1, self.logforward.log.warn.call_count)
def test_v2_runner_on_ok(self): """ Verify OK results uses the logger. """ result = TaskResult('127.0.0.1', Task(), {}) result._host = Host('127.0.0.1') self.logforward.v2_runner_on_ok(result) self.assertEqual(1, self.logforward.log.info.call_count)
def test_v2_runner_on_skipped(self): """ Verify SKIPPED results uses the logger. """ result = TaskResult('127.0.0.1', Task(), {}) result._host = Host('127.0.0.1') self.logforward.v2_runner_on_skipped(result) self.assertEqual(1, self.logforward.log.warn.call_count)
def test_v2_runner_on_failed(self): """ Verify failed results uses the logger. """ result = TaskResult('127.0.0.1', Task(), {'exception': 'error'}) result._host = MagicMock() result._host.get_name.return_value = '127.0.0.1' self.logforward.v2_runner_on_failed(result) self.assertEqual(1, self.logforward.log.warn.call_count)