Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
2ae3d5c1
Commit
2ae3d5c1
authored
Jul 31, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the ifmain blocks from tests
parent
a172bbeb
Changes
68
Hide whitespace changes
Inline
Side-by-side
Showing
68 changed files
with
13 additions
and
550 deletions
+13
-550
src/App/tests/testManagement.py
src/App/tests/testManagement.py
+0
-3
src/App/tests/testPersistentExtra.py
src/App/tests/testPersistentExtra.py
+0
-3
src/App/tests/testUndo.py
src/App/tests/testUndo.py
+0
-3
src/App/tests/test_class_init.py
src/App/tests/test_class_init.py
+0
-3
src/OFS/DefaultObservable.py
src/OFS/DefaultObservable.py
+0
-98
src/OFS/tests/testAcquisition.py
src/OFS/tests/testAcquisition.py
+0
-4
src/OFS/tests/testAppInitializer.py
src/OFS/tests/testAppInitializer.py
+0
-6
src/OFS/tests/testApplication.py
src/OFS/tests/testApplication.py
+0
-3
src/OFS/tests/testCopySupport.py
src/OFS/tests/testCopySupport.py
+0
-4
src/OFS/tests/testFTPInterface.py
src/OFS/tests/testFTPInterface.py
+0
-3
src/OFS/tests/testFileAndImage.py
src/OFS/tests/testFileAndImage.py
+0
-4
src/OFS/tests/testFindSupport.py
src/OFS/tests/testFindSupport.py
+0
-3
src/OFS/tests/testFolder.py
src/OFS/tests/testFolder.py
+0
-3
src/OFS/tests/testObjectManager.py
src/OFS/tests/testObjectManager.py
+0
-3
src/OFS/tests/testOrderSupport.py
src/OFS/tests/testOrderSupport.py
+0
-3
src/OFS/tests/testOrderedFolder.py
src/OFS/tests/testOrderedFolder.py
+0
-3
src/OFS/tests/testProperties.py
src/OFS/tests/testProperties.py
+0
-3
src/OFS/tests/testRanges.py
src/OFS/tests/testRanges.py
+0
-6
src/OFS/tests/testSimpleItem.py
src/OFS/tests/testSimpleItem.py
+0
-3
src/OFS/tests/testTraverse.py
src/OFS/tests/testTraverse.py
+0
-8
src/OFS/tests/test_DTMLDocument.py
src/OFS/tests/test_DTMLDocument.py
+0
-3
src/OFS/tests/test_DTMLMethod.py
src/OFS/tests/test_DTMLMethod.py
+0
-3
src/OFS/tests/test_Uninstalled.py
src/OFS/tests/test_Uninstalled.py
+0
-3
src/OFS/tests/test_XMLExportImport.py
src/OFS/tests/test_XMLExportImport.py
+0
-3
src/Products/Five/component/tests.py
src/Products/Five/component/tests.py
+0
-4
src/Products/Five/viewlet/tests.py
src/Products/Five/viewlet/tests.py
+0
-3
src/Products/PageTemplates/tests/run.py
src/Products/PageTemplates/tests/run.py
+0
-14
src/Products/PageTemplates/tests/testDTMLTests.py
src/Products/PageTemplates/tests/testDTMLTests.py
+0
-3
src/Products/PageTemplates/tests/testZRPythonExpr.py
src/Products/PageTemplates/tests/testZRPythonExpr.py
+0
-4
src/Products/PageTemplates/tests/testZopePageTemplate.py
src/Products/PageTemplates/tests/testZopePageTemplate.py
+0
-4
src/Products/PageTemplates/tests/test_ptfile.py
src/Products/PageTemplates/tests/test_ptfile.py
+0
-3
src/Products/Sessions/stresstests/stresstestMultiThread.py
src/Products/Sessions/stresstests/stresstestMultiThread.py
+7
-24
src/Products/SiteErrorLog/tests/testSiteErrorLog.py
src/Products/SiteErrorLog/tests/testSiteErrorLog.py
+0
-4
src/Products/ZReST/tests/test_ZReST.py
src/Products/ZReST/tests/test_ZReST.py
+0
-3
src/Shared/DC/xml/ppml.py
src/Shared/DC/xml/ppml.py
+0
-99
src/Shared/DC/xml/xyap.py
src/Shared/DC/xml/xyap.py
+0
-56
src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt
src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt
+0
-7
src/Testing/ZopeTestCase/zopedoctest/ZopeDocTest.txt
src/Testing/ZopeTestCase/zopedoctest/ZopeDocTest.txt
+0
-7
src/Testing/common.py
src/Testing/common.py
+0
-13
src/Testing/tests/test_makerequest.py
src/Testing/tests/test_makerequest.py
+0
-3
src/ZPublisher/tests/testBaseRequest.py
src/ZPublisher/tests/testBaseRequest.py
+0
-3
src/ZPublisher/tests/testHTTPRangeSupport.py
src/ZPublisher/tests/testHTTPRangeSupport.py
+0
-6
src/ZPublisher/tests/testHTTPRequest.py
src/ZPublisher/tests/testHTTPRequest.py
+0
-3
src/ZPublisher/tests/testIterators.py
src/ZPublisher/tests/testIterators.py
+0
-6
src/ZPublisher/tests/testPostTraversal.py
src/ZPublisher/tests/testPostTraversal.py
+0
-3
src/ZPublisher/tests/test_Converters.py
src/ZPublisher/tests/test_Converters.py
+0
-4
src/ZPublisher/tests/test_exception_handling.py
src/ZPublisher/tests/test_exception_handling.py
+0
-3
src/ZPublisher/tests/test_xmlrpc.py
src/ZPublisher/tests/test_xmlrpc.py
+0
-3
src/ZServer/tests/test_clockserver.py
src/ZServer/tests/test_clockserver.py
+3
-5
src/ZServer/tests/test_config.py
src/ZServer/tests/test_config.py
+0
-3
src/ZServer/tests/test_responses.py
src/ZServer/tests/test_responses.py
+0
-3
src/ZTUtils/tests/run.py
src/ZTUtils/tests/run.py
+0
-18
src/ZTUtils/tests/testBatch.py
src/ZTUtils/tests/testBatch.py
+1
-7
src/ZTUtils/tests/testTree.py
src/ZTUtils/tests/testTree.py
+1
-4
src/ZTUtils/tests/testZope.py
src/ZTUtils/tests/testZope.py
+1
-7
src/Zope2/App/tests/testExceptionHook.py
src/Zope2/App/tests/testExceptionHook.py
+0
-3
src/Zope2/Startup/tests/testStarter.py
src/Zope2/Startup/tests/testStarter.py
+0
-3
src/Zope2/Startup/tests/test_schema.py
src/Zope2/Startup/tests/test_schema.py
+0
-3
src/Zope2/Startup/tests/test_warnfilter.py
src/Zope2/Startup/tests/test_warnfilter.py
+0
-3
src/webdav/tests/testCollection.py
src/webdav/tests/testCollection.py
+0
-3
src/webdav/tests/testEtagSupport.py
src/webdav/tests/testEtagSupport.py
+0
-3
src/webdav/tests/testLockItem.py
src/webdav/tests/testLockItem.py
+0
-3
src/webdav/tests/testLockable.py
src/webdav/tests/testLockable.py
+0
-3
src/webdav/tests/testNullResource.py
src/webdav/tests/testNullResource.py
+0
-3
src/webdav/tests/testPUT_factory.py
src/webdav/tests/testPUT_factory.py
+0
-3
src/webdav/tests/testResource.py
src/webdav/tests/testResource.py
+0
-3
src/webdav/tests/test_davcmds.py
src/webdav/tests/test_davcmds.py
+0
-4
src/webdav/tests/test_xmltools.py
src/webdav/tests/test_xmltools.py
+0
-3
No files found.
src/App/tests/testManagement.py
View file @
2ae3d5c1
...
...
@@ -15,6 +15,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestNavigation
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/App/tests/testPersistentExtra.py
View file @
2ae3d5c1
...
...
@@ -17,6 +17,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestPersistent
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/App/tests/testUndo.py
View file @
2ae3d5c1
...
...
@@ -15,6 +15,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestUndoSupport
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/App/tests/test_class_init.py
View file @
2ae3d5c1
...
...
@@ -38,6 +38,3 @@ def test_suite():
return
unittest
.
TestSuite
((
DocTestSuite
(),
))
if
__name__
==
'__main__'
:
unittest
.
main
()
src/OFS/DefaultObservable.py
View file @
2ae3d5c1
...
...
@@ -105,101 +105,3 @@ http://www.zope.org/Members/michel/Projects/Interfaces/ObserverAndNotification
self
.
_observers
.
remove
(
bozo
)
except
:
pass
#
# Unit tests
#
if
__name__
==
'__main__'
:
class
DontGoHere
(
Exception
):
pass
class
Idawanna
(
Exception
):
pass
class
TestSubject
(
DefaultObservable
):
def
__init__
(
self
,
paths
):
DefaultObservable
.
__init__
(
self
,
0
)
self
.
paths
=
paths
def
restrictedTraverse
(
self
,
path
,
default
):
return
self
.
paths
.
get
(
path
,
default
)
callbacks
=
{}
def
recordCallback
(
name
,
subject
,
event
):
cbrec
=
callbacks
.
get
(
name
,
None
)
if
cbrec
is
None
:
cbrec
=
callbacks
[
name
]
=
[]
cbrec
.
append
(
(
subject
,
event
)
)
class
TestObserver
:
def
__call__
(
self
,
subject
,
event
):
recordCallback
(
'direct'
,
subject
,
event
)
def
namedCallback
(
self
,
subject
,
event
):
recordCallback
(
'named'
,
subject
,
event
)
def
named2Callback
(
self
,
subject
,
event
):
recordCallback
(
'named2'
,
subject
,
event
)
def
boundCallback
(
self
,
subject
,
event
):
recordCallback
(
'bound'
,
subject
,
event
)
def
freefuncObserver
(
subject
,
event
):
recordCallback
(
'freefunc'
,
subject
,
event
)
def
tryVeto
(
subject
,
event
):
""" Simulate attempted veto. """
raise
Idawanna
observer
=
TestObserver
()
# Simulate Zope's path traversal mechanism.
paths
=
{}
paths
[
'direct'
]
=
observer
paths
[
'direct/named'
]
=
observer
.
namedCallback
paths
[
'direct/named2'
]
=
observer
.
named2Callback
paths
[
'bound'
]
=
observer
.
boundCallback
paths
[
'freefunc'
]
=
freefuncObserver
paths
[
'tryVeto'
]
=
tryVeto
subject
=
TestSubject
(
paths
)
subject
.
registerObserver
(
'direct'
)
subject
.
registerObserver
(
'bound'
)
subject
.
registerObserver
(
'direct/named'
)
subject
.
registerObserver
(
(
'direct'
,
'named2'
)
)
subject
.
registerObserver
(
'freefunc'
)
subject
.
registerObserver
(
'tryVeto'
)
try
:
subject
.
registerObserver
(
'nonesuch'
)
raise
DontGoHere
(
'path not found'
)
except
NameError
:
pass
except
:
import
traceback
traceback
.
print_exc
()
try
:
subject
.
registerObserver
(
3.1415926
)
raise
DontGoHere
(
'non-path'
)
except
TypeError
:
pass
except
:
import
traceback
traceback
.
print_exc
()
subject
.
notify
(
'First event'
)
subject
.
unregisterObserver
(
'bound'
)
subject
.
notify
(
{
'name'
:
'Second event'
,
'value'
:
42
}
)
for
key
in
callbacks
.
keys
():
print
'[%s]'
%
key
for
cb
in
callbacks
[
key
]:
print
' %s'
%
`cb`
src/OFS/tests/testAcquisition.py
View file @
2ae3d5c1
...
...
@@ -246,7 +246,3 @@ def test_suite():
suite
.
addTest
(
unittest
.
makeSuite
(
TestGetAttr_c
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestGetAttrAnonymous_c
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testAppInitializer.py
View file @
2ae3d5c1
...
...
@@ -219,9 +219,3 @@ def test_suite():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestInitialization
)
)
return
suite
def
main
():
unittest
.
main
(
defaultTest
=
'test_suite'
)
if
__name__
==
'__main__'
:
main
()
src/OFS/tests/testApplication.py
View file @
2ae3d5c1
...
...
@@ -109,6 +109,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
ApplicationTests
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testCopySupport.py
View file @
2ae3d5c1
import
unittest
import
Testing
import
cStringIO
...
...
@@ -526,6 +525,3 @@ def test_suite():
suite
.
addTest
(
unittest
.
makeSuite
(
TestCopySupport
)
)
suite
.
addTest
(
unittest
.
makeSuite
(
TestCopySupportSecurity
)
)
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testFTPInterface.py
View file @
2ae3d5c1
...
...
@@ -15,6 +15,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestFTPInterface
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testFileAndImage.py
View file @
2ae3d5c1
...
...
@@ -358,7 +358,3 @@ def test_suite():
unittest
.
makeSuite
(
FileTests
),
unittest
.
makeSuite
(
ImageTests
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testFindSupport.py
View file @
2ae3d5c1
...
...
@@ -15,6 +15,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestFindSupport
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testFolder.py
View file @
2ae3d5c1
...
...
@@ -17,6 +17,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestFolder
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testObjectManager.py
View file @
2ae3d5c1
...
...
@@ -461,6 +461,3 @@ def test_suite():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
ObjectManagerTests
)
)
return
suite
if
__name__
==
"__main__"
:
unittest
.
main
()
src/OFS/tests/testOrderSupport.py
View file @
2ae3d5c1
...
...
@@ -170,6 +170,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestOrderSupport
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testOrderedFolder.py
View file @
2ae3d5c1
...
...
@@ -19,6 +19,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestOrderedFolder
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testProperties.py
View file @
2ae3d5c1
...
...
@@ -160,6 +160,3 @@ def test_suite():
unittest
.
makeSuite
(
TestPropertyManager
),
unittest
.
makeSuite
(
TestPropertySheet
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testRanges.py
View file @
2ae3d5c1
...
...
@@ -358,9 +358,3 @@ def test_suite():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestRequestRange
)
)
return
suite
def
main
():
unittest
.
TextTestRunner
().
run
(
test_suite
())
if
__name__
==
'__main__'
:
main
()
src/OFS/tests/testSimpleItem.py
View file @
2ae3d5c1
...
...
@@ -120,6 +120,3 @@ def test_suite():
unittest
.
makeSuite
(
TestItem_w__name__
),
unittest
.
makeSuite
(
TestSimpleItem
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/testTraverse.py
View file @
2ae3d5c1
...
...
@@ -422,11 +422,6 @@ class TestTraverse( unittest.TestCase ):
self
.
folder1
.
unrestrictedTraverse
(
'+something'
)
is
'plus'
)
import
os
,
sys
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
class
SimpleClass
(
object
):
"""Class with no __bobo_traverse__."""
...
...
@@ -685,6 +680,3 @@ def test_suite():
from
Testing.ZopeTestCase
import
FunctionalDocTestSuite
suite
.
addTest
(
FunctionalDocTestSuite
()
)
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/test_DTMLDocument.py
View file @
2ae3d5c1
...
...
@@ -42,6 +42,3 @@ def test_suite():
unittest
.
makeSuite
(
DTMLDocumentTests
),
unittest
.
makeSuite
(
FactoryTests
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/test_DTMLMethod.py
View file @
2ae3d5c1
...
...
@@ -52,6 +52,3 @@ def test_suite():
unittest
.
makeSuite
(
DTMLMethodTests
),
unittest
.
makeSuite
(
FactoryTests
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/OFS/tests/test_Uninstalled.py
View file @
2ae3d5c1
...
...
@@ -151,6 +151,3 @@ def test_suite():
def
main
():
unittest
.
main
(
defaultTest
=
'test_suite'
)
if
__name__
==
'__main__'
:
main
()
src/OFS/tests/test_XMLExportImport.py
View file @
2ae3d5c1
...
...
@@ -194,6 +194,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
XMLExportImportTests
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/Products/Five/component/tests.py
View file @
2ae3d5c1
...
...
@@ -18,7 +18,6 @@ import unittest
from
doctest
import
DocFileSuite
from
Testing.ZopeTestCase
import
FunctionalDocFileSuite
__docformat__
=
"reStructuredText"
def
test_suite
():
return
unittest
.
TestSuite
([
...
...
@@ -26,6 +25,3 @@ def test_suite():
FunctionalDocFileSuite
(
'makesite.txt'
,
package
=
"Products.Five.component"
),
])
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/Products/Five/viewlet/tests.py
View file @
2ae3d5c1
...
...
@@ -79,6 +79,3 @@ def test_suite():
FunctionalDocFileSuite
(
'README.txt'
),
FunctionalDocFileSuite
(
'directives.txt'
),
])
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/Products/PageTemplates/tests/run.py
deleted
100755 → 0
View file @
a172bbeb
#!/usr/bin/env python
"""Run all tests."""
import
unittest
def
test_suite
():
suite
=
unittest
.
TestSuite
()
for
mname
in
(
'DTMLTests'
,
'HTMLTests'
,
'Expressions'
,
'TALES'
):
m
=
__import__
(
'test'
+
mname
)
suite
.
addTest
(
m
.
test_suite
())
return
suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/Products/PageTemplates/tests/testDTMLTests.py
View file @
2ae3d5c1
...
...
@@ -188,6 +188,3 @@ class DTMLTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
def
test_suite
():
return
unittest
.
makeSuite
(
DTMLTests
,
'check'
)
if
__name__
==
'__main__'
:
main
()
src/Products/PageTemplates/tests/testZRPythonExpr.py
View file @
2ae3d5c1
...
...
@@ -54,7 +54,3 @@ class MiscTests(unittest.TestCase):
def
test_suite
():
return
unittest
.
makeSuite
(
MiscTests
)
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/Products/PageTemplates/tests/testZopePageTemplate.py
View file @
2ae3d5c1
...
...
@@ -502,7 +502,3 @@ def test_suite():
suite
.
addTests
(
unittest
.
makeSuite
(
ZPTUnicodeEncodingConflictResolution
))
suite
.
addTests
(
unittest
.
makeSuite
(
PreferredCharsetUnicodeResolverTests
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/Products/PageTemplates/tests/test_ptfile.py
View file @
2ae3d5c1
...
...
@@ -215,6 +215,3 @@ def test_suite():
unittest
.
makeSuite
(
LineEndingsTestCase
),
unittest
.
makeSuite
(
LazyLoadingTestCase
),
))
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
src/Products/Sessions/stresstests/stresstestMultiThread.py
View file @
2ae3d5c1
...
...
@@ -10,39 +10,26 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
import
sys
,
os
,
time
if
__name__
==
"__main__"
:
sys
.
path
.
insert
(
0
,
'../../..'
)
#os.chdir('../../..')
import
time
from
Testing
import
makerequest
import
ZODB
# in order to get Persistence.Persistent working
import
transaction
import
Acquisition
from
Acquisition
import
aq_base
from
Products.Sessions.BrowserIdManager
import
BrowserIdManager
,
\
getNewBrowserId
from
Products.Sessions.SessionDataManager
import
\
SessionDataManager
,
SessionDataManagerErr
SessionDataManager
from
Products.Transience.Transience
import
\
TransientObjectContainer
,
TransientObject
TransientObjectContainer
from
Products.TemporaryFolder.TemporaryFolder
import
MountedTemporaryFolder
from
Products.TemporaryFolder.LowConflictConnection
import
\
LowConflictConnection
from
ZODB.Connection
import
Connection
from
ZODB.POSException
import
InvalidObjectReference
,
ConflictError
,
\
from
ZODB.POSException
import
ConflictError
,
\
ReadConflictError
,
BTreesConflictError
from
DateTime
import
DateTime
from
unittest
import
TestCase
,
TestSuite
,
TextTestRunner
,
makeSuite
import
time
,
threading
,
random
from
cPickle
import
UnpickleableError
from
unittest
import
TestCase
,
TestSuite
,
makeSuite
import
threading
,
random
from
ZODB.DemoStorage
import
DemoStorage
from
tempstorage.TemporaryStorage
import
TemporaryStorage
from
OFS.Application
import
Application
from
OFS.Folder
import
Folder
import
sys
import
time
import
traceback
sys
.
setcheckinterval
(
200
)
from
Products.Transience.tests
import
fauxtime
import
Products.Transience.Transience
...
...
@@ -261,7 +248,3 @@ def test_suite():
test_multithread
=
makeSuite
(
TestMultiThread
,
'test'
)
suite
=
TestSuite
((
test_multithread
,))
return
suite
if
__name__
==
'__main__'
:
runner
=
TextTestRunner
(
verbosity
=
9
,
descriptions
=
9
)
runner
.
run
(
test_suite
())
src/Products/SiteErrorLog/tests/testSiteErrorLog.py
View file @
2ae3d5c1
...
...
@@ -152,7 +152,3 @@ def test_suite():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
SiteErrorLogTests
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/Products/ZReST/tests/test_ZReST.py
View file @
2ae3d5c1
...
...
@@ -145,6 +145,3 @@ def test_suite():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestZReST
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultSuite
=
'test_suite'
)
src/Shared/DC/xml/ppml.py
View file @
2ae3d5c1
...
...
@@ -595,102 +595,3 @@ class xmlPickler(NoBlanks, xyap):
'persistent'
:
save_persis
,
'unicode'
:
save_unicode
,
}
# The rest is used for testing only
class
C
:
def
__cmp__
(
self
,
other
):
return
cmp
(
self
.
__dict__
,
other
.
__dict__
)
def
test
():
import
xmllib
import
pickle
c
=
C
()
c
.
foo
=
1
c
.
bar
=
2
x
=
[
0
,
1
,
2
,
3
]
y
=
(
'abc'
,
'abc'
,
c
,
c
)
x
.
append
(
y
)
x
.
append
(
y
)
t
=
()
l
=
[]
s
=
''
L
=
long
(
'999999999999'
)
x
.
append
(
t
)
x
.
append
(
l
)
x
.
append
(
s
)
x
.
append
(
L
)
x
.
append
(
55555
)
x
.
append
(
13
)
r
=
[
x
]
print
x
f
=
pickle
.
dumps
(
x
)
print
f
r
.
append
(
f
)
q
=
ToXMLloads
(
f
)
q
=
str
(
q
)
q
=
'<?xml version="1.0"?>
\
n
'
+
q
print
q
r
.
append
(
q
)
F
=
xmlPickler
()
F
.
binary
=
1
p
=
xmllib
.
XMLParser
()
p
.
start_handlers
=
F
.
start_handlers
p
.
end_handlers
=
F
.
end_handlers
p
.
handle_data
=
F
.
handle_data
p
.
unknown_starttag
=
F
.
unknown_starttag
p
.
unknown_endtag
=
F
.
unknown_endtag
p
.
_stack
=
F
.
_stack
p
.
push
=
F
.
push
p
.
append
=
F
.
append
data
=
q
.
split
(
'
\
n
'
)
for
l
in
data
:
p
.
feed
(
l
)
p
.
close
()
z
=
p
.
_stack
z
=
z
[
0
][
0
]
print
z
,
'
\
n
'
r
.
append
(
z
)
l
=
pickle
.
loads
(
z
)
print
l
,
'
\
n
'
r
.
append
(
l
)
def
test1
():
import
xml.parsers.expat
import
pickle
c
=
C
()
c
.
foo
=
1
c
.
bar
=
2
x
=
[
0
,
1
,
2
,
3
]
y
=
(
'abc'
,
'abc'
,
c
,
c
)
x
.
append
(
y
)
x
.
append
(
y
)
t
=
()
l
=
[]
s
=
''
L
=
long
(
'999999999999'
)
x
.
append
(
t
)
x
.
append
(
l
)
x
.
append
(
s
)
x
.
append
(
L
)
x
.
append
(
5
)
x
.
append
(
13
)
print
x
,
'
\
n
'
f
=
pickle
.
dumps
(
x
)
print
f
,
'
\
n
'
q
=
ToXMLloads
(
f
)
q
=
str
(
q
)
q
=
'<?xml version="1.0"?>
\
n
'
+
q
print
q
,
'
\
n
'
F
=
xmlPickler
()
F
.
binary
=
0
p
=
xml
.
parsers
.
expat
.
ParserCreate
()
p
.
CharacterDataHandler
=
F
.
handle_data
p
.
StartElementHandler
=
F
.
unknown_starttag
p
.
EndElementHandler
=
F
.
unknown_endtag
r
=
p
.
Parse
(
q
)
print
r
,
'
\
n
'
if
__name__
==
'__main__'
:
test
()
src/Shared/DC/xml/xyap.py
View file @
2ae3d5c1
...
...
@@ -22,8 +22,6 @@ Oh well.
import
string
import
xml.parsers.expat
from
pickle
import
*
class
xyap
:
start_handlers
=
{}
...
...
@@ -117,57 +115,3 @@ class xmlrpc(NoBlanks, XYap):
'array'
:
lambda
self
,
tag
,
data
:
data
[
2
],
'data'
:
lambda
self
,
tag
,
data
:
data
[
2
:],
}
def
test
():
data
=
"""<?xml version="1.0"?>
<methodCall>
<methodName>examples.getStateName
</methodName>
<params>
<param>
<value><i4>41</i4></value>
</param>
<param><value>
<struct>
<member>
<name>lowerBound</name>
<value><i4>18</i4></value>
</member>
<member>
<name>upperBound</name>
<value><i4>139</i4></value>
</member>
</struct></value>
</param>
<param><value>
<array>
<data>
<value><i4>12</i4></value>
<value><string>Egypt</string></value>
<value><boolean>0</boolean></value>
<value><i4>-31</i4></value>
</data>
</array></value>
</param>
</params>
</methodCall>
"""
data
=
data
.
split
(
'
\
n
'
)
r
=
[]
for
C
in
XYap
,
xmlrpc
:
p
=
C
()
for
l
in
data
:
p
.
feed
(
l
)
p
.
close
()
r
.
append
(
p
.
_stack
)
return
r
if
__name__
==
'__main__'
:
print
test
()
src/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt
View file @
2ae3d5c1
...
...
@@ -56,10 +56,6 @@ and turn them into tests:
``FunctionalDocFileSuite`` and instantiate it, passing the name of the
text file containing the test. For example:
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
from unittest import TestSuite
from Testing.ZopeTestCase import FunctionalDocFileSuite
...
...
@@ -68,9 +64,6 @@ and turn them into tests:
FunctionalDocFileSuite('FunctionalDocTest.txt'),
))
if __name__ == '__main__':
framework()
Examples
--------
...
...
src/Testing/ZopeTestCase/zopedoctest/ZopeDocTest.txt
View file @
2ae3d5c1
...
...
@@ -26,10 +26,6 @@ infrastructure to set up the necessary environment.
passing the name of the text file containing the tests.
For example:
import os, sys
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
from unittest import TestSuite
from Testing.ZopeTestCase import ZopeDocFileSuite
...
...
@@ -38,9 +34,6 @@ infrastructure to set up the necessary environment.
ZopeDocFileSuite('ZopeDocTest.txt'),
))
if __name__ == '__main__':
framework()
Examples
--------
...
...
src/Testing/common.py
View file @
2ae3d5c1
...
...
@@ -2,14 +2,6 @@
import
unittest
TestRunner
=
unittest
.
TextTestRunner
def
framework
():
if
__name__
!=
'__main__'
:
return
if
len
(
sys
.
argv
)
>
1
:
errs
=
globals
()[
sys
.
argv
[
1
]]()
else
:
errs
=
TestRunner
().
run
(
test_suite
())
sys
.
exit
(
errs
and
1
or
0
)
def
debug
():
test_suite
().
debug
()
...
...
@@ -41,8 +33,3 @@ class Dummy:
return
'Dummy(%s)'
%
`self.__dict__`
__repr__
=
__str__
def
Testing_file
(
*
args
):
dir
=
os
.
path
.
split
(
Testing
.
__file__
)[
0
]
return
apply
(
os
.
path
.
join
,
(
dir
,)
+
args
)
src/Testing/tests/test_makerequest.py
View file @
2ae3d5c1
...
...
@@ -62,6 +62,3 @@ def test_suite():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
MakerequestTests
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
TextTestRunner
().
run
(
test_suite
())
src/ZPublisher/tests/testBaseRequest.py
View file @
2ae3d5c1
...
...
@@ -705,6 +705,3 @@ def test_suite():
unittest
.
makeSuite
(
TestBaseRequest
),
unittest
.
makeSuite
(
TestBaseRequestZope3Views
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/ZPublisher/tests/testHTTPRangeSupport.py
View file @
2ae3d5c1
...
...
@@ -136,9 +136,3 @@ def debug():
def
pdebug
():
import
pdb
pdb
.
run
(
'debug()'
)
if
__name__
==
'__main__'
:
if
len
(
sys
.
argv
)
>
1
:
globals
()[
sys
.
argv
[
1
]]()
else
:
main
()
src/ZPublisher/tests/testHTTPRequest.py
View file @
2ae3d5c1
...
...
@@ -1068,6 +1068,3 @@ def test_suite():
suite
.
addTest
(
unittest
.
makeSuite
(
RecordTests
))
suite
.
addTest
(
unittest
.
makeSuite
(
HTTPRequestTests
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/ZPublisher/tests/testIterators.py
View file @
2ae3d5c1
...
...
@@ -10,9 +10,3 @@ def test_suite():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestFileStreamIterator
)
)
return
suite
def
main
():
unittest
.
main
(
defaultTest
=
'test_suite'
)
if
__name__
==
'__main__'
:
main
()
src/ZPublisher/tests/testPostTraversal.py
View file @
2ae3d5c1
...
...
@@ -137,6 +137,3 @@ class TestBaseRequestPT(TestCase):
def
test_suite
():
return
TestSuite
(
(
makeSuite
(
TestBaseRequestPT
),
)
)
if
__name__
==
'__main__'
:
main
(
defaultTest
=
'test_suite'
)
src/ZPublisher/tests/test_Converters.py
View file @
2ae3d5c1
...
...
@@ -110,9 +110,5 @@ class ConvertersTests(unittest.TestCase):
self
.
assertEqual
(
field2ulines
(
to_convert
),
to_convert
.
splitlines
())
def
test_suite
():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
ConvertersTests
),))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/ZPublisher/tests/test_exception_handling.py
View file @
2ae3d5c1
...
...
@@ -45,6 +45,3 @@ def test_suite():
'ExceptionRaiser2'
:
ExceptionRaiser2
,
'ExceptionRaiser3'
:
ExceptionRaiser3
,}),
])
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/ZPublisher/tests/test_xmlrpc.py
View file @
2ae3d5c1
...
...
@@ -212,6 +212,3 @@ class XMLRPCResponseTests(unittest.TestCase):
def
test_suite
():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
XMLRPCResponseTests
),))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/ZServer/tests/test_clockserver.py
View file @
2ae3d5c1
import
unittest
import
time
from
StringIO
import
StringIO
from
ZServer
import
ClockServer
class
DummyLogger
:
def
__init__
(
self
):
self
.
L
=
[]
...
...
@@ -14,6 +14,7 @@ class DummyLogger:
def
read
(
self
):
return
' '
.
join
(
self
.
L
)
class
LogHelperTests
(
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
return
ClockServer
.
LogHelper
...
...
@@ -22,13 +23,13 @@ class LogHelperTests(unittest.TestCase):
return
self
.
_getTargetClass
()(
*
arg
,
**
kw
)
def
test_helper
(
self
):
from
StringIO
import
StringIO
logger
=
DummyLogger
()
helper
=
self
.
_makeOne
(
logger
)
self
.
assertEqual
(
helper
.
logger
,
logger
)
logger
.
log
(
'ip'
,
'msg'
,
foo
=
1
,
bar
=
2
)
self
.
assertEqual
(
logger
.
read
(),
'ip msg'
)
class
ClockServerTests
(
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
return
ClockServer
.
ClockServer
...
...
@@ -151,6 +152,3 @@ def test_suite():
suite
=
unittest
.
makeSuite
(
ClockServerTests
)
suite
.
addTest
(
unittest
.
makeSuite
(
LogHelperTests
))
return
suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
src/ZServer/tests/test_config.py
View file @
2ae3d5c1
...
...
@@ -293,6 +293,3 @@ def test_suite():
suite
=
unittest
.
makeSuite
(
ZServerConfigurationTestCase
)
suite
.
addTest
(
unittest
.
makeSuite
(
MonitorServerConfigurationTestCase
))
return
suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
src/ZServer/tests/test_responses.py
View file @
2ae3d5c1
...
...
@@ -308,6 +308,3 @@ def test_suite():
unittest
.
makeSuite
(
ZServerHTTPResponseEventsTestCase
)
))
return
suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
src/ZTUtils/tests/run.py
deleted
100755 → 0
View file @
a172bbeb
#!/usr/bin/env python
"""Run all tests."""
import
unittest
import
glob
import
os
import
sys
def
test_suite
():
suite
=
unittest
.
TestSuite
()
for
mname
in
glob
.
glob
(
os
.
path
.
join
(
sys
.
path
[
0
],
'test*.py'
)):
mname
=
os
.
path
.
split
(
mname
)[
1
][:
-
3
]
m
=
__import__
(
mname
)
suite
.
addTest
(
m
.
test_suite
())
return
suite
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/ZTUtils/tests/testBatch.py
View file @
2ae3d5c1
import
os
,
sys
from
unittest
import
TestCase
,
makeSuite
from
unittest
import
TestCase
,
makeSuite
,
main
import
string
from
ZTUtils
import
Batch
class
BatchTests
(
TestCase
):
...
...
@@ -50,6 +47,3 @@ class BatchTests(TestCase):
def
test_suite
():
return
makeSuite
(
BatchTests
)
if
__name__
==
'__main__'
:
main
()
src/ZTUtils/tests/testTree.py
View file @
2ae3d5c1
...
...
@@ -214,7 +214,7 @@ class TreeTests(unittest.TestCase):
def
testDecodeDecompressedSizeLimit
(
self
):
import
zlib
from
ZTUtils.Tree
import
b2a
,
a2b
,
encodeExpansion
,
decodeExpansion
from
ZTUtils.Tree
import
b2a
big
=
b2a
(
zlib
.
compress
(
'x'
*
(
1024
*
1100
)))
self
.
assert_
(
len
(
big
)
<
8192
)
# Must be under the input size limit
self
.
assertRaises
(
ValueError
,
Tree
.
decodeExpansion
,
':'
+
big
)
...
...
@@ -222,6 +222,3 @@ class TreeTests(unittest.TestCase):
def
test_suite
():
return
unittest
.
makeSuite
(
TreeTests
)
if
__name__
==
'__main__'
:
unittest
.
main
()
src/ZTUtils/tests/testZope.py
View file @
2ae3d5c1
import
os
,
sys
from
unittest
import
TestCase
,
makeSuite
from
unittest
import
TestCase
,
makeSuite
,
main
import
string
import
urllib
from
ZTUtils.Zope
import
make_query
,
complex_marshal
from
ZTUtils.Zope
import
make_hidden_input
...
...
@@ -66,6 +63,3 @@ class QueryTests(TestCase):
def
test_suite
():
return
makeSuite
(
QueryTests
)
if
__name__
==
'__main__'
:
main
()
src/Zope2/App/tests/testExceptionHook.py
View file @
2ae3d5c1
...
...
@@ -411,6 +411,3 @@ def test_suite():
suite
.
addTest
(
unittest
.
makeSuite
(
ExceptionMessageRenderTest
))
suite
.
addTest
(
unittest
.
makeSuite
(
ExceptionViewsTest
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/Zope2/Startup/tests/testStarter.py
View file @
2ae3d5c1
...
...
@@ -397,6 +397,3 @@ class ZopeStarterTestCase(test_logger.LoggingTestBase):
def
test_suite
():
return
unittest
.
makeSuite
(
ZopeStarterTestCase
)
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
src/Zope2/Startup/tests/test_schema.py
View file @
2ae3d5c1
...
...
@@ -223,6 +223,3 @@ class StartupTestCase(unittest.TestCase):
def
test_suite
():
return
unittest
.
makeSuite
(
StartupTestCase
)
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
src/Zope2/Startup/tests/test_warnfilter.py
View file @
2ae3d5c1
...
...
@@ -125,6 +125,3 @@ class TestWarnFilter(unittest.TestCase):
def
test_suite
():
return
unittest
.
makeSuite
(
TestWarnFilter
)
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
src/webdav/tests/testCollection.py
View file @
2ae3d5c1
...
...
@@ -15,6 +15,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestCollection
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/webdav/tests/testEtagSupport.py
View file @
2ae3d5c1
...
...
@@ -15,6 +15,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestEtagSupport
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/webdav/tests/testLockItem.py
View file @
2ae3d5c1
...
...
@@ -14,6 +14,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestLockItem
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/webdav/tests/testLockable.py
View file @
2ae3d5c1
...
...
@@ -34,6 +34,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestUtilFunctions
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/webdav/tests/testNullResource.py
View file @
2ae3d5c1
...
...
@@ -81,6 +81,3 @@ def test_suite():
unittest
.
makeSuite
(
TestLockNullResource
),
unittest
.
makeSuite
(
TestNullResource
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/webdav/tests/testPUT_factory.py
View file @
2ae3d5c1
...
...
@@ -90,6 +90,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestPUTFactory
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/webdav/tests/testResource.py
View file @
2ae3d5c1
...
...
@@ -282,6 +282,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestResource
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/webdav/tests/test_davcmds.py
View file @
2ae3d5c1
...
...
@@ -84,7 +84,3 @@ def test_suite():
unittest
.
makeSuite
(
TestUnlock
),
unittest
.
makeSuite
(
TestPropPatch
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
src/webdav/tests/test_xmltools.py
View file @
2ae3d5c1
...
...
@@ -31,6 +31,3 @@ def test_suite():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
TestNode
),
))
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment