From ec444785a35722778ad188a66fef483cc93d7bbb Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sun, 20 Feb 2011 08:41:38 -0500 Subject: Added an empty-element tag test. --- tests/test_lxml.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests/test_lxml.py') diff --git a/tests/test_lxml.py b/tests/test_lxml.py index 602fe05..77dd1f1 100644 --- a/tests/test_lxml.py +++ b/tests/test_lxml.py @@ -33,14 +33,19 @@ class TestLXMLBuilder(SoupTest): "", "") - def test_self_closing(self): - # HTML's self-closing tags are recognized as such. + def test_empty_element(self): + # HTML's empty-element tags are recognized as such. self.assertSoupEquals( "

A tag

", "

A tag

") self.assertSoupEquals( "

Foo
bar

", "

Foo
bar

") + def test_empty_tag_thats_not_an_empty_element_tag(self): + # A tag that is empty but not an HTML empty-element tag + # is not presented as an empty-element tag. + self.assertSoupEquals("

", "

") + def test_comment(self): # Comments are represented as Comment objects. markup = "

foobaz

" @@ -351,6 +356,9 @@ class TestLXMLBuilderInvalidMarkup(SoupTest): '
', '
') + def test_empty_element_tag_with_contents(self): + self.assertSoupEquals("
foo
", "
foo") + def test_doctype_in_body(self): markup = "

onetwo

" self.assertSoupEquals(markup) -- cgit v1.2.3