def test_parser_with_syntax_errors(broken_status):
    def catch_syntax_error(seq):
        datafile = broken_status.join('%d.txt' % seq)
        parser = LogParser.fromstring(datafile.read())
        with raises(ParsingError) as error:
            parser.parse()
        return error

    error = catch_syntax_error(0)
    assert not error.value.args[0].startswith('expected list')
    assert not error.value.args[0].startswith('expected 2-tuple')
    assert error.value.args[0].endswith('got end of input')

    error = catch_syntax_error(1)
    assert not error.value.args[0].startswith('expected list')
    assert not error.value.args[0].startswith('expected 2-tuple')
    assert error.value.args[0].endswith('got %r' % u'BrokenVPN CLIENT LIST')

    error = catch_syntax_error(2)
    assert error.value.args[0] == 'expected list but got end of input'

    error = catch_syntax_error(3)
    assert error.value.args[0] == 'expected 2-tuple but got end of input'

    error = catch_syntax_error(4)
    assert error.value.args[0] == \
        'expected 2-tuple but got %r' % u'Updated,Yo,Hoo'

    error = catch_syntax_error(5)
    assert error.value.args[0] == \
        'expected 2-tuple starting with %r' % u'Updated'

    error = catch_syntax_error(6)
    assert error.value.args[0] == u'YO TABLE' % 'expected list but got %r'
dataset/ETHPy150Open tonyseek/openvpn-status/tests/test_parser.py/test_parser_with_syntax_errors/swapped operands of `%`