summaryrefslogtreecommitdiff
path: root/bs4/testing.py
diff options
context:
space:
mode:
Diffstat (limited to 'bs4/testing.py')
-rw-r--r--bs4/testing.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/bs4/testing.py b/bs4/testing.py
index 6f9d857..55b953f 100644
--- a/bs4/testing.py
+++ b/bs4/testing.py
@@ -391,10 +391,29 @@ class XMLTreeBuilderSmokeTest(object):
markup = '<root xmlns:a="http://example.com/" xmlns:b="http://example.net/"><a:foo>This tag is in the a namespace</a:foo><b:foo>This tag is in the b namespace</b:foo></root>'
soup = self.soup(markup)
root = soup.root
- self.assertEquals("http://example.com/", root['xmlns:a'])
- self.assertEquals("http://example.net/", root['xmlns:b'])
+ self.assertEqual("http://example.com/", root['xmlns:a'])
+ self.assertEqual("http://example.net/", root['xmlns:b'])
+class HTML5TreeBuilderSmokeTest(HTMLTreeBuilderSmokeTest):
+ """Smoke test for a tree builder that supports HTML5."""
+
+ def test_html_tags_have_namespace(self):
+ markup = "<a>"
+ soup = self.soup(markup)
+ self.assertEqual("http://www.w3.org/1999/xhtml", soup.a.namespace)
+
+ def test_svg_tags_have_namespace(self):
+ markup = '<svg>'
+ soup = self.soup(markup)
+ self.assertEqual("http://www.w3.org/2000/svg", soup.svg.namespace)
+
+ def test_mathml_tags_have_namespace(self):
+ markup = '<math>'
+ soup = self.soup(markup)
+ self.assertEqual(
+ 'http://www.w3.org/1998/Math/MathML', soup.math.namespace)
+
def skipIf(condition, reason):
def nothing(test, *args, **kwargs):