summaryrefslogtreecommitdiff
path: root/tests/test_lxml.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-01-28 13:30:40 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2011-01-28 13:30:40 -0500
commit5d4b8cc6d288a705cf87c2f2c26036b94d825aa9 (patch)
tree33a12e789fc659022d9fca2eb84c6135b81d1c23 /tests/test_lxml.py
parent4b980a8ceb23198a840bb514c8de16ef41fbb036 (diff)
Refactored enough to get all of the tests to pass with test discovery, even though there are still some underlying problems.
Diffstat (limited to 'tests/test_lxml.py')
-rw-r--r--tests/test_lxml.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_lxml.py b/tests/test_lxml.py
new file mode 100644
index 0000000..7fe6870
--- /dev/null
+++ b/tests/test_lxml.py
@@ -0,0 +1,24 @@
+"""Tests to ensure that the lxml tree builder generates good trees."""
+
+from beautifulsoup.builder.lxml_builder import LXMLTreeBuilder
+from beautifulsoup.testing import (
+ BuilderInvalidMarkupSmokeTest,
+ BuilderSmokeTest,
+)
+
+class TestLXMLBuilder(BuilderSmokeTest):
+ """See `BuilderSmokeTest`."""
+
+ def test_foo(self):
+ isolatin = """<html><meta http-equiv="Content-type" content="text/html; charset=ISO-Latin-1" />Sacr\xe9 bleu!</html>"""
+ soup = self.soup(isolatin)
+
+ utf8 = isolatin.replace("ISO-Latin-1".encode(), "utf-8".encode())
+ utf8 = utf8.replace("\xe9", "\xc3\xa9")
+
+ print soup
+
+
+class TestLXMLBuilderInvalidMarkup(BuilderInvalidMarkupSmokeTest):
+ """See `BuilderInvalidMarkupSmokeTest`."""
+