Subject: Re: [twill] documentation mismatch?
From: iain duncan <iaind...@telus.net>
To: ti...@idyll.org
Date: Wed, 21 Nov 2007 18:13:37 -0800
X-Mailer: Evolution 2.6.1
On Wed, 2007-21-11 at 14:21 -0800, Titus Brown wrote:
> On Wed, Nov 21, 2007 at 12:08:48PM -0800, iain duncan wrote:
> -> On Wed, 2007-21-11 at 10:31 -0800, bruce wrote:
> -> > len(list(showlinks()))
> ->
> -> Thank Bruce, I knew about that trick ( I mentioned flattening the
> -> generator ), I just thought the command reference of the docs should
> -> correctly indicate what is returned ( Generator not list ), or it should
> -> return an object implementing the remaining list interfaces ( len, [] ).
> -> As it is, one of the first things I tried was to get the link object by
> -> subscripting with [] and the length with len, and then had to go and
> -> figure out in the shell why that didn't work. Minor inconvenience, but
> -> still a less than optimal user experience that could be avoided by a
> -> quick correction in the docs.
>
> Iain, you have a nack for finding bugs in my docs ;). thanks!
>
> -> Thanks for the hard work Titus! I'm really looking forward to the growth
> -> of Twill, it's great to have one tool I can use for simple automated
> -> browsing with or without the test harness. =)
>
> You're welcome! Thanks again for finding bugs...
No problem! I think once I have all this figured out I'll make a little
tutorial for Turbogears + SQLAlchemy + Nose + Twill. Now that I've
weeded my way through them I can see that this will speed up my work
immensely. Importing the domain specific language into python and having
the automatic asserts are great for quickly going through a whole set of
user actions.
Do you also like to recieve feature requests for Twill or are you pretty
full up right now?
One thing I thought of, ( and maybe I just haven't found it yet ) is
that it would cool if we could specify the message thrown by a twill
automatic exception. Does that exist yet?
ie
def test1(self):
go('here')
find('foobar', 'Can't find foo')
where that would be come in xUnit lingo
assert find('foobar'), 'can't find foo'
Thanks again!
Iain
----- End forwarded message -----
--
C. Titus Brown, c...@msu.edu
X-Original-To: ti...@caltech.edu
From: iain duncan <iaind...@telus.net>
To: tw...@lists.idyll.org
Date: Wed, 21 Nov 2007 12:08:48 -0800
X-Mailer: Evolution 2.6.1
Subject: Re: [twill] documentation mismatch?
On Wed, 2007-21-11 at 10:31 -0800, bruce wrote:
> len(list(showlinks()))
Thank Bruce, I knew about that trick ( I mentioned flattening the
generator ), I just thought the command reference of the docs should
correctly indicate what is returned ( Generator not list ), or it should
return an object implementing the remaining list interfaces ( len, [] ).
As it is, one of the first things I tried was to get the link object by
subscripting with [] and the length with len, and then had to go and
figure out in the shell why that didn't work. Minor inconvenience, but
still a less than optimal user experience that could be avoided by a
quick correction in the docs.
Thanks for the hard work Titus! I'm really looking forward to the growth
of Twill, it's great to have one tool I can use for simple automated
browsing with or without the test harness. =)
Iain
>
> On Wed, Nov 21, 2007 at 12:54:14AM -0800, iain duncan wrote:
> > Hi all, just getting into Twill and I can see it will be great for
> > functional testing my TG apps.
> >
> > I assume this is the place for bug reports and feature requests?
> >
> > Something I found:
> >
> > The command reference at
> > http://twill.idyll.org/commands.html
> > says that when called from python, showlinks and showforms return lists.
> > However, in my shell, they seem to be returning generators that won't
> > let me do:
> >
> > len( showlinks() )
> >
> > I think it would be handly to be able to count them, but of course I can
> > flatten the generator. However, thought I'd point out that doc mismatch
> > and it might be nice to avoid the explicit conversion to list.
> >
> >
> > BTW, thanks for the shortcuts book too!
> > Iain
> >
> >
> >
> > _______________________________________________
> > twill mailing list
> > tw...@lists.idyll.org
> > http://lists.idyll.org/listinfo/twill
> >
_______________________________________________
twill mailing list
tw...@lists.idyll.org
http://lists.idyll.org/listinfo/twill