From 484284c0c80aa749ee3050a3194d7bc99cf2916b Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Wed, 29 Dec 2010 19:00:46 -0500 Subject: Moved in a test for comments (not supported by the html5lib treebuilder yet. --- src/beautifulsoup/tests/helpers.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/beautifulsoup/tests/helpers.py') diff --git a/src/beautifulsoup/tests/helpers.py b/src/beautifulsoup/tests/helpers.py index c62bb48..c8189e3 100644 --- a/src/beautifulsoup/tests/helpers.py +++ b/src/beautifulsoup/tests/helpers.py @@ -2,7 +2,7 @@ import unittest from beautifulsoup import BeautifulSoup -from beautifulsoup.element import SoupStrainer +from beautifulsoup.element import Comment, SoupStrainer from beautifulsoup.builder.lxml_builder import LXMLTreeBuilder class SoupTest(unittest.TestCase): @@ -63,6 +63,15 @@ class BuilderSmokeTest(SoupTest): self.assertSoupEquals( "

Foo
bar

", "

Foo
bar

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

foobaz

" + self.assertSoupEquals(markup) + + soup = self.soup(markup) + comment = soup.find(text="foobar") + self.assertEquals(comment.__class__, Comment) + def test_nested_inline_elements(self): # Inline tags can be nested indefinitely. b_tag = "Inside a B tag" -- cgit v1.2.3