def test_read_less_that_whole_token(): content = ncr.InvalidNumCharRefReplacer(StringIO(elem)) assert content.read(2) == "<c" assert content.read() == "ode>Hello •</code>"
def test_ncr_bug_read_with_size(): content = ncr.InvalidNumCharRefReplacer(StringIO(elem)) assert content.read(26) == "<code>Hello •</code" assert content.read(26) == ">"
def test_ncr_no_semi_colon_terminated(): content = ncr.InvalidNumCharRefReplacer(StringIO('•,45')) assert content.read() == "•,45"
def test_ncr_script(): content = ncr.InvalidNumCharRefReplacer(StringIO(script)) assert content.read() == script
def test_ncr_empty(): content = ncr.InvalidNumCharRefReplacer(StringIO("&#;")) assert content.read() == "&#;"
def test_ncr_decimal(): content = ncr.InvalidNumCharRefReplacer(StringIO("•")) assert content.read() == "•"