Skip to content

Commit

Permalink
Backported
Browse files Browse the repository at this point in the history
r26567 | srichter | 2004-07-16 02:58:27 -0400 (Fri, 16 Jul 2004) | 2 lines
r26570 | srichter | 2004-07-16 03:54:40 -0400 (Fri, 16 Jul 2004) | 3 lines
  • Loading branch information
strichter committed Aug 12, 2004
1 parent a1018b2 commit 54cf7f4
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
18 changes: 18 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Folder content component
$Id$
"""
from folder import Folder, rootFolder
68 changes: 68 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
##############################################################################
#
# 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.1 (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.
#
##############################################################################
"""Folder content component tests
$Id$
"""

from unittest import TestCase, TestSuite, main, makeSuite

from zope.testing.doctestunit import DocTestSuite

from zope.app.tests import ztapi
from zope.app.dublincore.interfaces import IZopeDublinCore
from zope.app.folder.interfaces import IFolder
from zope.app.dublincore.annotatableadapter import ZDCAnnotatableAdapter
from zope.app.site.tests.placefulsetup import PlacefulSetup
from zope.app.component.tests.test_servicemanagercontainer \
import BaseTestServiceManagerContainer
from zope.app.container.tests.test_icontainer import BaseTestIContainer
from zope.app.container.tests.test_icontainer import DefaultTestData


class Test(BaseTestIContainer, BaseTestServiceManagerContainer, TestCase):

def makeTestObject(self):
from zope.app.folder import Folder
return Folder()

def makeTestData(self):
return DefaultTestData()

def getUnknownKey(self):
return '10'

def getBadKeyTypes(self):
return [None, ['foo'], 1, '\xf3abc']


class FolderMetaDataTest(PlacefulSetup, TestCase):

def setUp(self):
PlacefulSetup.setUp(self)
PlacefulSetup.buildFolders(self)
ztapi.provideAdapter(IFolder, IZopeDublinCore, ZDCAnnotatableAdapter)

def test_suite():
from zope.testing.doctestunit import DocTestSuite
from zope.app.tests.placelesssetup import setUp, tearDown
return TestSuite((
makeSuite(Test),
makeSuite(FolderMetaDataTest),
DocTestSuite('zope.app.folder.folder',
setUp=setUp, tearDown=tearDown),
))

if __name__=='__main__':
main(defaultTest='test_suite')

0 comments on commit 54cf7f4

Please sign in to comment.