예제 #1
0
def test_invalid_codepoints_surrogates(inp, num):
    inp = eval(inp)  # pylint:disable=eval-used
    fp = StringIO(inp)
    if ord(max(fp.read())) > 0xFFFF:
        pytest.skip("StringIO altered string")
    fp.seek(0)
    stream = HTMLUnicodeInputStream(fp)
    for _i in range(len(inp)):
        stream.char()
    assert len(stream.errors) == num
예제 #2
0
def test_invalid_codepoints_surrogates(inp, num):
    inp = eval(inp)  # pylint:disable=eval-used
    fp = StringIO(inp)
    if ord(max(fp.read())) > 0xFFFF:
        pytest.skip("StringIO altered string")
    fp.seek(0)
    stream = HTMLUnicodeInputStream(fp)
    for _i in range(len(inp)):
        stream.char()
    assert len(stream.errors) == num
예제 #3
0
def test_invalid_codepoints(inp, num):
    stream = HTMLUnicodeInputStream(StringIO(inp))
    for _i in range(len(inp)):
        stream.char()
    assert len(stream.errors) == num
예제 #4
0
def test_invalid_codepoints(inp, num):
    stream = HTMLUnicodeInputStream(StringIO(inp))
    for _i in range(len(inp)):
        stream.char()
    assert len(stream.errors) == num