Commit f2ae00ac authored by Tres Seaver's avatar Tres Seaver

Remove other pointless tests of Python's instance attr semantics.

parent aab109a0
...@@ -434,42 +434,18 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase): ...@@ -434,42 +434,18 @@ class ObjectManagerTests(PlacelessSetup, unittest.TestCase):
si1 = SimpleItem('1') si1 = SimpleItem('1')
om['1'] = si1 om['1'] = si1
self.assertTrue(('1', si1) in om.items()) self.assertTrue(('1', si1) in om.items())
# A contained item overwrites the method
self.assertTrue(hasattr(om.items, 'im_func'))
om.__dict__['items'] = si1
self.assertTrue(aq_base(om.items) is si1)
self.assertTrue(aq_base(om['items']) is si1)
# Once the object is gone, the method is back
del om['items']
self.assertTrue(hasattr(om.items, 'im_func'))
def test_keys(self): def test_keys(self):
om = self._makeOne() om = self._makeOne()
si1 = SimpleItem('1') si1 = SimpleItem('1')
om['1'] = si1 om['1'] = si1
self.assertTrue('1' in om.keys()) self.assertTrue('1' in om.keys())
# A contained item overwrites the method
self.assertTrue(hasattr(om.keys, 'im_func'))
om.__dict__['keys'] = si1
self.assertTrue(aq_base(om.keys) is si1)
self.assertTrue(aq_base(om['keys']) is si1)
# Once the object is gone, the method is back
del om['keys']
self.assertTrue(hasattr(om.keys, 'im_func'))
def test_values(self): def test_values(self):
om = self._makeOne() om = self._makeOne()
si1 = SimpleItem('1') si1 = SimpleItem('1')
om['1'] = si1 om['1'] = si1
self.assertTrue(si1 in om.values()) self.assertTrue(si1 in om.values())
# A contained item overwrites the method
self.assertTrue(hasattr(om.values, 'im_func'))
om.__dict__['values'] = si1
self.assertTrue(aq_base(om.values) is si1)
self.assertTrue(aq_base(om['values']) is si1)
# Once the object is gone, the method is back
del om['values']
self.assertTrue(hasattr(om.values, 'im_func'))
def test_list_imports(self): def test_list_imports(self):
om = self._makeOne() om = self._makeOne()
......
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