コード例 #1
0
ファイル: test_ncr.py プロジェクト: ortodesign/wextracto
def test_read_less_that_whole_token():
    content = ncr.InvalidNumCharRefReplacer(StringIO(elem))
    assert content.read(2) == "<c"
    assert content.read() == "ode>Hello &#x2022;</code>"
コード例 #2
0
ファイル: test_ncr.py プロジェクト: ortodesign/wextracto
def test_ncr_bug_read_with_size():
    content = ncr.InvalidNumCharRefReplacer(StringIO(elem))
    assert content.read(26) == "<code>Hello &#x2022;</code"
    assert content.read(26) == ">"
コード例 #3
0
ファイル: test_ncr.py プロジェクト: ortodesign/wextracto
def test_ncr_no_semi_colon_terminated():
    content = ncr.InvalidNumCharRefReplacer(StringIO('&#x95,45'))
    assert content.read() == "&#x2022,45"
コード例 #4
0
ファイル: test_ncr.py プロジェクト: ortodesign/wextracto
def test_ncr_script():
    content = ncr.InvalidNumCharRefReplacer(StringIO(script))
    assert content.read() == script
コード例 #5
0
ファイル: test_ncr.py プロジェクト: ortodesign/wextracto
def test_ncr_empty():
    content = ncr.InvalidNumCharRefReplacer(StringIO("&#;"))
    assert content.read() == "&#;"
コード例 #6
0
ファイル: test_ncr.py プロジェクト: ortodesign/wextracto
def test_ncr_decimal():
    content = ncr.InvalidNumCharRefReplacer(StringIO("&#149;"))
    assert content.read() == "&#x2022;"