[Zope-Checkins] SVN: Zope/branches/2.12/src/OFS/tests/testObjectManager.py Test non-replacement of methods with other '_setObject' assertions.
Tres Seaver
tseaver at palladion.com
Thu Feb 9 17:01:14 UTC 2012
Log message for revision 124348:
Test non-replacement of methods with other '_setObject' assertions.
Changed:
U Zope/branches/2.12/src/OFS/tests/testObjectManager.py
-=-
Modified: Zope/branches/2.12/src/OFS/tests/testObjectManager.py
===================================================================
--- Zope/branches/2.12/src/OFS/tests/testObjectManager.py 2012-02-09 16:59:57 UTC (rev 124347)
+++ Zope/branches/2.12/src/OFS/tests/testObjectManager.py 2012-02-09 17:01:13 UTC (rev 124348)
@@ -328,6 +328,10 @@
self.assertRaises(BadRequest, om._setObject, '111', si)
self.assertRaises(BadRequest, om._setObject, 'REQUEST', si)
self.assertRaises(BadRequest, om._setObject, '/', si)
+ self.assertRaises(BadRequest, om._setObject, 'get', si)
+ self.assertRaises(BadRequest, om._setObject, 'items', si)
+ self.assertRaises(BadRequest, om._setObject, 'keys', si)
+ self.assertRaises(BadRequest, om._setObject, 'values', si)
def test_getsetitem(self):
om = self._makeOne()
@@ -386,7 +390,6 @@
def test_get(self):
om = self._makeOne()
si1 = SimpleItem('1')
- self.assertRaises(BadRequest, om.__setitem__, 'get', si1)
om['1'] = si1
self.failUnless(om.get('1') == si1)
# A contained item overwrites the method
@@ -401,7 +404,6 @@
def test_items(self):
om = self._makeOne()
si1 = SimpleItem('1')
- self.assertRaises(BadRequest, om.__setitem__, 'items', si1)
om['1'] = si1
self.failUnless(('1', si1) in om.items())
# A contained item overwrites the method
@@ -416,7 +418,6 @@
def test_keys(self):
om = self._makeOne()
si1 = SimpleItem('1')
- self.assertRaises(BadRequest, om.__setitem__, 'keys', si1)
om['1'] = si1
self.failUnless('1' in om.keys())
# A contained item overwrites the method
@@ -431,7 +432,6 @@
def test_values(self):
om = self._makeOne()
si1 = SimpleItem('1')
- self.assertRaises(BadRequest, om.__setitem__, 'values', si1)
om['1'] = si1
self.failUnless(si1 in om.values())
# A contained item overwrites the method
More information about the Zope-Checkins
mailing list