Commit aa22e7a2 authored by Hanno Schlichting's avatar Hanno Schlichting

more test cleanup

parent 8cd374c3
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# FOR A PARTICULAR PURPOSE. # FOR A PARTICULAR PURPOSE.
# #
############################################################################## ##############################################################################
""" Unittests for Catalog. """ Unittests for ZCatalog
""" """
import unittest import unittest
...@@ -61,7 +61,6 @@ class zdummyFalse(zdummy): ...@@ -61,7 +61,6 @@ class zdummyFalse(zdummy):
def __nonzero__(self): def __nonzero__(self):
return False return False
# make objects with failing __len__ and __nonzero__
class dummyLenFail(zdummy): class dummyLenFail(zdummy):
...@@ -103,6 +102,20 @@ class fakeparent(Implicit): ...@@ -103,6 +102,20 @@ class fakeparent(Implicit):
return result return result
class PickySecurityManager:
def __init__(self, badnames=[]):
self.badnames = badnames
def validateValue(self, value):
return 1
def validate(self, accessed, container, name, value):
if name not in self.badnames:
return 1
raise Unauthorized(name)
class TestZCatalog(unittest.TestCase): class TestZCatalog(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -228,20 +241,6 @@ class TestZCatalog(unittest.TestCase): ...@@ -228,20 +241,6 @@ class TestZCatalog(unittest.TestCase):
self.assertEquals(catalog.getobject(rid0), None) self.assertEquals(catalog.getobject(rid0), None)
class PickySecurityManager:
def __init__(self, badnames=[]):
self.badnames = badnames
def validateValue(self, value):
return 1
def validate(self, accessed, container, name, value):
if name not in self.badnames:
return 1
raise Unauthorized(name)
class TestZCatalogGetObject(unittest.TestCase): class TestZCatalogGetObject(unittest.TestCase):
# Test what objects are returned by brain.getObject() # Test what objects are returned by brain.getObject()
......
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