Przeglądaj źródła

test_html_entity()

tags/v0.2
Ben Kurtovic 11 lat temu
rodzic
commit
e9463543f4
1 zmienionych plików z 17 dodań i 1 usunięć
  1. +17
    -1
      tests/test_builder.py

+ 17
- 1
tests/test_builder.py Wyświetl plik

@@ -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"""


Ładowanie…
Anuluj
Zapisz