From b7749c50a2c96ccf6982cfa1ca02d883e31e0af9 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Thu, 23 Feb 2012 11:56:40 -0500 Subject: Bumped version number. --- bs4/testing.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'bs4/testing.py') diff --git a/bs4/testing.py b/bs4/testing.py index b2ca180..1945c02 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -360,16 +360,28 @@ class HTMLTreeBuilderSmokeTest(object): class XMLTreeBuilderSmokeTest(object): + def test_docstring_generated(self): + soup = self.soup("") + self.assertEqual( + soup.encode(), b'\n') + + def test_docstring_includes_correct_encoding(self): + soup = self.soup("") + self.assertEqual( + soup.encode("latin1"), + b'\n') + + + def test_tags_are_empty_element_if_and_only_if_they_are_empty(self): + self.assertSoupEquals("

", "

") + self.assertSoupEquals("

foo

") + def test_namespaces_are_preserved(self): - markup = 'This tag is in the a namespaceThis tag is in the b namespace' + markup = 'This tag is in the a namespaceThis tag is in the b namespace' soup = self.soup(markup) root = soup.root - import pdb; pdb.set_trace() - self.assertEquals("http://www.example.com/", root['xmlns:a']) - self.assertEquals("http://www.example.net/", root['xmlns:b']) - - - pass + self.assertEquals("http://example.com/", root['xmlns:a']) + self.assertEquals("http://example.net/", root['xmlns:b']) -- cgit v1.2.3