Re: Programmatically replacing an API for another module

2006-11-22 Thread Chris Lambacher
On Tue, Nov 21, 2006 at 05:00:32PM -0800, Tom Plunket wrote:
 Bruno Desthuilliers wrote:
 
   I've got a bunch of code that runs under a bunch of unit tests.  It'd
   be really handy if when testing I could supply replacement
   functionality to verify that the right things get called without those
   things actually getting called, since frequently those calls take a
   long time to execute and do things that, well, I don't really want to
   do.
  
  Congratulation, you just rediscovered the MockObject.
 
 How do I rediscover something that I'm explicitly implementing?  I had
 set out specifically to mock an API, there was no rediscovery going
 on.
 
 That does allow me to discover via Google the Python Mock Module,
 though, which may well do what I want:
 
 from TestedModule import *
 
 my_win32file = Mock({
'CopyFile': 'CopyFile called'
}
 
 win32file = my_win32file
 
 ...perhaps.
 
 I'm just a bit loathe to download and install more stuff when
 something simpler appears to be near-at-hand.  ...especially
 considering the page describing this module doesn't offer any download
 links!  http://python-mock.sourceforge.net/
How about mini-mock:
http://blog.ianbicking.org/minimock.html
 
 
 -tom!
 -- 
 http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Programmatically replacing an API for another module

2006-11-22 Thread Chris Lambacher
  I'm just a bit loathe to download and install more stuff when
  something simpler appears to be near-at-hand.  ...especially
  considering the page describing this module doesn't offer any download
  links!  http://python-mock.sourceforge.net/
 How about mini-mock:
 http://blog.ianbicking.org/minimock.html

Oh yeah, and the download link for python-mock is:
http://sourceforge.net/project/showfiles.php?group_id=138804
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Programmatically replacing an API for another module

2006-11-22 Thread Tom Plunket
Chris Lambacher wrote:

   I'm just a bit loathe to download and install more stuff when
   something simpler appears to be near-at-hand.  ...especially
   considering the page describing this module doesn't offer any download
   links!  http://python-mock.sourceforge.net/
 
 Oh yeah, and the download link for python-mock is:
 http://sourceforge.net/project/showfiles.php?group_id=138804

Heh, yeah I'm sure that's what I got when I went to sf.net and typed
in the project name, then submitted a bug for the homepage that it
doesn't offer any links to find the download.  ;)

-tom!
-- 
http://mail.python.org/mailman/listinfo/python-list