Browse Source

test_html_entity()

tags/v0.2
Ben Kurtovic 11 years ago
parent
commit
e9463543f4
1 changed files with 17 additions and 1 deletions
  1. +17
    -1
      tests/test_builder.py

+ 17
- 1
tests/test_builder.py View 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"""


Loading…
Cancel
Save