diff -r 48f468f33704 -r e4580e5f0703 test/unittest_uilib.py
--- a/test/unittest_uilib.py Fri Dec 10 12:17:18 2010 +0100
+++ b/test/unittest_uilib.py Fri Mar 11 09:46:45 2011 +0100
@@ -16,17 +16,20 @@
#
# You should have received a copy of the GNU Lesser General Public License along
# with CubicWeb. If not, see .
-"""unittests for cubicweb.uilib
-
-"""
+"""unittests for cubicweb.uilib"""
__docformat__ = "restructuredtext en"
+
+import pkg_resources
from logilab.common.testlib import TestCase, unittest_main
-from logilab.common.tree import Node
+from unittest2 import skipIf
from cubicweb import uilib
+lxml_version = pkg_resources.get_distribution('lxml').version.split('.')
+
+
class UILIBTC(TestCase):
def test_remove_tags(self):
@@ -94,7 +97,15 @@
got = uilib.text_cut(text, 30)
self.assertEqual(got, expected)
+ def test_soup2xhtml_0(self):
+ self.assertEqual(uilib.soup2xhtml('hop\r\nhop', 'ascii'),
+ 'hop\nhop')
+
def test_soup2xhtml_1_1(self):
+ self.assertEqual(uilib.soup2xhtml('hop', 'ascii'),
+ 'hop')
+ self.assertEqual(uilib.soup2xhtml('hop
', 'ascii'),
+ 'hop
')
self.assertEqual(uilib.soup2xhtml('hop
', 'ascii'),
'hop
')
self.assertEqual(uilib.soup2xhtml('
hop', 'ascii'),
@@ -118,11 +129,14 @@
self.assertEqual(uilib.soup2xhtml('hop hop', 'ascii'),
'hop hop')
- def test_soup2xhtml_2_2(self):
+ def test_soup2xhtml_2_2a(self):
self.assertEqual(uilib.soup2xhtml('hop ', 'ascii'),
'hop ')
self.assertEqual(uilib.soup2xhtml('