Sfoglia il codice sorgente

test_html_entity()

tags/v0.2
Ben Kurtovic 11 anni fa
parent
commit
e9463543f4
1 ha cambiato i file con 17 aggiunte e 1 eliminazioni
  1. +17
    -1
      tests/test_builder.py

+ 17
- 1
tests/test_builder.py Vedi File

@@ -153,7 +153,23 @@ class TestBuilder(TreeEqualityTestCase):

def test_html_entity(self):
"""tests for building HTMLEntity nodes"""
pass
tests = [
([tokens.HTMLEntityStart(), tokens.Text(text="nbsp"),
tokens.HTMLEntityEnd()],
wrap([HTMLEntity("nbsp", named=True, hexadecimal=False)])),

([tokens.HTMLEntityStart(), tokens.HTMLEntityNumeric(),
tokens.Text(text="107"), tokens.HTMLEntityEnd()],
wrap([HTMLEntity("107", named=False, hexadecimal=False)])),

([tokens.HTMLEntityStart(), tokens.HTMLEntityNumeric(),
tokens.HTMLEntityHex(char="X"), tokens.Text(text="6B"),
tokens.HTMLEntityEnd()],
wrap([HTMLEntity("6B", named=False, hexadecimal=True,
hex_char="X")])),
]
for test, valid in tests:
self.assertWikicodeEqual(valid, self.builder.build(test))

def test_heading(self):
"""tests for building Heading nodes"""


Caricamento…
Annulla
Salva