<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>t+1 - Latest Comments in I just wrote another mock object framework.</title><link>http://tplus1.disqus.com/</link><description></description><atom:link href="https://tplus1.disqus.com/i_just_wrote_another_mock_object_framework_40/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 29 Sep 2008 11:05:18 -0000</lastBuildDate><item><title>Re: I just wrote another mock object framework.</title><link>http://blog.tplus1.com/blog/2008/09/26/i-just-wrote-another-mock-object-framework/#comment-2732022</link><description>&lt;p&gt;Consider that name stolen :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Mon, 29 Sep 2008 11:05:18 -0000</pubDate></item><item><title>Re: I just wrote another mock object framework.</title><link>http://blog.tplus1.com/blog/2008/09/26/i-just-wrote-another-mock-object-framework/#comment-2731619</link><description>&lt;p&gt;This is about the only mock object framework that I would use.  The only thing it needs is a better name.  OckMock - "The simplest answer is usually the correct answer."  &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Wyglendowski</dc:creator><pubDate>Mon, 29 Sep 2008 10:34:44 -0000</pubDate></item><item><title>Re: I just wrote another mock object framework.</title><link>http://blog.tplus1.com/blog/2008/09/26/i-just-wrote-another-mock-object-framework/#comment-2656409</link><description>&lt;p&gt;Hi Ben,&lt;/p&gt;&lt;p&gt;I probably should have included a few example uses.  Pretend I want to mock an object that has an attribute named ivr_sends which is a list of strings.  I'd do this:&lt;/p&gt;&lt;p&gt;mm = BazMock(ivr_sends=['abc', 'def'])&lt;/p&gt;&lt;p&gt;Now my test code can access mm.ivr_sends just fine.&lt;/p&gt;&lt;p&gt;And now pretend you need to mock attributes on attributes:&lt;/p&gt;&lt;p&gt;mm = BazMock(x=BazMock(y=[BazMock(a=1, b=2), BazMock(a=3, b=4)]))&lt;/p&gt;&lt;p&gt;And now I can access mm.x.y[0].a.&lt;/p&gt;&lt;p&gt;For methods, you'd need to graft on definitions like this:&lt;/p&gt;&lt;p&gt;def fake_foo(x):&lt;br&gt;    return "99"&lt;/p&gt;&lt;p&gt;&lt;a href="http://mm.foo" rel="nofollow noopener" target="_blank" title="mm.foo"&gt;mm.foo&lt;/a&gt; = fake_foo&lt;/p&gt;&lt;p&gt;I've been told that there are better mock objects out there, that do stuff like inspect a module or a class and create mocks automatically.&lt;/p&gt;&lt;p&gt;I'm dragging my feet about learning them.  Let me know if you find one you like.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Sat, 27 Sep 2008 08:53:34 -0000</pubDate></item><item><title>Re: I just wrote another mock object framework.</title><link>http://blog.tplus1.com/blog/2008/09/26/i-just-wrote-another-mock-object-framework/#comment-2654907</link><description>&lt;p&gt;Doesn't seem too useful; when the code under test attempts to call expected methods on an instance it'll fail with 'AttributeError'. A mock object should pretend it's the object being mocked, surely?&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ben Finney</dc:creator><pubDate>Sat, 27 Sep 2008 01:51:40 -0000</pubDate></item><item><title>Re: I just wrote another mock object framework.</title><link>http://blog.tplus1.com/blog/2008/09/26/i-just-wrote-another-mock-object-framework/#comment-2648120</link><description>&lt;p&gt;Hey, you stole that code from my ORM.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael Barton</dc:creator><pubDate>Fri, 26 Sep 2008 17:36:41 -0000</pubDate></item></channel></rss>