[TIP] flexmock

Eric Henry henryer2 at msu.edu
Sun Jul 3 18:38:28 PDT 2011


a_mock_object['key'] = value

I'm trying to mock the Mechanize browser class, which allows form input to
be set by item assignment. I was hoping I could just call
should_receive('__setitem__'), but it looks like is prefixing the method
name with "Mock".

Something like what mox.py has. If you look at the mox.py source code line
429, you'll see what I'm talking about...

http://code.google.com/p/pymox/source/browse/trunk/mox.py?r=26

This issue aside, I really like Flexmock. It's simple, to the point, fits
exactly where I need it, and it's api makes it super easy to read!

Thanks!

Eric


On Sun, Jul 3, 2011 at 6:17 PM, Herman Sheremetyev <herman at swebpage.com>wrote:

> What do you mean by item assignment support?
>
> On Mon, Jul 4, 2011 at 4:26 AM, Eric Henry <henryer2 at msu.edu> wrote:
> > Am I missing something, or does flexmock lack item assignment support?
> > Eric
> >
> > _______________________________________________
> > testing-in-python mailing list
> > testing-in-python at lists.idyll.org
> > http://lists.idyll.org/listinfo/testing-in-python
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20110703/a09ad78a/attachment.htm>


More information about the testing-in-python mailing list