def METHOD_NAME(test, result):
    expected = test.get_expected_result()
    if expected == 'ERROR':
        assert result.is_error(), 'Test did not issue error as expected'
    elif expected == 'FAIL':
        assert result.is_failure(), 'Test did not fail as expected'
    elif expected == 'SUCCESS':
        assert result.is_success(), 'Test {} unexpectedly unsuccessful:\n{}'.format(
            test.id, list(itertools.chain(result.get_errors(), result.get_failures())))
    elif expected == 'INTERRUPT':
        assert result.is_interrupted(), 'Test did not get interrupted as expected'
    elif expected == 'SKIP':
        assert result.is_skip()
    elif expected == 'NOT_RUN':
        assert result.is_not_run()
    else:
        raise NotImplementedError(
            'Unknown expected result: {!r}'.format(expected))  # pragma: no cover