Commit 2346e30c authored by Guido van Rossum's avatar Guido van Rossum

Enforce the rule that unit tests have no docstrings.

Reduced the size of the password in testLongPassword() so that that
test doesn't take a minute or more.
parent 06566737
......@@ -21,7 +21,7 @@ class ClassSecurityInfoTests(unittest.TestCase):
def testSetPermissionDefault(self):
"""Test setting default roles for permissions."""
# Test setting default roles for permissions.
# Setup a test class with default role -> permission decls.
class Test(Folder):
......
......@@ -16,8 +16,8 @@ To be removed together with the API in due time.
"""
__rcs_id__='$Id: testDeprecatedAPI.py,v 1.4 2002/08/14 21:28:08 mj Exp $'
__version__='$Revision: 1.4 $'[11:-2]
__rcs_id__='$Id: testDeprecatedAPI.py,v 1.5 2003/01/27 22:55:27 gvanrossum Exp $'
__version__='$Revision: 1.5 $'[11:-2]
import ZODB # Sigh. Persistent needs to be set, so we import ZODB.
from AccessControl import User
......@@ -30,7 +30,7 @@ class DeprecatedAPI(unittest.TestCase):
module='AccessControl')
def testDeprecatedHasRole(self):
"""hasRole has been deprecated, we expect a warning."""
# hasRole has been deprecated, we expect a warning.
try:
self.userObject.hasRole(None)
except DeprecationWarning:
......@@ -39,7 +39,7 @@ class DeprecatedAPI(unittest.TestCase):
self.fail('Expected DeprecationWarning, none given')
def testAllowed(self):
"""hasRole is an alias for allowed, which should be unaffected."""
# hasRole is an alias for allowed, which should be unaffected.
try:
self.userObject.allowed(None)
except DeprecationWarning:
......
......@@ -13,8 +13,8 @@
"""Test of AuthEncoding
"""
__rcs_id__='$Id: testPasswordDigest.py,v 1.4 2002/08/14 21:28:08 mj Exp $'
__version__='$Revision: 1.4 $'[11:-2]
__rcs_id__='$Id: testPasswordDigest.py,v 1.5 2003/01/27 22:55:27 gvanrossum Exp $'
__version__='$Revision: 1.5 $'[11:-2]
import os, sys, unittest
......@@ -57,7 +57,7 @@ class PasswordDigestTests (unittest.TestCase):
assert not AuthEncoding.pw_validate(enc, 'xxx')
def testLongPassword(self):
pw = 'Pw' * 10000
pw = 'Pw' * 2000
for id in AuthEncoding.listSchemes():
enc = AuthEncoding.pw_encrypt(pw, id)
assert enc != pw
......
......@@ -13,8 +13,8 @@
"""Document Template Tests
"""
__rcs_id__='$Id: testSecurity.py,v 1.10 2002/08/14 21:28:08 mj Exp $'
__version__='$Revision: 1.10 $'[11:-2]
__rcs_id__='$Id: testSecurity.py,v 1.11 2003/01/27 22:55:27 gvanrossum Exp $'
__version__='$Revision: 1.11 $'[11:-2]
import os, sys, unittest
......@@ -59,10 +59,8 @@ class SecurityTests (DTMLTests):
self.failUnlessRaises(Unauthorized, html, myinst=myclass())
def testSecurityInSyntax(self):
'''
Ensures syntax errors are thrown for an expr with restricted
syntax.
'''
# Ensures syntax errors are thrown for an expr with restricted
# syntax.
expr = '<dtml-var expr="(lambda x, _read=(lambda ob:ob): x.y)(c)">'
try:
# This would be a security hole.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment