Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-python-testing-cabal-mock
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-python-testing-cabal-mock
Commits
9463268a
Commit
9463268a
authored
16 years ago
by
fuzzyman
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
b94d2a95
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mock.py
+1
-1
1 addition, 1 deletion
mock.py
mock.txt
+20
-2
20 additions, 2 deletions
mock.txt
setup.py
+23
-0
23 additions, 0 deletions
setup.py
with
44 additions
and
3 deletions
mock.py
+
1
−
1
View file @
9463268a
...
...
@@ -27,7 +27,7 @@ DEFAULT = object()
class
Mock
(
object
):
def
__init__
(
self
,
methods
=
None
,
spec
=
None
,
side_effect
=
None
,
name
=
None
,
parent
=
None
):
return_value
=
DEFAULT
,
name
=
None
,
parent
=
None
):
self
.
_parent
=
parent
self
.
_name
=
name
if
spec
is
not
None
and
methods
is
None
:
...
...
This diff is collapsed.
Click to expand it.
mock.txt
+
20
−
2
View file @
9463268a
...
...
@@ -727,6 +727,26 @@ There are various disadvantages and things that Mock doesn't (yet) do.
CHANGELOG
=========
2008/10/XX Version 0.4.0
------------------------
* Default return value is now a new mock rather than None
* return_value added as a keyword argument to the constructor
* New method 'assert_called_with'
* Added 'side_effect' attribute / keyword argument called when mock is called
* patch decorator split into two decorators:
- ``patch_object`` which takes an object and an attribute name to patch
(plus optionally a value to patch with which defaults to a mock object)
- ``patch`` which takes a string specifying a target to patch; in the form
'package.module.Class.attribute'. (plus optionally a value to
patch with which defaults to a mock object)
* Change to patch for nose compatibility with error reporting in wrapped functions
* Reset no longer clears children / return value etc - it just resets
call count and call args. It also calls reset on all children (and
the return value if it is a mock).
2007/12/03 Version 0.3.1
-------------------------
...
...
@@ -746,7 +766,6 @@ Removed ``patch_module``. ``patch`` can now take a string as the first argument
The third argument to ``patch`` is optional - a mock will be created by default if it is not passed in.
2007/11/21 Version 0.2.1
-------------------------
...
...
@@ -756,7 +775,6 @@ Bug fix, allows reuse of functions decorated with ``patch`` and ``patch_module``
2007/11/20 Version 0.2.0
-------------------------
Added ``spec`` keyword argument for creating ``Mock`` objects from a specification object.
Added ``patch`` and ``patch_module`` monkey patching decorators.
...
...
This diff is collapsed.
Click to expand it.
setup.py
0 → 100755
+
23
−
0
View file @
9463268a
#! /usr/bin/python
from
setuptools
import
setup
,
find_packages
from
mock
import
__version__
setup
(
name
=
"
mock
"
,
version
=
__version__
,
packages
=
[],
py_modules
=
[
'
mock
'
],
include_package_data
=
False
,
zip_safe
=
True
,
# metadata for upload to PyPI
author
=
"
Michael Foord
"
,
author_email
=
"
fuzzyman@voidspace.org.uk
"
,
description
=
"
This is an Example Package
"
,
license
=
"
BSD
"
,
keywords
=
"
testing test mock mocking unittest patching stubs
"
,
url
=
"
http://www.voidspace.org.uk/python/mock.html
"
,
# could also include long_description, download_url, classifiers, etc.
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment