summaryrefslogtreecommitdiff
path: root/mox.py
Commit message (Collapse)AuthorAgeFilesLines
* Patch for Issue #47, provided by gps@google.comHEADmastersmiddlek2012-11-161-0/+6
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@75 b1010a0a-674b-0410-b734-77272b80c875
* Patch for Issue 51, contributed by matt@ihavethememo.netsmiddlek2012-11-121-2/+9
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@74 b1010a0a-674b-0410-b734-77272b80c875
* Patch for Issue 42 (Allow MoxMetaTestBase to be used with other metaclasses).smiddlek2012-05-011-0/+1
| | | | | | | | | Thanks dbronner@google.com git-svn-id: http://pymox.googlecode.com/svn/trunk@73 b1010a0a-674b-0410-b734-77272b80c875
* Patch for Issue 16 from Ben Love. Thanks!smiddlek2012-05-011-19/+87
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@72 b1010a0a-674b-0410-b734-77272b80c875
* Fix for broken logic when doing method signature matching and thestevepm@google.com2011-06-281-1/+11
| | | | | | | | | | first argument is a Comparator. The Comparator may raise an exception (which is expected), and since exceptions aren't caught, this will break well formed tests. git-svn-id: http://pymox.googlecode.com/svn/trunk@66 b1010a0a-674b-0410-b734-77272b80c875
* Patch for adding a Comparator that can remember values from liulk@google.com.smiddlek2011-06-061-0/+55
| | | | | | | | http://codereview.appspot.com/4527043/ git-svn-id: http://pymox.googlecode.com/svn/trunk@65 b1010a0a-674b-0410-b734-77272b80c875
* Patch for Issue 30.smiddlek2011-06-061-2/+6
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@64 b1010a0a-674b-0410-b734-77272b80c875
* Patch for Issue 35.smiddlek2011-06-061-0/+2
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@63 b1010a0a-674b-0410-b734-77272b80c875
* git-svn-id: http://pymox.googlecode.com/svn/trunk@62 ↵smiddlek2011-06-061-4/+1
| | | | b1010a0a-674b-0410-b734-77272b80c875
* Clean up missed conversion from _expected_seq to _expected_listsmiddlek2010-10-201-1/+1
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@61 b1010a0a-674b-0410-b734-77272b80c875
* + Fix for checking the method signature of unbound functions when keyword argssmiddlek2010-09-031-7/+19
| | | | | | | | | are passed as positional. With tests. + Made the comparator more robust by catching exceptions and returning False git-svn-id: http://pymox.googlecode.com/svn/trunk@60 b1010a0a-674b-0410-b734-77272b80c875
* Fix for Issue 19 by greatredsmiddlek2010-08-231-1/+7
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@59 b1010a0a-674b-0410-b734-77272b80c875
* Patch from Matt Brown (mdbrown@google) to make SameElementsAs more robustsmiddlek2010-08-231-7/+17
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@58 b1010a0a-674b-0410-b734-77272b80c875
* MockObject should have the __name__ param by default.smiddlek2010-08-191-7/+11
| | | | | | | | When stubbing with MockAnything, force the __name__ param git-svn-id: http://pymox.googlecode.com/svn/trunk@57 b1010a0a-674b-0410-b734-77272b80c875
* git-svn-id: http://pymox.googlecode.com/svn/trunk@56 ↵smiddlek2010-08-191-1/+1
| | | | b1010a0a-674b-0410-b734-77272b80c875
* Fix for issue #27 by stevepm@google.com / steve.middlekauff@gmail.comsmiddlek2010-08-181-3/+30
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@55 b1010a0a-674b-0410-b734-77272b80c875
* Fix for issue 21:smiddlek2010-07-101-2/+7
| | | | | | | | | | | + Add str() before assuming that types are strings in comparator __repr__ functions. + Add some doc and formatting to the Is() comparator. + Add some tests that In() works properly when the key is a tuple. git-svn-id: http://pymox.googlecode.com/svn/trunk@54 b1010a0a-674b-0410-b734-77272b80c875
* Add an Is() comparator for checking identity, instead of equality.smiddlek2010-07-071-0/+7
| | | | | | | | By: vmalloc git-svn-id: http://pymox.googlecode.com/svn/trunk@53 b1010a0a-674b-0410-b734-77272b80c875
* Adding a "fix" (cough, hack!) for method signature validation whensmiddlek2010-07-071-7/+24
| | | | | | | | | | calling an unbound method with the instance as the first arg. By Steve Middlekauff git-svn-id: http://pymox.googlecode.com/svn/trunk@52 b1010a0a-674b-0410-b734-77272b80c875
* Added column to AttributeError string to delimt error fromsmiddlek2010-06-171-1/+1
| | | | | | | | arguments, per issue 20. git-svn-id: http://pymox.googlecode.com/svn/trunk@51 b1010a0a-674b-0410-b734-77272b80c875
* Allow methods that are stubbed out on class instances to have theirsmiddlek2010-06-171-2/+4
| | | | | | | | | | | signatures verified. Initial patch submitted by vmalloc. Slight modificants to tests by steve.middlekauff. git-svn-id: http://pymox.googlecode.com/svn/trunk@50 b1010a0a-674b-0410-b734-77272b80c875
* Give MockAnything a more useful __repr__.dglasser2010-05-181-1/+4
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@49 b1010a0a-674b-0410-b734-77272b80c875
* MoxAnything should not implement the method __str__, otherwise callers won't besmiddlek2010-05-121-3/+0
| | | | | | | | able to mock __str__ calls. git-svn-id: http://pymox.googlecode.com/svn/trunk@48 b1010a0a-674b-0410-b734-77272b80c875
* Add StubOutClassWithMocks, which acts as a "generator" for mocksmiddlek2010-04-301-0/+158
| | | | | | | | | | | | | | | | | | | | | | | objects. This is useful for testing classes that directly instantiate their dependencies. Previously, one would create yet another mock that would act as a generator (effectively mocking __init__ and returning an instance of a MockObject). StubOutClassWithMocks handles the "generator" mock for you. Example: mox.StubOutClassWithMocks(my_import, 'FooClass') mock1 = my_import.FooClass(1, 2) # Returns a new mock of FooClass mock2 = my_import.FooClass(9, 10) # Returns another mock instance mox.ReplayAll() my_import.FooClass(1, 2) # Returns mock1 again. my_import.FooClass(9, 10) # Returns mock2 again. mox.VerifyAll() git-svn-id: http://pymox.googlecode.com/svn/trunk@44 b1010a0a-674b-0410-b734-77272b80c875
* Fix a bug where the interface is not enforced when stubbing out a first ↵smiddlek2010-04-221-6/+15
| | | | | | | | | | order method, or on the __call__ function of a callable object. git-svn-id: http://pymox.googlecode.com/svn/trunk@43 b1010a0a-674b-0410-b734-77272b80c875
* Long over due patch from alan.franzoni for better property support (Issue 11).smiddlek2010-04-201-2/+4
| | | | | | | | I'm very sorry about the delay. git-svn-id: http://pymox.googlecode.com/svn/trunk@42 b1010a0a-674b-0410-b734-77272b80c875
* Thanks to matthew.blain@google.com for ContainsAttributeValue comparatorsmiddlek2010-03-181-5/+59
| | | | | | | | | and Adeodato Simo for adding stubs to the MoxTestBase and fixing up some of the tests. git-svn-id: http://pymox.googlecode.com/svn/trunk@40 b1010a0a-674b-0410-b734-77272b80c875
* Slightly modified (for style) patch submitted by alan.franzoni tosmiddlek2010-01-081-4/+36
| | | | | | | | | | | support setting attributes on a MockObject from a dict supplied to the constructor. This is more efficient than setting attrs by hand. Only public attributes may be set. git-svn-id: http://pymox.googlecode.com/svn/trunk@39 b1010a0a-674b-0410-b734-77272b80c875
* Numerous fixes from Google:smiddlek2009-09-111-40/+110
| | | | | | | | | | | | | | | | * Added warning the Mox is not thread-safe - Steve Middlekauff * Fix bug in MultipleTimes group where if a Func is used it is called unnecessarily, due to re-comparing to see if the group has been satisfied - Steve Middlekauff * Use difflib for exceptions - Matt Brown * Add support for mocking iterators - Adam Nadolski * Make __getitem__, __setitem__, and __iter__ work with subclasses of new style clases - Antoine Picard git-svn-id: http://pymox.googlecode.com/svn/trunk@38 b1010a0a-674b-0410-b734-77272b80c875
* Fix for Issue 3, submitted by a...@therobots.org.smiddlek2009-05-051-0/+6
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@29 b1010a0a-674b-0410-b734-77272b80c875
* Patch from Matt Brown (mdbrow@gmail.com) to inspect the arguments of mocked ↵smiddlek2008-11-121-5/+112
| | | | | | methods. Alright! :) git-svn-id: http://pymox.googlecode.com/svn/trunk@26 b1010a0a-674b-0410-b734-77272b80c875
* Added support for __contains__, thanks to Adam Lowry.smiddlek2008-10-241-0/+27
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@25 b1010a0a-674b-0410-b734-77272b80c875
* Add a Not comparator to compose with other comparators.smiddlek2008-07-011-0/+34
| | | | | | | | Patch by: Benoit Sigoure <benoits@google.com> git-svn-id: http://pymox.googlecode.com/svn/trunk@18 b1010a0a-674b-0410-b734-77272b80c875
* Fix MoxTestBase to be usable with multiple-inheritance.dglasser2008-07-011-0/+1
| | | | | | | | | | MoxTestBase was redefining setUp() but it didn't use super() to call setUp recursively on the other parent classes defined in MRO. Patch by: Benoit Sigoure <tsuna@lrde.epita.fr> git-svn-id: http://pymox.googlecode.com/svn/trunk@17 b1010a0a-674b-0410-b734-77272b80c875
* Initial import of mox (originally an internal Google project).dglasser2008-06-131-0/+1398
It's not quite ready for release yet, but it's been appropriately scrubbed and relicensed. git-svn-id: http://pymox.googlecode.com/svn/trunk@7 b1010a0a-674b-0410-b734-77272b80c875