[CMF-checkins] CVS: CMF/CMFSetup/tests - test_tool.py:1.14
test_utils.py:1.3
Yvo Schubbe
y.2004_ at wcm-solutions.de
Sun Aug 8 14:24:58 EDT 2004
Update of /cvs-repository/CMF/CMFSetup/tests
In directory cvs.zope.org:/tmp/cvs-serv27305/CMFSetup/tests
Modified Files:
test_tool.py test_utils.py
Log Message:
- made tests pass on windows by normalizing xml read from zpt
- re-added necessary whitespace
- made tests that need to be imported from Products pass if run outside of test_all.py
=== CMF/CMFSetup/tests/test_tool.py 1.13 => 1.14 ===
--- CMF/CMFSetup/tests/test_tool.py:1.13 Fri Aug 6 04:20:06 2004
+++ CMF/CMFSetup/tests/test_tool.py Sun Aug 8 14:24:58 2004
@@ -652,11 +652,20 @@
for id in [ x[0] for x in _EXPECTED ]:
self.failUnless( id in snapshot.objectIds() )
+ 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'
+
fileobj = snapshot._getOb( 'import_steps.xml' )
- self.assertEqual( fileobj.read() , _EMPTY_IMPORT_XML )
+ self.assertEqual( normalize_xml( fileobj.read() ),
+ _EMPTY_IMPORT_XML )
fileobj = snapshot._getOb( 'export_steps.xml' )
- self.assertEqual( fileobj.read() , _DEFAULT_STEP_REGISTRIES_EXPORT_XML )
+
+ self.assertEqual( normalize_xml( fileobj.read() ),
+ _DEFAULT_STEP_REGISTRIES_EXPORT_XML )
self.assertEqual( len( tool.listSnapshotInfo() ), 1 )
@@ -672,7 +681,7 @@
<export-step id="step_registries"
handler="Products.CMFSetup.tool.exportStepRegistries"
title="Export import / export steps.">
-
+
</export-step>
</export-steps>
"""
@@ -956,6 +965,11 @@
"""
def test_suite():
+ # reimport to make sure tests are run from Products
+ from Products.CMFSetup.tests.test_tool import SetupToolTests
+ from Products.CMFSetup.tests.test_tool import Test_exportToolset
+ from Products.CMFSetup.tests.test_tool import Test_importToolset
+
return unittest.TestSuite((
unittest.makeSuite( SetupToolTests ),
unittest.makeSuite( Test_exportToolset ),
=== CMF/CMFSetup/tests/test_utils.py 1.2 => 1.3 ===
--- CMF/CMFSetup/tests/test_utils.py:1.2 Fri Aug 6 04:20:06 2004
+++ CMF/CMFSetup/tests/test_utils.py Sun Aug 8 14:24:58 2004
@@ -86,6 +86,9 @@
self.assertRaises( ValueError, _getDottedName, doh )
def test_suite():
+ # reimport to make sure tests are run from Products
+ from Products.CMFSetup.tests.test_utils import UtilsTests
+
return unittest.TestSuite((
unittest.makeSuite( UtilsTests ),
))
More information about the CMF-checkins
mailing list