Florent Guillaume wrote at 2005-9-26 18:31 +0200:
>This is the kind of thing that would *really* benefit from having unit

from Acquisition import Explicit
class A(Explicit): x = 1

def test_aq_acquire(self):
  ac = A()
  a = A().__of__(ac)
  self.assertEqual(a.aq_acquire('x'), 1)
  self.assertRaises(AttributeError, a.aq_acquire, 'y')
  self.assertEqual(a.aq_acquire('y', default=None), None)

Note, that "aq_acquire" has a lot more arguments -- not checked
by the above test (which checks just the fixed handling of the
argument "default").

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to