summaryrefslogtreecommitdiff
path: root/tests/test_lxml.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-02-20 08:37:20 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2011-02-20 08:37:20 -0500
commita16883da6445710fcf69cfcc1842fb6883495b1c (patch)
tree6d9f8cacd7d65be56dec702b597d9a75b4e123fc /tests/test_lxml.py
parent54f1fb0a0af88c408175cbcdf060d2d04040075d (diff)
Tag.is_empty_element is determined dynamically, based on a) whether the builder used to create the tag had an explicit list of empty-element tags, and b) whether the tag actually contains anything.
Diffstat (limited to 'tests/test_lxml.py')
-rw-r--r--tests/test_lxml.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_lxml.py b/tests/test_lxml.py
index dd1c363..602fe05 100644
--- a/tests/test_lxml.py
+++ b/tests/test_lxml.py
@@ -492,15 +492,14 @@ class TestLXMLXMLBuilder(SoupTest):
def default_builder(self):
return LXMLTreeBuilderForXML()
- def test_self_closing_tag(self):
+ def test_empty_element_tag(self):
soup = self.soup("<p><iamselfclosing /></p>")
- self.assertTrue(soup.iamselfclosing.isSelfClosing)
+ self.assertTrue(soup.iamselfclosing.is_empty_element)
- def test_self_empty_tag_treated_as_self_closing(self):
+ def test_self_empty_tag_treated_as_empty_element(self):
soup = self.soup("<p><iamclosed></iamclosed></p>")
- self.assertTrue(soup.iamclosed.isSelfClosing)
+ self.assertTrue(soup.iamclosed.is_empty_element)
- def test_self_nonempty_tag_is_not_self_closing(self):
+ def test_self_nonempty_tag_is_not_empty_element(self):
soup = self.soup("<p><ihavecontents>contents</ihavecontents></p>")
- self.assertFalse(soup.ihavecontents.isSelfClosing)
-
+ self.assertFalse(soup.ihavecontents.is_empty_element)