[python-formencode] * Fri Jul 30 2010 Toshio Kuratomi <toshio at fedoraproject.org> - 1.2.2-4 - Apply patch to fix unittest
Toshio くらとみ
toshio at fedoraproject.org
Sat Jul 31 00:51:50 UTC 2010
commit 829753911d851856aa5aaa0c79791c7664772233
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date: Fri Jul 30 20:51:25 2010 -0400
* Fri Jul 30 2010 Toshio Kuratomi <toshio at fedoraproject.org> - 1.2.2-4
- Apply patch to fix unittests
formencode-py27-tests.patch | 46 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/formencode-py27-tests.patch b/formencode-py27-tests.patch
new file mode 100644
index 0000000..5965b83
--- /dev/null
+++ b/formencode-py27-tests.patch
@@ -0,0 +1,46 @@
+Index: FormEncode-1.2.2/tests/test_htmlfill.py
+===================================================================
+--- FormEncode-1.2.2.orig/tests/test_htmlfill.py
++++ FormEncode-1.2.2/tests/test_htmlfill.py
+@@ -15,6 +15,7 @@ from xml.parsers.expat import ExpatError
+ from formencode import htmlfill_schemabuilder
+ try:
+ import xml.etree.ElementTree as ET
++ from xml.etree.ElementTree import ParseError
+ except ImportError:
+ import elementtree.ElementTree as ET
+
+@@ -63,7 +64,9 @@ def run_filename(filename):
+ try:
+ output_xml = ET.XML(output)
+ expected_xml = ET.XML(expected)
+- except ExpatError:
++ except (ParseError, ExpatError):
++ # On python-2.7, this is a ParseError
++ # On python-2.6 or less it's an ExpatError
+ comp = output.strip() == expected.strip()
+ else:
+ comp = xml_compare(output_xml, expected_xml, reporter)
+Index: FormEncode-1.2.2/tests/test_htmlgen.py
+===================================================================
+--- FormEncode-1.2.2.orig/tests/test_htmlgen.py
++++ FormEncode-1.2.2/tests/test_htmlgen.py
+@@ -42,10 +42,14 @@ def test_quote():
+ assert str(html.b('<hey>')) == '<b><hey></b>'
+
+ def test_comment():
+- assert str(html.comment('test')) == '<!-- test -->'
+- assert (str(html.comment(uni_value))
+- == '<!-- %s -->' % uni_value.encode('utf-8'))
+- assert str(html.comment('test')('this')) == '<!-- testthis -->'
++ # Note: spaces vs no spaces is a python-2.7+ vs python-2.6 or less
++ # difference
++ assert str(html.comment('test')) in ('<!--test-->', '<!-- test -->')
++ assert (str(html.comment(uni_value)) in
++ ('<!--%s-->' % uni_value.encode('utf-8'),
++ '<!-- %s -->' % uni_value.encode('utf-8')))
++ assert str(html.comment('test')('this')) in ('<!--testthis-->',
++ '<!-- testthis -->')
+
+ def test_none():
+ assert html.str(None) == ''
More information about the scm-commits
mailing list