summaryrefslogtreecommitdiff
path: root/mox_test_helper.py
Commit message (Collapse)AuthorAgeFilesLines
* + Fix for checking the method signature of unbound functions when keyword argssmiddlek2010-09-031-0/+15
| | | | | | | | | 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 #27 by stevepm@google.com / steve.middlekauff@gmail.comsmiddlek2010-08-181-0/+12
| | | | git-svn-id: http://pymox.googlecode.com/svn/trunk@55 b1010a0a-674b-0410-b734-77272b80c875
* Allow methods that are stubbed out on class instances to have theirsmiddlek2010-06-171-0/+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
* Add StubOutClassWithMocks, which acts as a "generator" for mocksmiddlek2010-04-301-2/+15
| | | | | | | | | | | | | | | | | | | | | | | 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-0/+3
| | | | | | | | | | 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
* Thanks to matthew.blain@google.com for ContainsAttributeValue comparatorsmiddlek2010-03-181-0/+19
| | | | | | | | | 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
* Initial import of mox (originally an internal Google project).dglasser2008-06-131-0/+76
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