Re: [Zope3-dev] Doctests for IObjectModifiedEvent

2006-03-08 Thread Stephan Richter
On Wednesday 08 March 2006 15:18, Egon Frerich wrote:
> I want to have doctests which document the correctness of an handler for
>  an IObjectModifiedEvent. But the 'notify' triggers a TypeError, because
> the handler 'takes exactly 2 arguments (1 given)'. Two arguments are
> correct.

I have a suspicion. Here is how to system works:

event = AnyObjectEvent(obj)
-> zope.event.notify(event)
-> zope.app.objectevent.objectEventNotify(event)
-> subscribers((event.object, event), None)
-> yourHandler(obj, event)

Any IObjectEvent gets handled by objectEventNotify, which in turn sends out 
another subscription request for (obj, event). And you probably have a 
subscriber for the latter. The easy way to test this would be to manually 
write:

  >>> yourHandler(event.object, event)

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Doctests for IObjectModifiedEvent

2006-03-08 Thread Egon Frerich
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

I want to have doctests which document the correctness of an handler for
 an IObjectModifiedEvent. But the 'notify' triggers a TypeError, because
the handler 'takes exactly 2 arguments (1 given)'. Two arguments are
correct.

I have searched the tests in zope.app.event. The Doctests do notify but
I don't see any handler for IObjectModifiedEvent (and a proof the
handler does it right).

Egon
- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEDzwBuTzybIiyjvURAktgAJ4gjsrV9ds7+iEjUsh1Pbn57xUYIgCdEk7C
iof7BgNE8NgmJ7bwljvGNww=
=PTzi
-END PGP SIGNATURE-
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com