[Checkins] SVN: Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py Try harder to normalize away irrelevant whitespace.
Tres Seaver
tseaver at palladion.com
Mon Sep 19 12:59:03 EST 2011
Log message for revision 122848:
Try harder to normalize away irrelevant whitespace.
Changed:
U Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py
-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py 2011-09-19 17:20:02 UTC (rev 122847)
+++ Products.GenericSetup/trunk/Products/GenericSetup/tests/test_tool.py 2011-09-19 17:59:03 UTC (rev 122848)
@@ -775,16 +775,17 @@
def normalize_xml(xml):
# using this might mask a real problem on windows, but so far the
# different newlines just caused problems in this test
- lines = [ line for line in xml.splitlines() if line ]
- return '\n'.join(lines) + '\n'
+ lines = filter(None,
+ [line.strip() for line in xml.splitlines() if line])
+ return ' '.join(lines)
fileobj = snapshot._getOb( 'import_steps.xml' )
self.assertEqual( normalize_xml( fileobj.read() ),
- _DEFAULT_STEP_REGISTRIES_IMPORT_XML )
+ normalize_xml(_DEFAULT_STEP_REGISTRIES_IMPORT_XML))
fileobj = snapshot._getOb( 'export_steps.xml' )
self.assertEqual( normalize_xml( fileobj.read() ),
- _DEFAULT_STEP_REGISTRIES_EXPORT_XML )
+ normalize_xml(_DEFAULT_STEP_REGISTRIES_EXPORT_XML ))
self.assertEqual( len( tool.listSnapshotInfo() ), 1 )
More information about the checkins
mailing list