summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fixed patching of objects which define __getattr__.0.10.1Gustavo Niemeyer2007-12-113-5/+81
|
* Preparing to release 0.10.0.10Gustavo Niemeyer2007-12-092-2/+2
|
* Orderer() is now implemented based on may_run() instead of matches().Gustavo Niemeyer2007-12-093-31/+70
| | | | | If the event is run with may_run() False, a nice assertion error is raised with a nice debugging message. :-)
* Introduced {Task,Event}.may_run() to improve replaying orderingGustavo Niemeyer2007-12-092-21/+115
| | | | | logic. Now events which have may_run() true will be run before events which don't.
* When the expression executed isn't exactly the same as theGustavo Niemeyer2007-12-093-7/+43
| | | | | recorded events (e.g. when parameter matchers are used), show in the error message the real expression run, to aid in debugging.
* Fixed problem when requesting order on similar expressions. TheGustavo Niemeyer2007-12-093-13/+34
| | | | second expression might not be accepted.
* MockerTestCase.makeFile() with content=None (the default) nowGustavo Niemeyer2007-12-073-8/+17
| | | | | consistently returns an unexistent temporary filename which is properly cleaned up if created.
* New 'path' option to MockerTestCase.makeFile() and makeDir(),Gustavo Niemeyer2007-12-053-15/+47
| | | | which allows setting the full target path with a single option.
* New MATCH() argument matcher, which allows using a functionGustavo Niemeyer2007-12-053-3/+28
| | | | to match an argument generically. E.g. MATCH(lambda x: x > 10)
* Implemented MockerTestCase.addCleanup(). It allows one toGustavo Niemeyer2007-12-053-21/+47
| | | | | register cleanup functions to be called after the test is complete.
* Now when a spec is provided (or with proxy/replace/patch) theGustavo Niemeyer2007-12-043-0/+26
| | | | | existence of the real method is checked even if the mocked method doesn't have to execute (e.g. due to count(0)).
* MockerTestCase now verifies if the mocker is put in replayGustavo Niemeyer2007-12-043-1/+30
| | | | mode in cases where events were recorded.
* Implemented support for Deferred results as understood byGustavo Niemeyer2007-12-043-6/+65
| | | | | Twisted Trial's TestCase, so that coexistence by multiple inheritance is possible and trivial.
* In MockerTestCase's constructor, copy attributes from the original methodGustavo Niemeyer2007-12-042-1/+15
| | | | into the wrapper.
* Break the import of sets for Python 2.3 and add pragma: nocoverGustavo Niemeyer2007-11-241-2/+2
| | | | to prevent it being seen as an uncovered statement in Python 2.4+.
* Preparing to release 0.9.3.0.9.3Gustavo Niemeyer2007-11-242-2/+2
|
* - Added support for Python 2.3 (patch by Phillip J. Eby).Gustavo Niemeyer2007-11-243-63/+101
| | | | | - Added MockerTestCase.assert{True,False} aliases, so that they're available even in Python 2.3.
* Introduced automatic test coverage verification, and covered theGustavo Niemeyer2007-11-233-12/+93
| | | | few statements which were not being passed through.
* Updated version to 0.9.2.0.9.2Gustavo Niemeyer2007-11-221-1/+1
|
* Now Mocker.mock()/proxy()/replace() accept a 'count' keywordGustavo Niemeyer2007-11-223-10/+51
| | | | | parameter, which if set to False, the default behavior of allowing expressions just once is disabled.
* In recording mode, mock.__class__ will now return Mock, and notGustavo Niemeyer2007-11-223-7/+33
| | | | | | record the action. This allows Mocker to be used in interactive environments which inspect the result's type, such as in iPython (reported by Alex Dante).
* Typo fix in NEWS.Gustavo Niemeyer2007-11-191-1/+1
|
* Fixed setup.py to install mocker.py properly.0.9.1Gustavo Niemeyer2007-11-183-1/+8
|
* "unexistent" doesn't exist.Gustavo Niemeyer2007-11-171-1/+1
|
* Preparing to release version 0.9.0.9Gustavo Niemeyer2007-11-172-2/+2
|
* Added MockerTestCase.assert[Not]{Starts,Ends}With().Gustavo Niemeyer2007-11-173-0/+150
|
* Added MockerTestCase.assertMethodsMatch(). It will verify if allGustavo Niemeyer2007-11-173-0/+102
| | | | | | | public methods found in the class passed as the first argument are also present in the class passed as the second argument, and that they accept the same arguments. This is useful to verify if a fake or stub class have the same API as the real class being simulated.
* Implemented state resetting on replay() for RunCounter and Orderer.Gustavo Niemeyer2007-11-133-2/+48
|
* When using an unexistent import path for Mocker.proxy(), raise anGustavo Niemeyer2007-11-133-2/+16
| | | | | ImportError on the base module, rather than using the actual string as the object (#162315).
* Mocker.on_restore() removed. Restore isn't performed if replay()Gustavo Niemeyer2007-11-123-19/+5
| | | | | isn't called, and that may not be obvious, so a hook won't be exposed for now.
* New MockerTestCase.makeFile() and .makeDir() helpers. They offerGustavo Niemeyer2007-11-123-1/+156
| | | | | easy creation of temporary files/directories with certainty of removal after tests finish running.
* Adding release infrastructure.0.8Gustavo Niemeyer2007-11-115-0/+304
|
* Added some meta-information to the mocker module.Gustavo Niemeyer2007-11-111-0/+10
|
* Minor change in Mocker's docstring.Gustavo Niemeyer2007-11-111-6/+6
|
* Moved "string proxying" logic out of replace() and into proxy().Gustavo Niemeyer2007-11-112-16/+32
|
* Fixed SpecChecker to not break with callables not supported byGustavo Niemeyer2007-11-112-6/+37
| | | | getargspec (e.g. builtin functions).
* Implemented delitem action kind.Gustavo Niemeyer2007-11-112-0/+30
|
* - Implemented MockerTestCase.Gustavo Niemeyer2007-11-112-53/+484
| | | | | - Renamed special argument SAME to IS, and added IN. - Implemented Mocker.on_restore().
* Implemented Mocker.generate().Gustavo Niemeyer2007-11-042-0/+16
|
* Implemented len, iter and nonzero action kinds.Gustavo Niemeyer2007-11-042-8/+153
|
* Implemented support for "getitem" and "setitem" action kinds.Gustavo Niemeyer2007-10-312-1/+53
|
* Added support for "delattr" and "contains" kinds, and finishedGustavo Niemeyer2007-10-312-9/+114
| | | | support for "setattr".
* - Now if replay() is run while already in replay mode, the mockerGustavo Niemeyer2007-10-302-127/+292
| | | | | | | | | | | | | is restored and then put back in replay mode - Implemented Mocker.reset(). - Now patch() sets the spec to the given object by default, and the new spec argument acts like usual. - Got rid of ordered(), and integrated its functionality in order() itself, when called without arguments. unordered() was renamed to unorder() for symmetry. - passthrough() now takes a result_callback argument, called with the result of the real function as the only argument. - Added setattr events in the mock.
* Replaced set_state() by replay()/restore().Gustavo Niemeyer2007-10-302-151/+151
|
* Minor changes in documentation.Gustavo Niemeyer2007-10-301-10/+7
|
* Moved it forward, most importantly implementing the patching feature.Gustavo Niemeyer2007-10-292-474/+1744
|
* Adding initial version of python-mocker to repository! It's alive!Gustavo Niemeyer2007-10-142-0/+2736