[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests - __init__.py:1.1.4.1 testFolderAdder.py:1.1.4.1 testFolderContents.py:1.1.4.1 testLoadedFolderContents.py:1.1.4.1
Christian Theune
ct@gocept.com
Sat, 18 May 2002 13:02:27 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv3937/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests
Added Files:
Tag: Zope-3x-branch
__init__.py testFolderAdder.py testFolderContents.py
testLoadedFolderContents.py
Log Message:
Completing OFS.Folder -> OFS.Content.Folder by merging 'ctheune-foldermove-branch' into Zope-3x-branch
=== Added File Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests/__init__.py ===
##############################################################################
#
# 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.
#
##############################################################################
=== Added File Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests/testFolderAdder.py ===
##############################################################################
#
# 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: testFolderAdder.py,v 1.1.4.1 2002/05/18 17:02:25 ctheune Exp $
"""
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)
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')
=== Added File Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests/testFolderContents.py ===
##############################################################################
#
# 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)
def testAddServiceManager(self):
folder = Folder()
fc = FolderContents(folder)
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()
=== Added File Zope3/lib/python/Zope/App/OFS/Content/Folder/Views/Browser/tests/testLoadedFolderContents.py ===
##############################################################################
#
# 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)
def testAddServiceManager(self):
folder = LoadedFolder()
fc = LoadedFolderContents(folder)
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()