[Zope3-Users] Re: Error in testbrowser documentation

Marius Gedminas mgedmin at b4net.lt
Thu Feb 14 08:34:23 EST 2008

On Thu, Feb 14, 2008 at 05:32:31AM +0100, Encolpe Degoute wrote:
> Hello,
> I obtain write access last week.
> Can someone review my first commit (83809) ?

Looking at http://svn.zope.org/?view=rev&rev=83809 now...

No, that seems wrong.  getLink('text', index=42) is useful functionality
and it works perfectly.  It's the IBrowser.getLink that lags behind and
should be updated.  I'll do it.

> Encolpe Degoute a écrit :
> > Hello,
> > 
> > On http://pypi.python.org/pypi/zope.testbrowser you can read:
> > 
> > When a link text matches more than one link, by default the first one is
> > chosen. You can, however, specify the index of the link and thus
> > retrieve a later matching link:
> > 
> >  >>> browser.getLink('Link Text')
> >  <Link text='Link Text' ...>
> > 
> >  >>> browser.getLink('Link Text', index=1)
> >  <Link text='Link Text with Whitespace Normalization (and parens)' ...>
> > 
> > 
> > But now the getLink signature is like this:
> > def getLink(self, text=None, url=None, id=None)

In zope.testbrowser.interfaces.IBrowser, yes.

In zope.testbrowser.browser.Browser, no:

    def getLink(self, text=None, url=None, id=None, index=0):
        """See zope.testbrowser.interfaces.IBrowser"""

Browser was last modified in rev 71429, IBrowser was last modified in
rev 40065.  I guess the person who added the index argument forgot to
update the interface definition.

Fixed now.

Marius Gedminas
The irony is that Bill Gates claims to be making a stable operating
system and Linus Torvalds claims to be trying to take over the
		-- seen on the net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20080214/40510350/attachment.bin

More information about the Zope3-users mailing list