[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests - __init__.py:1.2 testFolderAdder.py:1.2 testFolderContents.py:1.2 testLoadedFolderContents.py:1.2
Jim Fulton
jim@zope.com
Mon, 10 Jun 2002 19:28:32 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv17445/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests
Added Files:
__init__.py testFolderAdder.py testFolderContents.py
testLoadedFolderContents.py
Log Message:
Merged Zope-3x-branch into newly forked Zope3 CVS Tree.
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests/__init__.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 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.
+#
+##############################################################################
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests/testFolderAdder.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 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.
+#
+##############################################################################
+"""
+
+Revision information:
+$Id$
+"""
+
+from unittest import TestCase, TestSuite, main, makeSuite
+from Zope.App.OFS.Container.Views.Browser.tests.AdderBaseTests \
+ import BaseRegistryTest, BaseAddingTest
+from Zope.ComponentArchitecture import getServiceManager, getService
+from Zope.App.OFS.Services.AddableService.tests.AddableSetup import \
+ AddableSetup
+class Methods (AddableSetup):
+ # Supply the methods needed by the bases.
+
+ def setUp(self):
+ AddableSetup.setUp(self)
+ self.buildFolders()
+ self.createServiceManager()
+
+ def _TestView__newContext(self):
+ return getServiceManager(self.rootFolder)
+
+ def _TestView__newView(self, container):
+ from Zope.App.OFS.Content.Folder.Views.Browser.FolderAdder \
+ import FolderAdder
+ return FolderAdder(container, None)
+
+ def _TestAdderView__registry(self):
+ return 'AddableContent'
+
+
+class RegistryTest(Methods, BaseRegistryTest, TestCase): pass
+class AddingTest(Methods, BaseAddingTest, TestCase):
+ def setUp(self):
+ Methods.setUp(self)
+ self.buildFolders()
+ self.createServiceManager()
+ BaseAddingTest.setUp(self)
+
+def test_suite():
+ return TestSuite([makeSuite(RegistryTest),
+ makeSuite(AddingTest),
+ ])
+
+if __name__=='__main__':
+ main(defaultTest='test_suite')
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests/testFolderContents.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 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.
+#
+##############################################################################
+import unittest
+
+from Zope.App.OFS.Content.Folder.Views.Browser.FolderContents import FolderContents
+from Zope.App.OFS.Content.Folder.Folder import Folder
+from Zope.App.OFS.Container.Views.Browser.tests.testContents \
+ import BaseTestContentsBrowserView
+
+class Test(BaseTestContentsBrowserView, unittest.TestCase):
+
+ def _TestView__newContext(self):
+ return Folder()
+
+ def _TestView__newView(self, container):
+ return FolderContents(container, None)
+
+ def testAddServiceManager(self):
+ folder = Folder()
+ fc = FolderContents(folder, None)
+ fc.addServiceManager()
+ self.failUnless(folder.hasServiceManager())
+ self.assertRaises('HasServiceManager', fc.addServiceManager)
+
+def test_suite():
+ loader = unittest.TestLoader()
+ return loader.loadTestsFromTestCase( Test )
+
+if __name__=='__main__':
+ unittest.main()
=== Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests/testLoadedFolderContents.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 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.
+#
+##############################################################################
+import unittest
+
+from Zope.App.OFS.Content.Folder.Views.Browser.LoadedFolderContents import \
+ LoadedFolderContents
+from Zope.App.OFS.Content.Folder.LoadedFolder import LoadedFolder
+from Zope.App.OFS.Container.Views.Browser.tests.testContents \
+ import BaseTestContentsBrowserView
+
+class Test(BaseTestContentsBrowserView, unittest.TestCase):
+
+ def _TestView__newContext(self):
+ return LoadedFolder()
+
+ def _TestView__newView(self, container):
+ return LoadedFolderContents(container, None)
+
+ def testAddServiceManager(self):
+ folder = LoadedFolder()
+ fc = LoadedFolderContents(folder, None)
+ fc.addServiceManager()
+ self.failUnless(folder.hasServiceManager())
+ self.assertRaises('HasServiceManager', fc.addServiceManager)
+
+def test_suite():
+ loader = unittest.TestLoader()
+ return loader.loadTestsFromTestCase( Test )
+
+if __name__=='__main__':
+ unittest.main()