[CMF-checkins] CVS: CMF/CMFSetup/tests - __init__.py:1.2
common.py:1.13 conformance.py:1.5 test_actions.py:1.8
test_all.py:1.14 test_context.py:1.11 test_differ.py:1.2
test_registry.py:1.14 test_skins.py:1.8 test_tool.py:1.13
test_typeinfo.py:1.9 test_utils.py:1.2
Yvo Schubbe
y.2004_ at wcm-solutions.de
Fri Aug 6 04:20:06 EDT 2004
Update of /cvs-repository/CMF/CMFSetup/tests
In directory cvs.zope.org:/tmp/cvs-serv896/CMFSetup/tests
Modified Files:
__init__.py common.py conformance.py test_actions.py
test_all.py test_context.py test_differ.py test_registry.py
test_skins.py test_tool.py test_typeinfo.py test_utils.py
Log Message:
- added copyright headers
- whitespace cleanup
- some other minor cleanup
=== CMF/CMFSetup/tests/__init__.py 1.1 => 1.2 ===
--- CMF/CMFSetup/tests/__init__.py:1.1 Tue May 11 21:35:49 2004
+++ CMF/CMFSetup/tests/__init__.py Fri Aug 6 04:20:06 2004
@@ -1,3 +1,15 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" CMFSetup product unit tests.
$Id$
=== CMF/CMFSetup/tests/common.py 1.12 => 1.13 ===
--- CMF/CMFSetup/tests/common.py:1.12 Fri Jul 9 15:14:40 2004
+++ CMF/CMFSetup/tests/common.py Fri Aug 6 04:20:06 2004
@@ -1,8 +1,22 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" CMFSetup product: unit test utilities.
+
+$Id$
"""
+
import os
import shutil
-import time
from tarfile import TarFile
from Products.CMFCore.tests.base.testcase import SecurityRequestTest
@@ -54,7 +68,7 @@
if os.path.exists( root_path ):
shutil.rmtree( root_path )
-
+
def _makeTestFile( filename, root_path, contents ):
path, filename = os.path.split( filename )
=== CMF/CMFSetup/tests/conformance.py 1.4 => 1.5 ===
--- CMF/CMFSetup/tests/conformance.py:1.4 Thu Jul 1 14:41:53 2004
+++ CMF/CMFSetup/tests/conformance.py Fri Aug 6 04:20:06 2004
@@ -1,3 +1,15 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" Base classes for testing interface conformance.
Derived testcase classes should define '_getTargetClass()', which must
=== CMF/CMFSetup/tests/test_actions.py 1.7 => 1.8 ===
--- CMF/CMFSetup/tests/test_actions.py:1.7 Mon Jul 19 14:11:37 2004
+++ CMF/CMFSetup/tests/test_actions.py Fri Aug 6 04:20:06 2004
@@ -1,9 +1,24 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" CMFSetup action provider export / import unit tests
$Id$
"""
import unittest
+import Testing
+import Zope
+Zope.startup()
from Acquisition import Implicit
from Acquisition import aq_parent
@@ -16,9 +31,11 @@
from common import DummyExportContext
from common import DummyImportContext
+
class DummyTool( Folder, ActionProviderBase ):
__implements__ = ( IActionProvider, )
+
class DummyUser( Implicit ):
=== CMF/CMFSetup/tests/test_all.py 1.13 => 1.14 ===
--- CMF/CMFSetup/tests/test_all.py:1.13 Mon Jul 19 18:50:25 2004
+++ CMF/CMFSetup/tests/test_all.py Fri Aug 6 04:20:06 2004
@@ -1,3 +1,15 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" CMFSetup tests.
$Id$
=== CMF/CMFSetup/tests/test_context.py 1.10 => 1.11 ===
--- CMF/CMFSetup/tests/test_context.py:1.10 Tue Jul 20 17:53:20 2004
+++ CMF/CMFSetup/tests/test_context.py Fri Aug 6 04:20:06 2004
@@ -1,14 +1,29 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" Unit tests for import / export contexts.
$Id$
"""
import unittest
+import Testing
+import Zope
+Zope.startup()
+
import os
import time
from StringIO import StringIO
-from Acquisition import aq_parent
from DateTime.DateTime import DateTime
from OFS.Folder import Folder
from OFS.Image import File
@@ -386,7 +401,7 @@
site = DummySite( 'site' ).__of__( self.root )
ctx = self._getTargetClass()( site )
- ctx.writeDataFile( 'foo.txt', printable, 'text/plain' )
+ ctx.writeDataFile( 'foo.txt', printable, 'text/plain' )
fileish = StringIO( ctx.getArchive() )
@@ -401,8 +416,8 @@
site = DummySite( 'site' ).__of__( self.root )
ctx = self._getTargetClass()( site )
- ctx.writeDataFile( 'foo.txt', printable, 'text/plain' )
- ctx.writeDataFile( 'bar.txt', digits, 'text/plain' )
+ ctx.writeDataFile( 'foo.txt', printable, 'text/plain' )
+ ctx.writeDataFile( 'bar.txt', digits, 'text/plain' )
fileish = StringIO( ctx.getArchive() )
@@ -418,8 +433,8 @@
site = DummySite( 'site' ).__of__( self.root )
ctx = self._getTargetClass()( site )
- ctx.writeDataFile( 'foo.txt', printable, 'text/plain' )
- ctx.writeDataFile( 'bar/baz.txt', digits, 'text/plain' )
+ ctx.writeDataFile( 'foo.txt', printable, 'text/plain' )
+ ctx.writeDataFile( 'bar/baz.txt', digits, 'text/plain' )
fileish = StringIO( ctx.getArchive() )
@@ -614,8 +629,8 @@
tool = site.portal_setup
ctx = self._makeOne( tool, 'multiple' )
- ctx.writeDataFile( 'foo.txt', printable, 'text/plain' )
- ctx.writeDataFile( 'bar.txt', digits, 'text/plain' )
+ ctx.writeDataFile( 'foo.txt', printable, 'text/plain' )
+ ctx.writeDataFile( 'bar.txt', digits, 'text/plain' )
snapshot = tool.snapshots._getOb( 'multiple' )
=== CMF/CMFSetup/tests/test_differ.py 1.1 => 1.2 ===
--- CMF/CMFSetup/tests/test_differ.py:1.1 Mon Jul 19 18:50:25 2004
+++ CMF/CMFSetup/tests/test_differ.py Fri Aug 6 04:20:06 2004
@@ -1,8 +1,24 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" Unit tests for differ module.
$Id$
"""
+
import unittest
+import Testing
+import Zope
+Zope.startup()
from OFS.Folder import Folder
from OFS.Image import File
@@ -10,9 +26,11 @@
from DateTime.DateTime import DateTime
from Products.CMFCore.tests.base.testcase import SecurityRequestTest
+
class DummySite( Folder ):
pass
+
class Test_unidiff( unittest.TestCase ):
=== CMF/CMFSetup/tests/test_registry.py 1.13 => 1.14 ===
--- CMF/CMFSetup/tests/test_registry.py:1.13 Thu Jul 1 19:14:23 2004
+++ CMF/CMFSetup/tests/test_registry.py Fri Aug 6 04:20:06 2004
@@ -1,9 +1,24 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" Registry unit tests.
$Id$
"""
+
import unittest
-import os
+import Testing
+import Zope
+Zope.startup()
from OFS.Folder import Folder
from Products.CMFSetup.tests.common import BaseRegistryTests
@@ -14,6 +29,7 @@
from conformance import ConformsToIToolsetRegistry
from conformance import ConformsToIProfileRegistry
+
#==============================================================================
# Dummy handlers
#==============================================================================
@@ -1005,7 +1021,7 @@
class ProfileRegistryTests( BaseRegistryTests
, ConformsToIProfileRegistry
- ):
+ ):
def _getTargetClass( self ):
=== CMF/CMFSetup/tests/test_skins.py 1.7 => 1.8 ===
--- CMF/CMFSetup/tests/test_skins.py:1.7 Fri Jul 9 15:14:40 2004
+++ CMF/CMFSetup/tests/test_skins.py Fri Aug 6 04:20:06 2004
@@ -1,17 +1,30 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" Unit tests for CMFSetup skins configurator
$Id$
"""
import unittest
-import os
+import Testing
+import Zope
+Zope.startup()
-_TESTS_PATH = os.path.split( __file__ )[ 0 ]
+import os
from OFS.Folder import Folder
from OFS.SimpleItem import Item
-from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore import DirectoryView
from Products.CMFCore.utils import expandpath
from Products.CMFCore.utils import minimalpath
@@ -20,6 +33,9 @@
from common import DOMComparator
from common import DummyExportContext
from common import DummyImportContext
+
+_TESTS_PATH = os.path.split( __file__ )[ 0 ]
+
class DummySkinsTool( Folder ):
=== CMF/CMFSetup/tests/test_tool.py 1.12 => 1.13 ===
--- CMF/CMFSetup/tests/test_tool.py:1.12 Wed Jun 30 14:58:51 2004
+++ CMF/CMFSetup/tests/test_tool.py Fri Aug 6 04:20:06 2004
@@ -1,24 +1,40 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" Unit tests for CMFSetup tool.
$Id$
"""
import unittest
+import Testing
+import Zope
+Zope.startup()
+
import os
from StringIO import StringIO
from Acquisition import aq_base
from OFS.Folder import Folder
-from common import SecurityRequestTest
-
-from common import FilesystemTestBase
-from common import TarballTester
from common import DOMComparator
from common import DummyExportContext
from common import DummyImportContext
+from common import FilesystemTestBase
+from common import SecurityRequestTest
+from common import TarballTester
from conformance import ConformsToISetupTool
+
class SetupToolTests( FilesystemTestBase
, TarballTester
, ConformsToISetupTool
@@ -55,7 +71,7 @@
self.assertEqual( len( import_registry.listSteps() ), 0 )
export_registry = tool.getExportStepRegistry()
- export_steps = export_registry.listSteps()
+ export_steps = export_registry.listSteps()
self.assertEqual( len( export_steps ), 1 )
self.assertEqual( export_steps[ 0 ], 'step_registries' )
@@ -272,7 +288,7 @@
_PATH = 'tests/default_profile'
tool = self._makeOne()
- self.assertRaises( ValueError
+ self.assertRaises( ValueError
, tool.setProfileDirectory, _PATH, 'NonesuchProduct' )
def test_runImportStep_nonesuch( self ):
@@ -415,7 +431,7 @@
tool = self._makeOne().__of__( site )
result = tool.runAllImportSteps()
-
+
self.assertEqual( len( result[ 'steps' ] ), 0 )
def test_runAllImportSteps_sorted_default_purge( self ):
@@ -433,7 +449,7 @@
, _purgeIfRequired )
result = tool.runAllImportSteps()
-
+
self.assertEqual( len( result[ 'steps' ] ), 3 )
self.assertEqual( result[ 'steps' ][ 0 ], 'purging' )
@@ -465,7 +481,7 @@
, _purgeIfRequired )
result = tool.runAllImportSteps( purge_old=True )
-
+
self.assertEqual( len( result[ 'steps' ] ), 3 )
self.assertEqual( result[ 'steps' ][ 0 ], 'purging' )
@@ -490,7 +506,7 @@
, _purgeIfRequired )
result = tool.runAllImportSteps( purge_old=False )
-
+
self.assertEqual( len( result[ 'steps' ] ), 3 )
self.assertEqual( result[ 'steps' ][ 0 ], 'purging' )
@@ -656,7 +672,7 @@
<export-step id="step_registries"
handler="Products.CMFSetup.tool.exportStepRegistries"
title="Export import / export steps.">
-
+
</export-step>
</export-steps>
"""
@@ -667,12 +683,12 @@
<export-step id="properties"
handler="Products.CMFSetup.tests.test_tool._exportPropertiesINI"
title="properties">
-
+
</export-step>
<export-step id="step_registries"
handler="Products.CMFSetup.tool.exportStepRegistries"
title="Export import / export steps.">
-
+
</export-step>
</export-steps>
"""
@@ -685,20 +701,20 @@
handler="Products.CMFSetup.tests.test_tool._underscoreSiteTitle"
title="dependable">
<dependency step="purging" />
-
+
</import-step>
<import-step id="dependent"
version="1"
handler="Products.CMFSetup.tests.test_tool._uppercaseSiteTitle"
title="dependent">
<dependency step="dependable" />
-
+
</import-step>
<import-step id="purging"
version="1"
handler="Products.CMFSetup.tests.test_tool._purgeIfRequired"
title="purging">
-
+
</import-step>
</import-steps>
"""
@@ -934,7 +950,7 @@
tool_id="mandatory"
class="Products.CMFSetup.tests.test_tool.DummyTool" />
<required
- tool_id="obligatory"
+ tool_id="obligatory"
class="Products.CMFSetup.tests.test_tool.DummyTool" />
</tool-setup>
"""
=== CMF/CMFSetup/tests/test_typeinfo.py 1.8 => 1.9 ===
--- CMF/CMFSetup/tests/test_typeinfo.py:1.8 Mon Jul 19 14:11:37 2004
+++ CMF/CMFSetup/tests/test_typeinfo.py Fri Aug 6 04:20:06 2004
@@ -1,9 +1,24 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" Unit tests for type information export import
$Id$
"""
import unittest
+import Testing
+import Zope
+Zope.startup()
from OFS.Folder import Folder
from OFS.SimpleItem import SimpleItem
@@ -17,6 +32,7 @@
from common import BaseRegistryTests
from common import DummyExportContext
from common import DummyImportContext
+
class DummyTypeInfo( SimpleItem ):
=== CMF/CMFSetup/tests/test_utils.py 1.1 => 1.2 ===
--- CMF/CMFSetup/tests/test_utils.py:1.1 Fri May 14 09:22:43 2004
+++ CMF/CMFSetup/tests/test_utils.py Fri Aug 6 04:20:06 2004
@@ -1,9 +1,25 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
""" CMFSetup.utils unit tests
$Id$
"""
import unittest
+import Testing
+import Zope
+Zope.startup()
+
def _testFunc( *args, **kw ):
More information about the CMF-checkins
mailing list