mock-1.0.1/0000755000076500001200000000000012046031032013140 5ustar michaeladmin00000000000000mock-1.0.1/docs/0000755000076500001200000000000012046031032014070 5ustar michaeladmin00000000000000mock-1.0.1/docs/changelog.txt0000644000076500001200000010017512046027306016575 0ustar michaeladmin00000000000000.. currentmodule:: mock CHANGELOG ========= 2012/11/5 Version 1.0.1 ----------------------- * Functions decorated with `patch` variants have a `__wrapped__` attribute pointing to the original function. This brings compatibility with the default behaviour in Python 3.3 (due to a new feature in `functools.wraps`). Note that due to changes in `tox`, `mock` is no longer tested with Python 2.4. The compatibility code has not been removed so it probably still works, but tests are no longer run. 2012/10/07 Version 1.0.0 ------------------------ No changes since 1.0.0 beta 1. This version has feature parity with `unittest.mock `_ in Python 3.3. Full list of changes since 0.8: * `mocksignature`, along with the `mocksignature` argument to `patch`, removed * Support for deleting attributes (accessing deleted attributes will raise an `AttributeError`) * Added the `mock_open` helper function for mocking the builtin `open` * `__class__` is assignable, so a mock can pass an `isinstance` check without requiring a spec * Addition of `PropertyMock`, for mocking properties * `MagicMocks` made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return `NotImplemented` * Propagate traceback info to support subclassing of `_patch` by other libraries * `create_autospec` works with attributes present in results of `dir` that can't be fetched from the object's class. Contributed by Konstantine Rybnikov * Any exceptions in an iterable `side_effect` will be raised instead of returned * In Python 3, `create_autospec` now supports keyword only arguments * Added `patch.stopall` method to stop all active patches created by `start` * BUGFIX: calling `MagicMock.reset_mock` wouldn't reset magic method mocks * BUGFIX: calling `reset_mock` on a `MagicMock` created with autospec could raise an exception * BUGFIX: passing multiple spec arguments to patchers (`spec` , `spec_set` and `autospec`) had unpredictable results, now it is an error * BUGFIX: using `spec=True` *and* `create=True` as arguments to patchers could result in using `DEFAULT` as the spec. Now it is an error instead * BUGFIX: using `spec` or `autospec` arguments to patchers, along with `spec_set=True` did not work correctly * BUGFIX: using an object that evaluates to False as a spec could be ignored * BUGFIX: a list as the `spec` argument to a patcher would always result in a non-callable mock. Now if `__call__` is in the spec the mock is callable 2012/07/13 Version 1.0.0 beta 1 -------------------------------- * Added `patch.stopall` method to stop all active patches created by `start` * BUGFIX: calling `MagicMock.reset_mock` wouldn't reset magic method mocks * BUGFIX: calling `reset_mock` on a `MagicMock` created with autospec could raise an exception 2012/05/04 Version 1.0.0 alpha 2 -------------------------------- * `PropertyMock` attributes are now standard `MagicMocks` * `create_autospec` works with attributes present in results of `dir` that can't be fetched from the object's class. Contributed by Konstantine Rybnikov * Any exceptions in an iterable `side_effect` will be raised instead of returned * In Python 3, `create_autospec` now supports keyword only arguments 2012/03/25 Version 1.0.0 alpha 1 -------------------------------- The standard library version! * `mocksignature`, along with the `mocksignature` argument to `patch`, removed * Support for deleting attributes (accessing deleted attributes will raise an `AttributeError`) * Added the `mock_open` helper function for mocking the builtin `open` * `__class__` is assignable, so a mock can pass an `isinstance` check without requiring a spec * Addition of `PropertyMock`, for mocking properties * `MagicMocks` made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return `NotImplemented` * Propagate traceback info to support subclassing of `_patch` by other libraries * BUGFIX: passing multiple spec arguments to patchers (`spec` , `spec_set` and `autospec`) had unpredictable results, now it is an error * BUGFIX: using `spec=True` *and* `create=True` as arguments to patchers could result in using `DEFAULT` as the spec. Now it is an error instead * BUGFIX: using `spec` or `autospec` arguments to patchers, along with `spec_set=True` did not work correctly * BUGFIX: using an object that evaluates to False as a spec could be ignored * BUGFIX: a list as the `spec` argument to a patcher would always result in a non-callable mock. Now if `__call__` is in the spec the mock is callable 2012/02/13 Version 0.8.0 ------------------------ The only changes since 0.8rc2 are: * Improved repr of :data:`sentinel` objects * :data:`ANY` can be used for comparisons against :data:`call` objects * The return value of `MagicMock.__iter__` method can be set to any iterable and isn't required to be an iterator Full List of changes since 0.7: mock 0.8.0 is the last version that will support Python 2.4. * Addition of :attr:`~Mock.mock_calls` list for *all* calls (including magic methods and chained calls) * :func:`patch` and :func:`patch.object` now create a :class:`MagicMock` instead of a :class:`Mock` by default * The patchers (`patch`, `patch.object` and `patch.dict`), plus `Mock` and `MagicMock`, take arbitrary keyword arguments for configuration * New mock method :meth:`~Mock.configure_mock` for setting attributes and return values / side effects on the mock and its attributes * New mock assert methods :meth:`~Mock.assert_any_call` and :meth:`~Mock.assert_has_calls` * Implemented :ref:`auto-speccing` (recursive, lazy speccing of mocks with mocked signatures for functions/methods), as the `autospec` argument to `patch` * Added the :func:`create_autospec` function for manually creating 'auto-specced' mocks * :func:`patch.multiple` for doing multiple patches in a single call, using keyword arguments * Setting :attr:`~Mock.side_effect` to an iterable will cause calls to the mock to return the next value from the iterable * New `new_callable` argument to `patch` and `patch.object` allowing you to pass in a class or callable object (instead of `MagicMock`) that will be called to replace the object being patched * Addition of :class:`NonCallableMock` and :class:`NonCallableMagicMock`, mocks without a `__call__` method * Addition of :meth:`~Mock.mock_add_spec` method for adding (or changing) a spec on an existing mock * Protocol methods on :class:`MagicMock` are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a `MagicMock` instead of a `Mock` as it was previously * Addition of :meth:`~Mock.attach_mock` method * Added :data:`ANY` for ignoring arguments in :meth:`~Mock.assert_called_with` calls * Addition of :data:`call` helper object * Improved repr for mocks * Improved repr for :attr:`Mock.call_args` and entries in :attr:`Mock.call_args_list`, :attr:`Mock.method_calls` and :attr:`Mock.mock_calls` * Improved repr for :data:`sentinel` objects * `patch` lookup is done at use time not at decoration time * In Python 2.6 or more recent, `dir` on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes. * Module level :data:`FILTER_DIR` added to control whether `dir(mock)` filters private attributes. `True` by default. * `patch.TEST_PREFIX` for controlling how patchers recognise test methods when used to decorate a class * Support for using Java exceptions as a :attr:`~Mock.side_effect` on Jython * `Mock` call lists (`call_args_list`, `method_calls` & `mock_calls`) are now custom list objects that allow membership tests for "sub lists" and have a nicer representation if you `str` or `print` them * Mocks attached as attributes or return values to other mocks have calls recorded in `method_calls` and `mock_calls` of the parent (unless a name is already set on the child) * Improved failure messages for `assert_called_with` and `assert_called_once_with` * The return value of the :class:`MagicMock` `__iter__` method can be set to any iterable and isn't required to be an iterator * Added the Mock API (`assert_called_with` etc) to functions created by :func:`mocksignature` * Tuples as well as lists can be used to specify allowed methods for `spec` & `spec_set` arguments * Calling `stop` on an unstarted patcher fails with a more meaningful error message * Renamed the internal classes `Sentinel` and `SentinelObject` to prevent abuse * BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in place * BUGFIX: `__truediv__` and `__rtruediv__` not available as magic methods on mocks in Python 3 * BUGFIX: `assert_called_with` / `assert_called_once_with` can be used with `self` as a keyword argument * BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance") * BUGFIX: remove the `__unittest` marker causing traceback truncation * Removal of deprecated `patch_object` * Private attributes `_name`, `_methods`, '_children', `_wraps` and `_parent` (etc) renamed to reduce likelihood of clash with user attributes. * Added license file to the distribution 2012/01/10 Version 0.8.0 release candidate 2 -------------------------------------------- * Removed the `configure` keyword argument to `create_autospec` and allow arbitrary keyword arguments (for the `Mock` constructor) instead * Fixed `ANY` equality with some types in `assert_called_with` calls * Switched to a standard Sphinx theme (compatible with `readthedocs.org `_) 2011/12/29 Version 0.8.0 release candidate 1 -------------------------------------------- * `create_autospec` on the return value of a mocked class will use `__call__` for the signature rather than `__init__` * Performance improvement instantiating `Mock` and `MagicMock` * Mocks used as magic methods have the same type as their parent instead of being hardcoded to `MagicMock` Special thanks to Julian Berman for his help with diagnosing and improving performance in this release. 2011/10/09 Version 0.8.0 beta 4 ------------------------------- * `patch` lookup is done at use time not at decoration time * When attaching a Mock to another Mock as a magic method, calls are recorded in mock_calls * Addition of `attach_mock` method * Renamed the internal classes `Sentinel` and `SentinelObject` to prevent abuse * BUGFIX: various issues around circular references with mocks (setting a mock return value to be itself etc) 2011/08/15 Version 0.8.0 beta 3 ------------------------------- * Mocks attached as attributes or return values to other mocks have calls recorded in `method_calls` and `mock_calls` of the parent (unless a name is already set on the child) * Addition of `mock_add_spec` method for adding (or changing) a spec on an existing mock * Improved repr for `Mock.call_args` and entries in `Mock.call_args_list`, `Mock.method_calls` and `Mock.mock_calls` * Improved repr for mocks * BUGFIX: minor fixes in the way `mock_calls` is worked out, especially for "intermediate" mocks in a call chain 2011/08/05 Version 0.8.0 beta 2 ------------------------------- * Setting `side_effect` to an iterable will cause calls to the mock to return the next value from the iterable * Added `assert_any_call` method * Moved `assert_has_calls` from call lists onto mocks * BUGFIX: `call_args` and all members of `call_args_list` are two tuples of `(args, kwargs)` again instead of three tuples of `(name, args, kwargs)` 2011/07/25 Version 0.8.0 beta 1 ------------------------------- * `patch.TEST_PREFIX` for controlling how patchers recognise test methods when used to decorate a class * `Mock` call lists (`call_args_list`, `method_calls` & `mock_calls`) are now custom list objects that allow membership tests for "sub lists" and have an `assert_has_calls` method for unordered call checks * `callargs` changed to *always* be a three-tuple of `(name, args, kwargs)` * Addition of `mock_calls` list for *all* calls (including magic methods and chained calls) * Extension of `call` object to support chained calls and `callargs` for better comparisons with or without names. `call` object has a `call_list` method for chained calls * Added the public `instance` argument to `create_autospec` * Support for using Java exceptions as a `side_effect` on Jython * Improved failure messages for `assert_called_with` and `assert_called_once_with` * Tuples as well as lists can be used to specify allowed methods for `spec` & `spec_set` arguments * BUGFIX: Fixed bug in `patch.multiple` for argument passing when creating mocks * Added license file to the distribution 2011/07/16 Version 0.8.0 alpha 2 -------------------------------- * `patch.multiple` for doing multiple patches in a single call, using keyword arguments * New `new_callable` argument to `patch` and `patch.object` allowing you to pass in a class or callable object (instead of `MagicMock`) that will be called to replace the object being patched * Addition of `NonCallableMock` and `NonCallableMagicMock`, mocks without a `__call__` method * Mocks created by `patch` have a `MagicMock` as the `return_value` where a class is being patched * `create_autospec` can create non-callable mocks for non-callable objects. `return_value` mocks of classes will be non-callable unless the class has a `__call__` method * `autospec` creates a `MagicMock` without a spec for properties and slot descriptors, because we don't know the type of object they return * Removed the "inherit" argument from `create_autospec` * Calling `stop` on an unstarted patcher fails with a more meaningful error message * BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in place * BUGFIX: `__truediv__` and `__rtruediv__` not available as magic methods on mocks in Python 3 * BUGFIX: `assert_called_with` / `assert_called_once_with` can be used with `self` as a keyword argument * BUGFIX: autospec for functions / methods with an argument named self that isn't the first argument no longer broken * BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance") * BUGFIX: remove the `__unittest` marker causing traceback truncation 2011/06/14 Version 0.8.0 alpha 1 -------------------------------- mock 0.8.0 is the last version that will support Python 2.4. * The patchers (`patch`, `patch.object` and `patch.dict`), plus `Mock` and `MagicMock`, take arbitrary keyword arguments for configuration * New mock method `configure_mock` for setting attributes and return values / side effects on the mock and its attributes * In Python 2.6 or more recent, `dir` on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes. * Module level `FILTER_DIR` added to control whether `dir(mock)` filters private attributes. `True` by default. Note that `vars(Mock())` can still be used to get all instance attributes and `dir(type(Mock())` will still return all the other attributes (irrespective of `FILTER_DIR`) * `patch` and `patch.object` now create a `MagicMock` instead of a `Mock` by default * Added `ANY` for ignoring arguments in `assert_called_with` calls * Addition of `call` helper object * Protocol methods on `MagicMock` are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a MagicMock instead of a Mock as it was previously * Added the Mock API (`assert_called_with` etc) to functions created by `mocksignature` * Private attributes `_name`, `_methods`, '_children', `_wraps` and `_parent` (etc) renamed to reduce likelihood of clash with user attributes. * Implemented auto-speccing (recursive, lazy speccing of mocks with mocked signatures for functions/methods) Limitations: - Doesn't mock magic methods or attributes (it creates MagicMocks, so the magic methods are *there*, they just don't have the signature mocked nor are attributes followed) - Doesn't mock function / method attributes - Uses object traversal on the objects being mocked to determine types - so properties etc may be triggered - The return value of mocked classes (the 'instance') has the same call signature as the class __init__ (as they share the same spec) You create auto-specced mocks by passing `autospec=True` to `patch`. Note that attributes that are None are special cased and mocked without a spec (so any attribute / method can be used). This is because None is typically used as a default value for attributes that may be of some other type, and as we don't know what type that may be we allow all access. Note that the `autospec` option to `patch` obsoletes the `mocksignature` option. * Added the `create_autospec` function for manually creating 'auto-specced' mocks * Removal of deprecated `patch_object` 2011/05/30 Version 0.7.2 ------------------------ * BUGFIX: instances of list subclasses can now be used as mock specs * BUGFIX: MagicMock equality / inequality protocol methods changed to use the default equality / inequality. This is done through a `side_effect` on the mocks used for `__eq__` / `__ne__` 2011/05/06 Version 0.7.1 ------------------------ Package fixes contributed by Michael Fladischer. No code changes. * Include template in package * Use isolated binaries for the tox tests * Unset executable bit on docs * Fix DOS line endings in getting-started.txt 2011/03/05 Version 0.7.0 ------------------------ No API changes since 0.7.0 rc1. Many documentation changes including a stylish new `Sphinx theme `_. The full set of changes since 0.6.0 are: * Python 3 compatibility * Ability to mock magic methods with `Mock` and addition of `MagicMock` with pre-created magic methods * Addition of `mocksignature` and `mocksignature` argument to `patch` and `patch.object` * Addition of `patch.dict` for changing dictionaries during a test * Ability to use `patch`, `patch.object` and `patch.dict` as class decorators * Renamed ``patch_object`` to `patch.object` (``patch_object`` is deprecated) * Addition of soft comparisons: `call_args`, `call_args_list` and `method_calls` now return tuple-like objects which compare equal even when empty args or kwargs are skipped * patchers (`patch`, `patch.object` and `patch.dict`) have start and stop methods * Addition of `assert_called_once_with` method * Mocks can now be named (`name` argument to constructor) and the name is used in the repr * repr of a mock with a spec includes the class name of the spec * `assert_called_with` works with `python -OO` * New `spec_set` keyword argument to `Mock` and `patch`. If used, attempting to *set* an attribute on a mock not on the spec will raise an `AttributeError` * Mocks created with a spec can now pass `isinstance` tests (`__class__` returns the type of the spec) * Added docstrings to all objects * Improved failure message for `Mock.assert_called_with` when the mock has not been called at all * Decorated functions / methods have their docstring and `__module__` preserved on Python 2.4. * BUGFIX: `mock.patch` now works correctly with certain types of objects that proxy attribute access, like the django settings object * BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this) * BUGFIX: `spec=True` works with old style classes * BUGFIX: ``help(mock)`` works now (on the module). Can no longer use ``__bases__`` as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this) * BUGFIX: ``side_effect`` now works with ``BaseException`` exceptions like ``KeyboardInterrupt`` * BUGFIX: `reset_mock` caused infinite recursion when a mock is set as its own return value * BUGFIX: patching the same object twice now restores the patches correctly * with statement tests now skipped on Python 2.4 * Tests require unittest2 (or unittest2-py3k) to run * Tested with `tox `_ on Python 2.4 - 3.2, jython and pypy (excluding 3.0) * Added 'build_sphinx' command to setup.py (requires setuptools or distribute) Thanks to Florian Bauer * Switched from subversion to mercurial for source code control * `Konrad Delong `_ added as co-maintainer 2011/02/16 Version 0.7.0 RC 1 ----------------------------- Changes since beta 4: * Tested with jython, pypy and Python 3.2 and 3.1 * Decorated functions / methods have their docstring and `__module__` preserved on Python 2.4 * BUGFIX: `mock.patch` now works correctly with certain types of objects that proxy attribute access, like the django settings object * BUGFIX: `reset_mock` caused infinite recursion when a mock is set as its own return value 2010/11/12 Version 0.7.0 beta 4 ------------------------------- * patchers (`patch`, `patch.object` and `patch.dict`) have start and stop methods * Addition of `assert_called_once_with` method * repr of a mock with a spec includes the class name of the spec * `assert_called_with` works with `python -OO` * New `spec_set` keyword argument to `Mock` and `patch`. If used, attempting to *set* an attribute on a mock not on the spec will raise an `AttributeError` * Attributes and return value of a `MagicMock` are `MagicMock` objects * Attempting to set an unsupported magic method now raises an `AttributeError` * `patch.dict` works as a class decorator * Switched from subversion to mercurial for source code control * BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this) * BUGFIX: `spec=True` works with old style classes * BUGFIX: `mocksignature=True` can now patch instance methods via `patch.object` 2010/09/18 Version 0.7.0 beta 3 ------------------------------- * Using spec with :class:`MagicMock` only pre-creates magic methods in the spec * Setting a magic method on a mock with a ``spec`` can only be done if the spec has that method * Mocks can now be named (`name` argument to constructor) and the name is used in the repr * `mocksignature` can now be used with classes (signature based on `__init__`) and callable objects (signature based on `__call__`) * Mocks created with a spec can now pass `isinstance` tests (`__class__` returns the type of the spec) * Default numeric value for MagicMock is 1 rather than zero (because the MagicMock bool defaults to True and 0 is False) * Improved failure message for :meth:`~Mock.assert_called_with` when the mock has not been called at all * Adding the following to the set of supported magic methods: - ``__getformat__`` and ``__setformat__`` - pickle methods - ``__trunc__``, ``__ceil__`` and ``__floor__`` - ``__sizeof__`` * Added 'build_sphinx' command to setup.py (requires setuptools or distribute) Thanks to Florian Bauer * with statement tests now skipped on Python 2.4 * Tests require unittest2 to run on Python 2.7 * Improved several docstrings and documentation 2010/06/23 Version 0.7.0 beta 2 ------------------------------- * :func:`patch.dict` works as a context manager as well as a decorator * ``patch.dict`` takes a string to specify dictionary as well as a dictionary object. If a string is supplied the name specified is imported * BUGFIX: ``patch.dict`` restores dictionary even when an exception is raised 2010/06/22 Version 0.7.0 beta 1 ------------------------------- * Addition of :func:`mocksignature` * Ability to mock magic methods * Ability to use ``patch`` and ``patch.object`` as class decorators * Renamed ``patch_object`` to :func:`patch.object` (``patch_object`` is deprecated) * Addition of :class:`MagicMock` class with all magic methods pre-created for you * Python 3 compatibility (tested with 3.2 but should work with 3.0 & 3.1 as well) * Addition of :func:`patch.dict` for changing dictionaries during a test * Addition of ``mocksignature`` argument to ``patch`` and ``patch.object`` * ``help(mock)`` works now (on the module). Can no longer use ``__bases__`` as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this) * Addition of soft comparisons: `call_args`, `call_args_list` and `method_calls` now return tuple-like objects which compare equal even when empty args or kwargs are skipped * Added docstrings. * BUGFIX: ``side_effect`` now works with ``BaseException`` exceptions like ``KeyboardInterrupt`` * BUGFIX: patching the same object twice now restores the patches correctly * The tests now require `unittest2 `_ to run * `Konrad Delong `_ added as co-maintainer 2009/08/22 Version 0.6.0 ------------------------ * New test layout compatible with test discovery * Descriptors (static methods / class methods etc) can now be patched and restored correctly * Mocks can raise exceptions when called by setting ``side_effect`` to an exception class or instance * Mocks that wrap objects will not pass on calls to the underlying object if an explicit return_value is set 2009/04/17 Version 0.5.0 ------------------------ * Made DEFAULT part of the public api. * Documentation built with Sphinx. * ``side_effect`` is now called with the same arguments as the mock is called with and if returns a non-DEFAULT value that is automatically set as the ``mock.return_value``. * ``wraps`` keyword argument used for wrapping objects (and passing calls through to the wrapped object). * ``Mock.reset`` renamed to ``Mock.reset_mock``, as reset is a common API name. * ``patch`` / ``patch_object`` are now context managers and can be used with ``with``. * A new 'create' keyword argument to patch and patch_object that allows them to patch (and unpatch) attributes that don't exist. (Potentially unsafe to use - it can allow you to have tests that pass when they are testing an API that doesn't exist - use at your own risk!) * The methods keyword argument to Mock has been removed and merged with spec. The spec argument can now be a list of methods or an object to take the spec from. * Nested patches may now be applied in a different order (created mocks passed in the opposite order). This is actually a bugfix. * patch and patch_object now take a spec keyword argument. If spec is passed in as 'True' then the Mock created will take the object it is replacing as its spec object. If the object being replaced is a class, then the return value for the mock will also use the class as a spec. * A Mock created without a spec will not attempt to mock any magic methods / attributes (they will raise an ``AttributeError`` instead). 2008/10/12 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) * Can now patch objects with ``None`` * 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). Thanks to Konrad Delong, Kevin Dangoor and others for patches and suggestions. 2007/12/03 Version 0.3.1 ------------------------- ``patch`` maintains the name of decorated functions for compatibility with nose test autodiscovery. Tests decorated with ``patch`` that use the two argument form (implicit mock creation) will receive the mock(s) passed in as extra arguments. Thanks to Kevin Dangoor for these changes. 2007/11/30 Version 0.3.0 ------------------------- Removed ``patch_module``. ``patch`` can now take a string as the first argument for patching modules. 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 ------------------------- 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. Added ``sentinel`` for convenient access to unique objects. Distribution includes unit tests. 2007/11/19 Version 0.1.0 ------------------------- Initial release. TODO and Limitations ==================== Contributions, bug reports and comments welcomed! Feature requests and bug reports are handled on the issue tracker: * `mock issue tracker `_ `wraps` is not integrated with magic methods. `patch` could auto-do the patching in the constructor and unpatch in the destructor. This would be useful in itself, but violates TOOWTDI and would be unsafe for IronPython & PyPy (non-deterministic calling of destructors). Destructors aren't called in CPython where there are cycles, but a weak reference with a callback can be used to get round this. `Mock` has several attributes. This makes it unsuitable for mocking objects that use these attribute names. A way round this would be to provide methods that *hide* these attributes when needed. In 0.8 many, but not all, of these attributes are renamed to gain a `_mock` prefix, making it less likely that they will clash. Any outstanding attributes that haven't been modified with the prefix should be changed. If a patch is started using `patch.start` and then not stopped correctly then the unpatching is not done. Using weak references it would be possible to detect and fix this when the patch object itself is garbage collected. This would be tricky to get right though. When a `Mock` is created by `patch`, arbitrary keywords can be used to set attributes. If `patch` is created with a `spec`, and is replacing a class, then a `return_value` mock is created. The keyword arguments are not applied to the child mock, but could be. When mocking a class with `patch`, passing in `spec=True` or `autospec=True`, the mock class has an instance created from the same spec. Should this be the default behaviour for mocks anyway (mock return values inheriting the spec from their parent), or should it be controlled by an additional keyword argument (`inherit`) to the Mock constructor? `create_autospec` does this, so an additional keyword argument to Mock is probably unnecessary. The `mocksignature` argument to `patch` with a non `Mock` passed into `new_callable` will *probably* cause an error. Should it just be invalid? Note that `NonCallableMock` and `NonCallableMagicMock` still have the unused (and unusable) attributes: `return_value`, `side_effect`, `call_count`, `call_args` and `call_args_list`. These could be removed or raise errors on getting / setting. They also have the `assert_called_with` and `assert_called_once_with` methods. Removing these would be pointless as fetching them would create a mock (attribute) that could be called without error. Some outstanding technical debt. The way autospeccing mocks function signatures was copied and modified from `mocksignature`. This could all be refactored into one set of functions instead of two. The way we tell if patchers are started and if a patcher is being used for a `patch.multiple` call are both horrible. There are now a host of helper functions that should be rationalised. (Probably time to split mock into a package instead of a module.) Passing arbitrary keyword arguments to `create_autospec`, or `patch` with `autospec`, when mocking a *function* works fine. However, the arbitrary attributes are set on the created mock - but `create_autospec` returns a real function (which doesn't have those attributes). However, what is the use case for using autospec to create functions with attributes that don't exist on the original? `mocksignature`, plus the `call_args_list` and `method_calls` attributes of `Mock` could all be deprecated. mock-1.0.1/docs/compare.txt0000644000076500001200000004116611677634532016316 0ustar michaeladmin00000000000000========================= Mock Library Comparison ========================= .. testsetup:: def assertEqual(a, b): assert a == b, ("%r != %r" % (a, b)) def assertRaises(Exc, func): try: func() except Exc: return assert False, ("%s not raised" % Exc) sys.modules['somemodule'] = somemodule = mock.Mock(name='somemodule') class SomeException(Exception): some_method = method1 = method2 = None some_other_object = SomeObject = SomeException A side-by-side comparison of how to accomplish some basic tasks with mock and some other popular Python mocking libraries and frameworks. These are: * `flexmock `_ * `mox `_ * `Mocker `_ * `dingus `_ * `fudge `_ Popular python mocking frameworks not yet represented here include `MiniMock `_. `pMock `_ (last release 2004 and doesn't import in recent versions of Python) and `python-mock `_ (last release 2005) are intentionally omitted. .. note:: A more up to date, and tested for all mock libraries (only the mock examples on this page can be executed as doctests) version of this comparison is maintained by Gary Bernhardt: * `Python Mock Library Comparison `_ This comparison is by no means complete, and also may not be fully idiomatic for all the libraries represented. *Please* contribute corrections, missing comparisons, or comparisons for additional libraries to the `mock issue tracker `_. This comparison page was originally created by the `Mox project `_ and then extended for `flexmock and mock `_ by Herman Sheremetyev. Dingus examples written by `Gary Bernhadt `_. fudge examples provided by `Kumar McMillan `_. .. note:: The examples tasks here were originally created by Mox which is a mocking *framework* rather than a library like mock. The tasks shown naturally exemplify tasks that frameworks are good at and not the ones they make harder. In particular you can take a `Mock` or `MagicMock` object and use it in any way you want with no up-front configuration. The same is also true for Dingus. The examples for mock here assume version 0.7.0. Simple fake object ~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.return_value = "calculated value" >>> my_mock.some_attribute = "value" >>> assertEqual("calculated value", my_mock.some_method()) >>> assertEqual("value", my_mock.some_attribute) :: # Flexmock mock = flexmock(some_method=lambda: "calculated value", some_attribute="value") assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) # Mox mock = mox.MockAnything() mock.some_method().AndReturn("calculated value") mock.some_attribute = "value" mox.Replay(mock) assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) # Mocker mock = mocker.mock() mock.some_method() mocker.result("calculated value") mocker.replay() mock.some_attribute = "value" assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) :: >>> # Dingus >>> my_dingus = dingus.Dingus(some_attribute="value", ... some_method__returns="calculated value") >>> assertEqual("calculated value", my_dingus.some_method()) >>> assertEqual("value", my_dingus.some_attribute) :: >>> # fudge >>> my_fake = (fudge.Fake() ... .provides('some_method') ... .returns("calculated value") ... .has_attr(some_attribute="value")) ... >>> assertEqual("calculated value", my_fake.some_method()) >>> assertEqual("value", my_fake.some_attribute) Simple mock ~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.return_value = "value" >>> assertEqual("value", my_mock.some_method()) >>> my_mock.some_method.assert_called_once_with() :: # Flexmock mock = flexmock() mock.should_receive("some_method").and_return("value").once assertEqual("value", mock.some_method()) # Mox mock = mox.MockAnything() mock.some_method().AndReturn("value") mox.Replay(mock) assertEqual("value", mock.some_method()) mox.Verify(mock) # Mocker mock = mocker.mock() mock.some_method() mocker.result("value") mocker.replay() assertEqual("value", mock.some_method()) mocker.verify() :: >>> # Dingus >>> my_dingus = dingus.Dingus(some_method__returns="value") >>> assertEqual("value", my_dingus.some_method()) >>> assert my_dingus.some_method.calls().once() :: >>> # fudge >>> @fudge.test ... def test(): ... my_fake = (fudge.Fake() ... .expects('some_method') ... .returns("value") ... .times_called(1)) ... >>> test() Traceback (most recent call last): ... AssertionError: fake:my_fake.some_method() was not called Creating partial mocks ~~~~~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> SomeObject.some_method = mock.Mock(return_value='value') >>> assertEqual("value", SomeObject.some_method()) :: # Flexmock flexmock(SomeObject).should_receive("some_method").and_return('value') assertEqual("value", mock.some_method()) # Mox mock = mox.MockObject(SomeObject) mock.some_method().AndReturn("value") mox.Replay(mock) assertEqual("value", mock.some_method()) mox.Verify(mock) # Mocker mock = mocker.mock(SomeObject) mock.Get() mocker.result("value") mocker.replay() assertEqual("value", mock.some_method()) mocker.verify() :: >>> # Dingus >>> object = SomeObject >>> object.some_method = dingus.Dingus(return_value="value") >>> assertEqual("value", object.some_method()) :: >>> # fudge >>> fake = fudge.Fake().is_callable().returns("") >>> with fudge.patched_context(SomeObject, 'some_method', fake): ... s = SomeObject() ... assertEqual("", s.some_method()) ... Ensure calls are made in specific order ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock(spec=SomeObject) >>> my_mock.method1() >>> my_mock.method2() >>> assertEqual(my_mock.mock_calls, [call.method1(), call.method2()]) :: # Flexmock mock = flexmock(SomeObject) mock.should_receive('method1').once.ordered.and_return('first thing') mock.should_receive('method2').once.ordered.and_return('second thing') # Mox mock = mox.MockObject(SomeObject) mock.method1().AndReturn('first thing') mock.method2().AndReturn('second thing') mox.Replay(mock) mox.Verify(mock) # Mocker mock = mocker.mock() with mocker.order(): mock.method1() mocker.result('first thing') mock.method2() mocker.result('second thing') mocker.replay() mocker.verify() :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.method1() >>> my_dingus.method2() >>> assertEqual(['method1', 'method2'], [call.name for call in my_dingus.calls]) :: >>> # fudge >>> @fudge.test ... def test(): ... my_fake = (fudge.Fake() ... .remember_order() ... .expects('method1') ... .expects('method2')) ... my_fake.method2() ... my_fake.method1() ... >>> test() Traceback (most recent call last): ... AssertionError: Call #1 was fake:my_fake.method2(); Expected: #1 fake:my_fake.method1(), #2 fake:my_fake.method2(), end Raising exceptions ~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.side_effect = SomeException("message") >>> assertRaises(SomeException, my_mock.some_method) :: # Flexmock mock = flexmock() mock.should_receive("some_method").and_raise(SomeException("message")) assertRaises(SomeException, mock.some_method) # Mox mock = mox.MockAnything() mock.some_method().AndRaise(SomeException("message")) mox.Replay(mock) assertRaises(SomeException, mock.some_method) mox.Verify(mock) # Mocker mock = mocker.mock() mock.some_method() mocker.throw(SomeException("message")) mocker.replay() assertRaises(SomeException, mock.some_method) mocker.verify() :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.some_method = dingus.exception_raiser(SomeException) >>> assertRaises(SomeException, my_dingus.some_method) :: >>> # fudge >>> my_fake = (fudge.Fake() ... .is_callable() ... .raises(SomeException("message"))) ... >>> my_fake() Traceback (most recent call last): ... SomeException: message Override new instances of a class ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> with mock.patch('somemodule.Someclass') as MockClass: ... MockClass.return_value = some_other_object ... assertEqual(some_other_object, somemodule.Someclass()) ... :: # Flexmock flexmock(some_module.SomeClass, new_instances=some_other_object) assertEqual(some_other_object, some_module.SomeClass()) # Mox # (you will probably have mox.Mox() available as self.mox in a real test) mox.Mox().StubOutWithMock(some_module, 'SomeClass', use_mock_anything=True) some_module.SomeClass().AndReturn(some_other_object) mox.ReplayAll() assertEqual(some_other_object, some_module.SomeClass()) # Mocker instance = mocker.mock() klass = mocker.replace(SomeClass, spec=None) klass('expected', 'args') mocker.result(instance) :: >>> # Dingus >>> MockClass = dingus.Dingus(return_value=some_other_object) >>> with dingus.patch('somemodule.SomeClass', MockClass): ... assertEqual(some_other_object, somemodule.SomeClass()) ... :: >>> # fudge >>> @fudge.patch('somemodule.SomeClass') ... def test(FakeClass): ... FakeClass.is_callable().returns(some_other_object) ... assertEqual(some_other_object, somemodule.SomeClass()) ... >>> test() Call the same method multiple times ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. note:: You don't need to do *any* configuration to call `mock.Mock()` methods multiple times. Attributes like `call_count`, `call_args_list` and `method_calls` provide various different ways of making assertions about how the mock was used. .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method() >>> my_mock.some_method() >>> assert my_mock.some_method.call_count >= 2 :: # Flexmock # (verifies that the method gets called at least twice) flexmock(some_object).should_receive('some_method').at_least.twice # Mox # (does not support variable number of calls, so you need to create a new entry for each explicit call) mock = mox.MockObject(some_object) mock.some_method(mox.IgnoreArg(), mox.IgnoreArg()) mock.some_method(mox.IgnoreArg(), mox.IgnoreArg()) mox.Replay(mock) mox.Verify(mock) # Mocker # (TODO) :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.some_method() >>> my_dingus.some_method() >>> assert len(my_dingus.calls('some_method')) == 2 :: >>> # fudge >>> @fudge.test ... def test(): ... my_fake = fudge.Fake().expects('some_method').times_called(2) ... my_fake.some_method() ... >>> test() Traceback (most recent call last): ... AssertionError: fake:my_fake.some_method() was called 1 time(s). Expected 2. Mock chained methods ~~~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> method3 = my_mock.method1.return_value.method2.return_value.method3 >>> method3.return_value = 'some value' >>> assertEqual('some value', my_mock.method1().method2().method3(1, 2)) >>> method3.assert_called_once_with(1, 2) :: # Flexmock # (intermediate method calls are automatically assigned to temporary fake objects # and can be called with any arguments) flexmock(some_object).should_receive( 'method1.method2.method3' ).with_args(arg1, arg2).and_return('some value') assertEqual('some_value', some_object.method1().method2().method3(arg1, arg2)) :: # Mox mock = mox.MockObject(some_object) mock2 = mox.MockAnything() mock3 = mox.MockAnything() mock.method1().AndReturn(mock1) mock2.method2().AndReturn(mock2) mock3.method3(arg1, arg2).AndReturn('some_value') self.mox.ReplayAll() assertEqual("some_value", some_object.method1().method2().method3(arg1, arg2)) self.mox.VerifyAll() # Mocker # (TODO) :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> method3 = my_dingus.method1.return_value.method2.return_value.method3 >>> method3.return_value = 'some value' >>> assertEqual('some value', my_dingus.method1().method2().method3(1, 2)) >>> assert method3.calls('()', 1, 2).once() :: >>> # fudge >>> @fudge.test ... def test(): ... my_fake = fudge.Fake() ... (my_fake ... .expects('method1') ... .returns_fake() ... .expects('method2') ... .returns_fake() ... .expects('method3') ... .with_args(1, 2) ... .returns('some value')) ... assertEqual('some value', my_fake.method1().method2().method3(1, 2)) ... >>> test() Mocking a context manager ~~~~~~~~~~~~~~~~~~~~~~~~~ Examples for mock, Dingus and fudge only (so far): .. doctest:: >>> # mock >>> my_mock = mock.MagicMock() >>> with my_mock: ... pass ... >>> my_mock.__enter__.assert_called_with() >>> my_mock.__exit__.assert_called_with(None, None, None) :: >>> # Dingus (nothing special here; all dinguses are "magic mocks") >>> my_dingus = dingus.Dingus() >>> with my_dingus: ... pass ... >>> assert my_dingus.__enter__.calls() >>> assert my_dingus.__exit__.calls('()', None, None, None) :: >>> # fudge >>> my_fake = fudge.Fake().provides('__enter__').provides('__exit__') >>> with my_fake: ... pass ... Mocking the builtin open used as a context manager ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Example for mock only (so far): .. doctest:: >>> # mock >>> my_mock = mock.MagicMock() >>> with mock.patch('__builtin__.open', my_mock): ... manager = my_mock.return_value.__enter__.return_value ... manager.read.return_value = 'some data' ... with open('foo') as h: ... data = h.read() ... >>> data 'some data' >>> my_mock.assert_called_once_with('foo') *or*: .. doctest:: >>> # mock >>> with mock.patch('__builtin__.open') as my_mock: ... my_mock.return_value.__enter__ = lambda s: s ... my_mock.return_value.__exit__ = mock.Mock() ... my_mock.return_value.read.return_value = 'some data' ... with open('foo') as h: ... data = h.read() ... >>> data 'some data' >>> my_mock.assert_called_once_with('foo') :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> with dingus.patch('__builtin__.open', my_dingus): ... file_ = open.return_value.__enter__.return_value ... file_.read.return_value = 'some data' ... with open('foo') as h: ... data = f.read() ... >>> data 'some data' >>> assert my_dingus.calls('()', 'foo').once() :: >>> # fudge >>> from contextlib import contextmanager >>> from StringIO import StringIO >>> @contextmanager ... def fake_file(filename): ... yield StringIO('sekrets') ... >>> with fudge.patch('__builtin__.open') as fake_open: ... fake_open.is_callable().calls(fake_file) ... with open('/etc/password') as f: ... data = f.read() ... fake:__builtin__.open >>> data 'sekrets'mock-1.0.1/docs/conf.py0000644000076500001200000001424611703275243015413 0ustar michaeladmin00000000000000# -*- coding: utf-8 -*- # # Mock documentation build configuration file, created by # sphinx-quickstart on Mon Nov 17 18:12:00 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module imports are okay, they're removed automatically). # # All configuration values have a default value; values that are commented out # serve to show the default value. import sys, os sys.path.insert(0, os.path.abspath('..')) from mock import __version__ # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. #sys.path.append(os.path.abspath('some/directory')) # General configuration # --------------------- # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.doctest'] doctest_global_setup = """ import os import sys import mock from mock import * # yeah, I know :-/ import unittest2 import __main__ if os.getcwd() not in sys.path: sys.path.append(os.getcwd()) # keep a reference to __main__ sys.modules['__main'] = __main__ class ProxyModule(object): def __init__(self): self.__dict__ = globals() sys.modules['__main__'] = ProxyModule() """ doctest_global_cleanup = """ sys.modules['__main__'] = sys.modules['__main'] """ html_theme = 'nature' html_theme_options = {} # Add any paths that contain templates here, relative to this directory. #templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.txt' # The master toctree document. master_doc = 'index' # General substitutions. project = u'Mock' copyright = u'2007-2012, Michael Foord & the mock team' # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. # # The short X.Y version. version = __version__[:3] # The full version, including alpha/beta/rc tags. release = __version__ # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. today_fmt = '%B %d, %Y' # List of documents that shouldn't be included in the build. #unused_docs = [] # List of directories, relative to source directories, that shouldn't be searched # for source files. exclude_trees = [] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). add_module_names = False # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'friendly' # Options for HTML output # ----------------------- # The style sheet to use for HTML and HTML Help pages. A file of that name # must exist either in Sphinx' static/ path, or in one of the custom paths # given in html_static_path. #html_style = 'adctheme.css' # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. html_use_modindex = False # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, the reST sources are included in the HTML build as _sources/. #html_copy_source = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = '' # Output file base name for HTML help builder. htmlhelp_basename = 'Mockdoc' # Options for LaTeX output # ------------------------ # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). latex_font_size = '12pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, document class [howto/manual]). latex_documents = [ ('index', 'Mock.tex', u'Mock Documentation', u'Michael Foord', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. latex_use_modindex = Falsemock-1.0.1/docs/examples.txt0000644000076500001200000010646311745371250016477 0ustar michaeladmin00000000000000.. _further-examples: ================== Further Examples ================== .. currentmodule:: mock .. testsetup:: from datetime import date BackendProvider = Mock() sys.modules['mymodule'] = mymodule = Mock(name='mymodule') def grob(val): "First frob and then clear val" mymodule.frob(val) val.clear() mymodule.frob = lambda val: val mymodule.grob = grob mymodule.date = date class TestCase(unittest2.TestCase): def run(self): result = unittest2.TestResult() out = unittest2.TestCase.run(self, result) assert result.wasSuccessful() from mock import inPy3k For comprehensive examples, see the unit tests included in the full source distribution. Here are some more examples for some slightly more advanced scenarios than in the :ref:`getting started ` guide. Mocking chained calls ===================== Mocking chained calls is actually straightforward with mock once you understand the :attr:`~Mock.return_value` attribute. When a mock is called for the first time, or you fetch its `return_value` before it has been called, a new `Mock` is created. This means that you can see how the object returned from a call to a mocked object has been used by interrogating the `return_value` mock: .. doctest:: >>> mock = Mock() >>> mock().foo(a=2, b=3) >>> mock.return_value.foo.assert_called_with(a=2, b=3) From here it is a simple step to configure and then make assertions about chained calls. Of course another alternative is writing your code in a more testable way in the first place... So, suppose we have some code that looks a little bit like this: .. doctest:: >>> class Something(object): ... def __init__(self): ... self.backend = BackendProvider() ... def method(self): ... response = self.backend.get_endpoint('foobar').create_call('spam', 'eggs').start_call() ... # more code Assuming that `BackendProvider` is already well tested, how do we test `method()`? Specifically, we want to test that the code section `# more code` uses the response object in the correct way. As this chain of calls is made from an instance attribute we can monkey patch the `backend` attribute on a `Something` instance. In this particular case we are only interested in the return value from the final call to `start_call` so we don't have much configuration to do. Let's assume the object it returns is 'file-like', so we'll ensure that our response object uses the builtin `file` as its `spec`. To do this we create a mock instance as our mock backend and create a mock response object for it. To set the response as the return value for that final `start_call` we could do this: `mock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value = mock_response`. We can do that in a slightly nicer way using the :meth:`~Mock.configure_mock` method to directly set the return value for us: .. doctest:: >>> something = Something() >>> mock_response = Mock(spec=file) >>> mock_backend = Mock() >>> config = {'get_endpoint.return_value.create_call.return_value.start_call.return_value': mock_response} >>> mock_backend.configure_mock(**config) With these we monkey patch the "mock backend" in place and can make the real call: .. doctest:: >>> something.backend = mock_backend >>> something.method() Using :attr:`~Mock.mock_calls` we can check the chained call with a single assert. A chained call is several calls in one line of code, so there will be several entries in `mock_calls`. We can use :meth:`call.call_list` to create this list of calls for us: .. doctest:: >>> chained = call.get_endpoint('foobar').create_call('spam', 'eggs').start_call() >>> call_list = chained.call_list() >>> assert mock_backend.mock_calls == call_list Partial mocking =============== In some tests I wanted to mock out a call to `datetime.date.today() `_ to return a known date, but I didn't want to prevent the code under test from creating new date objects. Unfortunately `datetime.date` is written in C, and so I couldn't just monkey-patch out the static `date.today` method. I found a simple way of doing this that involved effectively wrapping the date class with a mock, but passing through calls to the constructor to the real class (and returning real instances). The :func:`patch decorator ` is used here to mock out the `date` class in the module under test. The :attr:`side_effect` attribute on the mock date class is then set to a lambda function that returns a real date. When the mock date class is called a real date will be constructed and returned by `side_effect`. .. doctest:: >>> from datetime import date >>> with patch('mymodule.date') as mock_date: ... mock_date.today.return_value = date(2010, 10, 8) ... mock_date.side_effect = lambda *args, **kw: date(*args, **kw) ... ... assert mymodule.date.today() == date(2010, 10, 8) ... assert mymodule.date(2009, 6, 8) == date(2009, 6, 8) ... Note that we don't patch `datetime.date` globally, we patch `date` in the module that *uses* it. See :ref:`where to patch `. When `date.today()` is called a known date is returned, but calls to the `date(...)` constructor still return normal dates. Without this you can find yourself having to calculate an expected result using exactly the same algorithm as the code under test, which is a classic testing anti-pattern. Calls to the date constructor are recorded in the `mock_date` attributes (`call_count` and friends) which may also be useful for your tests. An alternative way of dealing with mocking dates, or other builtin classes, is discussed in `this blog entry `_. Mocking a Generator Method ========================== A Python generator is a function or method that uses the `yield statement `_ to return a series of values when iterated over [#]_. A generator method / function is called to return the generator object. It is the generator object that is then iterated over. The protocol method for iteration is `__iter__ `_, so we can mock this using a `MagicMock`. Here's an example class with an "iter" method implemented as a generator: .. doctest:: >>> class Foo(object): ... def iter(self): ... for i in [1, 2, 3]: ... yield i ... >>> foo = Foo() >>> list(foo.iter()) [1, 2, 3] How would we mock this class, and in particular its "iter" method? To configure the values returned from the iteration (implicit in the call to `list`), we need to configure the object returned by the call to `foo.iter()`. .. doctest:: >>> mock_foo = MagicMock() >>> mock_foo.iter.return_value = iter([1, 2, 3]) >>> list(mock_foo.iter()) [1, 2, 3] .. [#] There are also generator expressions and more `advanced uses `_ of generators, but we aren't concerned about them here. A very good introduction to generators and how powerful they are is: `Generator Tricks for Systems Programmers `_. Applying the same patch to every test method ============================================ If you want several patches in place for multiple test methods the obvious way is to apply the patch decorators to every method. This can feel like unnecessary repetition. For Python 2.6 or more recent you can use `patch` (in all its various forms) as a class decorator. This applies the patches to all test methods on the class. A test method is identified by methods whose names start with `test`: .. doctest:: >>> @patch('mymodule.SomeClass') ... class MyTest(TestCase): ... ... def test_one(self, MockSomeClass): ... self.assertTrue(mymodule.SomeClass is MockSomeClass) ... ... def test_two(self, MockSomeClass): ... self.assertTrue(mymodule.SomeClass is MockSomeClass) ... ... def not_a_test(self): ... return 'something' ... >>> MyTest('test_one').test_one() >>> MyTest('test_two').test_two() >>> MyTest('test_two').not_a_test() 'something' An alternative way of managing patches is to use the :ref:`start-and-stop`. These allow you to move the patching into your `setUp` and `tearDown` methods. .. doctest:: >>> class MyTest(TestCase): ... def setUp(self): ... self.patcher = patch('mymodule.foo') ... self.mock_foo = self.patcher.start() ... ... def test_foo(self): ... self.assertTrue(mymodule.foo is self.mock_foo) ... ... def tearDown(self): ... self.patcher.stop() ... >>> MyTest('test_foo').run() If you use this technique you must ensure that the patching is "undone" by calling `stop`. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. `unittest2 `_ cleanup functions make this simpler: .. doctest:: >>> class MyTest(TestCase): ... def setUp(self): ... patcher = patch('mymodule.foo') ... self.addCleanup(patcher.stop) ... self.mock_foo = patcher.start() ... ... def test_foo(self): ... self.assertTrue(mymodule.foo is self.mock_foo) ... >>> MyTest('test_foo').run() Mocking Unbound Methods ======================= Whilst writing tests today I needed to patch an *unbound method* (patching the method on the class rather than on the instance). I needed self to be passed in as the first argument because I want to make asserts about which objects were calling this particular method. The issue is that you can't patch with a mock for this, because if you replace an unbound method with a mock it doesn't become a bound method when fetched from the instance, and so it doesn't get self passed in. The workaround is to patch the unbound method with a real function instead. The :func:`patch` decorator makes it so simple to patch out methods with a mock that having to create a real function becomes a nuisance. If you pass `autospec=True` to patch then it does the patching with a *real* function object. This function object has the same signature as the one it is replacing, but delegates to a mock under the hood. You still get your mock auto-created in exactly the same way as before. What it means though, is that if you use it to patch out an unbound method on a class the mocked function will be turned into a bound method if it is fetched from an instance. It will have `self` passed in as the first argument, which is exactly what I wanted: .. doctest:: >>> class Foo(object): ... def foo(self): ... pass ... >>> with patch.object(Foo, 'foo', autospec=True) as mock_foo: ... mock_foo.return_value = 'foo' ... foo = Foo() ... foo.foo() ... 'foo' >>> mock_foo.assert_called_once_with(foo) If we don't use `autospec=True` then the unbound method is patched out with a Mock instance instead, and isn't called with `self`. Checking multiple calls with mock ================================= mock has a nice API for making assertions about how your mock objects are used. .. doctest:: >>> mock = Mock() >>> mock.foo_bar.return_value = None >>> mock.foo_bar('baz', spam='eggs') >>> mock.foo_bar.assert_called_with('baz', spam='eggs') If your mock is only being called once you can use the :meth:`assert_called_once_with` method that also asserts that the :attr:`call_count` is one. .. doctest:: >>> mock.foo_bar.assert_called_once_with('baz', spam='eggs') >>> mock.foo_bar() >>> mock.foo_bar.assert_called_once_with('baz', spam='eggs') Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times. Both `assert_called_with` and `assert_called_once_with` make assertions about the *most recent* call. If your mock is going to be called several times, and you want to make assertions about *all* those calls you can use :attr:`~Mock.call_args_list`: .. doctest:: >>> mock = Mock(return_value=None) >>> mock(1, 2, 3) >>> mock(4, 5, 6) >>> mock() >>> mock.call_args_list [call(1, 2, 3), call(4, 5, 6), call()] The :data:`call` helper makes it easy to make assertions about these calls. You can build up a list of expected calls and compare it to `call_args_list`. This looks remarkably similar to the repr of the `call_args_list`: .. doctest:: >>> expected = [call(1, 2, 3), call(4, 5, 6), call()] >>> mock.call_args_list == expected True Coping with mutable arguments ============================= Another situation is rare, but can bite you, is when your mock is called with mutable arguments. `call_args` and `call_args_list` store *references* to the arguments. If the arguments are mutated by the code under test then you can no longer make assertions about what the values were when the mock was called. Here's some example code that shows the problem. Imagine the following functions defined in 'mymodule':: def frob(val): pass def grob(val): "First frob and then clear val" frob(val) val.clear() When we try to test that `grob` calls `frob` with the correct argument look what happens: .. doctest:: >>> with patch('mymodule.frob') as mock_frob: ... val = set([6]) ... mymodule.grob(val) ... >>> val set([]) >>> mock_frob.assert_called_with(set([6])) Traceback (most recent call last): ... AssertionError: Expected: ((set([6]),), {}) Called with: ((set([]),), {}) One possibility would be for mock to copy the arguments you pass in. This could then cause problems if you do assertions that rely on object identity for equality. Here's one solution that uses the :attr:`side_effect` functionality. If you provide a `side_effect` function for a mock then `side_effect` will be called with the same args as the mock. This gives us an opportunity to copy the arguments and store them for later assertions. In this example I'm using *another* mock to store the arguments so that I can use the mock methods for doing the assertion. Again a helper function sets this up for me. .. doctest:: >>> from copy import deepcopy >>> from mock import Mock, patch, DEFAULT >>> def copy_call_args(mock): ... new_mock = Mock() ... def side_effect(*args, **kwargs): ... args = deepcopy(args) ... kwargs = deepcopy(kwargs) ... new_mock(*args, **kwargs) ... return DEFAULT ... mock.side_effect = side_effect ... return new_mock ... >>> with patch('mymodule.frob') as mock_frob: ... new_mock = copy_call_args(mock_frob) ... val = set([6]) ... mymodule.grob(val) ... >>> new_mock.assert_called_with(set([6])) >>> new_mock.call_args call(set([6])) `copy_call_args` is called with the mock that will be called. It returns a new mock that we do the assertion on. The `side_effect` function makes a copy of the args and calls our `new_mock` with the copy. .. note:: If your mock is only going to be used once there is an easier way of checking arguments at the point they are called. You can simply do the checking inside a `side_effect` function. .. doctest:: >>> def side_effect(arg): ... assert arg == set([6]) ... >>> mock = Mock(side_effect=side_effect) >>> mock(set([6])) >>> mock(set()) Traceback (most recent call last): ... AssertionError An alternative approach is to create a subclass of `Mock` or `MagicMock` that copies (using `copy.deepcopy `_) the arguments. Here's an example implementation: .. doctest:: >>> from copy import deepcopy >>> class CopyingMock(MagicMock): ... def __call__(self, *args, **kwargs): ... args = deepcopy(args) ... kwargs = deepcopy(kwargs) ... return super(CopyingMock, self).__call__(*args, **kwargs) ... >>> c = CopyingMock(return_value=None) >>> arg = set() >>> c(arg) >>> arg.add(1) >>> c.assert_called_with(set()) >>> c.assert_called_with(arg) Traceback (most recent call last): ... AssertionError: Expected call: mock(set([1])) Actual call: mock(set([])) >>> c.foo When you subclass `Mock` or `MagicMock` all dynamically created attributes, and the `return_value` will use your subclass automatically. That means all children of a `CopyingMock` will also have the type `CopyingMock`. Raising exceptions on attribute access ====================================== You can use :class:`PropertyMock` to mimic the behaviour of properties. This includes raising exceptions when an attribute is accessed. Here's an example raising a `ValueError` when the 'foo' attribute is accessed: .. doctest:: >>> m = MagicMock() >>> p = PropertyMock(side_effect=ValueError) >>> type(m).foo = p >>> m.foo Traceback (most recent call last): .... ValueError Because every mock object has its own type, a new subclass of whichever mock class you're using, all mock objects are isolated from each other. You can safely attach properties (or other descriptors or whatever you want in fact) to `type(mock)` without affecting other mock objects. Multiple calls with different effects ===================================== .. note:: In mock 1.0 the handling of iterable `side_effect` was changed. Any exceptions in the iterable will be raised instead of returned. Handling code that needs to behave differently on subsequent calls during the test can be tricky. For example you may have a function that needs to raise an exception the first time it is called but returns a response on the second call (testing retry behaviour). One approach is to use a :attr:`side_effect` function that replaces itself. The first time it is called the `side_effect` sets a new `side_effect` that will be used for the second call. It then raises an exception: .. doctest:: >>> def side_effect(*args): ... def second_call(*args): ... return 'response' ... mock.side_effect = second_call ... raise Exception('boom') ... >>> mock = Mock(side_effect=side_effect) >>> mock('first') Traceback (most recent call last): ... Exception: boom >>> mock('second') 'response' >>> mock.assert_called_with('second') Another perfectly valid way would be to pop return values from a list. If the return value is an exception, raise it instead of returning it: .. doctest:: >>> returns = [Exception('boom'), 'response'] >>> def side_effect(*args): ... result = returns.pop(0) ... if isinstance(result, Exception): ... raise result ... return result ... >>> mock = Mock(side_effect=side_effect) >>> mock('first') Traceback (most recent call last): ... Exception: boom >>> mock('second') 'response' >>> mock.assert_called_with('second') Which approach you prefer is a matter of taste. The first approach is actually a line shorter but maybe the second approach is more readable. Nesting Patches =============== Using patch as a context manager is nice, but if you do multiple patches you can end up with nested with statements indenting further and further to the right: .. doctest:: >>> class MyTest(TestCase): ... ... def test_foo(self): ... with patch('mymodule.Foo') as mock_foo: ... with patch('mymodule.Bar') as mock_bar: ... with patch('mymodule.Spam') as mock_spam: ... assert mymodule.Foo is mock_foo ... assert mymodule.Bar is mock_bar ... assert mymodule.Spam is mock_spam ... >>> original = mymodule.Foo >>> MyTest('test_foo').test_foo() >>> assert mymodule.Foo is original With unittest2_ `cleanup` functions and the :ref:`start-and-stop` we can achieve the same effect without the nested indentation. A simple helper method, `create_patch`, puts the patch in place and returns the created mock for us: .. doctest:: >>> class MyTest(TestCase): ... ... def create_patch(self, name): ... patcher = patch(name) ... thing = patcher.start() ... self.addCleanup(patcher.stop) ... return thing ... ... def test_foo(self): ... mock_foo = self.create_patch('mymodule.Foo') ... mock_bar = self.create_patch('mymodule.Bar') ... mock_spam = self.create_patch('mymodule.Spam') ... ... assert mymodule.Foo is mock_foo ... assert mymodule.Bar is mock_bar ... assert mymodule.Spam is mock_spam ... >>> original = mymodule.Foo >>> MyTest('test_foo').run() >>> assert mymodule.Foo is original Mocking a dictionary with MagicMock =================================== You may want to mock a dictionary, or other container object, recording all access to it whilst having it still behave like a dictionary. We can do this with :class:`MagicMock`, which will behave like a dictionary, and using :data:`~Mock.side_effect` to delegate dictionary access to a real underlying dictionary that is under our control. When the `__getitem__` and `__setitem__` methods of our `MagicMock` are called (normal dictionary access) then `side_effect` is called with the key (and in the case of `__setitem__` the value too). We can also control what is returned. After the `MagicMock` has been used we can use attributes like :data:`~Mock.call_args_list` to assert about how the dictionary was used: .. doctest:: >>> my_dict = {'a': 1, 'b': 2, 'c': 3} >>> def getitem(name): ... return my_dict[name] ... >>> def setitem(name, val): ... my_dict[name] = val ... >>> mock = MagicMock() >>> mock.__getitem__.side_effect = getitem >>> mock.__setitem__.side_effect = setitem .. note:: An alternative to using `MagicMock` is to use `Mock` and *only* provide the magic methods you specifically want: .. doctest:: >>> mock = Mock() >>> mock.__setitem__ = Mock(side_effect=getitem) >>> mock.__getitem__ = Mock(side_effect=setitem) A *third* option is to use `MagicMock` but passing in `dict` as the `spec` (or `spec_set`) argument so that the `MagicMock` created only has dictionary magic methods available: .. doctest:: >>> mock = MagicMock(spec_set=dict) >>> mock.__getitem__.side_effect = getitem >>> mock.__setitem__.side_effect = setitem With these side effect functions in place, the `mock` will behave like a normal dictionary but recording the access. It even raises a `KeyError` if you try to access a key that doesn't exist. .. doctest:: >>> mock['a'] 1 >>> mock['c'] 3 >>> mock['d'] Traceback (most recent call last): ... KeyError: 'd' >>> mock['b'] = 'fish' >>> mock['d'] = 'eggs' >>> mock['b'] 'fish' >>> mock['d'] 'eggs' After it has been used you can make assertions about the access using the normal mock methods and attributes: .. doctest:: >>> mock.__getitem__.call_args_list [call('a'), call('c'), call('d'), call('b'), call('d')] >>> mock.__setitem__.call_args_list [call('b', 'fish'), call('d', 'eggs')] >>> my_dict {'a': 1, 'c': 3, 'b': 'fish', 'd': 'eggs'} Mock subclasses and their attributes ==================================== There are various reasons why you might want to subclass `Mock`. One reason might be to add helper methods. Here's a silly example: .. doctest:: >>> class MyMock(MagicMock): ... def has_been_called(self): ... return self.called ... >>> mymock = MyMock(return_value=None) >>> mymock >>> mymock.has_been_called() False >>> mymock() >>> mymock.has_been_called() True The standard behaviour for `Mock` instances is that attributes and the return value mocks are of the same type as the mock they are accessed on. This ensures that `Mock` attributes are `Mocks` and `MagicMock` attributes are `MagicMocks` [#]_. So if you're subclassing to add helper methods then they'll also be available on the attributes and return value mock of instances of your subclass. .. doctest:: >>> mymock.foo >>> mymock.foo.has_been_called() False >>> mymock.foo() >>> mymock.foo.has_been_called() True Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted adaptor `_. Having this applied to attributes too actually causes errors. `Mock` (in all its flavours) uses a method called `_get_child_mock` to create these "sub-mocks" for attributes and return values. You can prevent your subclass being used for attributes by overriding this method. The signature is that it takes arbitrary keyword arguments (`**kwargs`) which are then passed onto the mock constructor: .. doctest:: >>> class Subclass(MagicMock): ... def _get_child_mock(self, **kwargs): ... return MagicMock(**kwargs) ... >>> mymock = Subclass() >>> mymock.foo >>> assert isinstance(mymock, Subclass) >>> assert not isinstance(mymock.foo, Subclass) >>> assert not isinstance(mymock(), Subclass) .. [#] An exception to this rule are the non-callable mocks. Attributes use the callable variant because otherwise non-callable mocks couldn't have callable methods. Mocking imports with patch.dict =============================== One situation where mocking can be hard is where you have a local import inside a function. These are harder to mock because they aren't using an object from the module namespace that we can patch out. Generally local imports are to be avoided. They are sometimes done to prevent circular dependencies, for which there is *usually* a much better way to solve the problem (refactor the code) or to prevent "up front costs" by delaying the import. This can also be solved in better ways than an unconditional local import (store the module as a class or module attribute and only do the import on first use). That aside there is a way to use `mock` to affect the results of an import. Importing fetches an *object* from the `sys.modules` dictionary. Note that it fetches an *object*, which need not be a module. Importing a module for the first time results in a module object being put in `sys.modules`, so usually when you import something you get a module back. This need not be the case however. This means you can use :func:`patch.dict` to *temporarily* put a mock in place in `sys.modules`. Any imports whilst this patch is active will fetch the mock. When the patch is complete (the decorated function exits, the with statement body is complete or `patcher.stop()` is called) then whatever was there previously will be restored safely. Here's an example that mocks out the 'fooble' module. .. doctest:: >>> mock = Mock() >>> with patch.dict('sys.modules', {'fooble': mock}): ... import fooble ... fooble.blob() ... >>> assert 'fooble' not in sys.modules >>> mock.blob.assert_called_once_with() As you can see the `import fooble` succeeds, but on exit there is no 'fooble' left in `sys.modules`. This also works for the `from module import name` form: .. doctest:: >>> mock = Mock() >>> with patch.dict('sys.modules', {'fooble': mock}): ... from fooble import blob ... blob.blip() ... >>> mock.blob.blip.assert_called_once_with() With slightly more work you can also mock package imports: .. doctest:: >>> mock = Mock() >>> modules = {'package': mock, 'package.module': mock.module} >>> with patch.dict('sys.modules', modules): ... from package.module import fooble ... fooble() ... >>> mock.module.fooble.assert_called_once_with() Tracking order of calls and less verbose call assertions ======================================================== The :class:`Mock` class allows you to track the *order* of method calls on your mock objects through the :attr:`~Mock.method_calls` attribute. This doesn't allow you to track the order of calls between separate mock objects, however we can use :attr:`~Mock.mock_calls` to achieve the same effect. Because mocks track calls to child mocks in `mock_calls`, and accessing an arbitrary attribute of a mock creates a child mock, we can create our separate mocks from a parent one. Calls to those child mock will then all be recorded, in order, in the `mock_calls` of the parent: .. doctest:: >>> manager = Mock() >>> mock_foo = manager.foo >>> mock_bar = manager.bar >>> mock_foo.something() >>> mock_bar.other.thing() >>> manager.mock_calls [call.foo.something(), call.bar.other.thing()] We can then assert about the calls, including the order, by comparing with the `mock_calls` attribute on the manager mock: .. doctest:: >>> expected_calls = [call.foo.something(), call.bar.other.thing()] >>> manager.mock_calls == expected_calls True If `patch` is creating, and putting in place, your mocks then you can attach them to a manager mock using the :meth:`~Mock.attach_mock` method. After attaching calls will be recorded in `mock_calls` of the manager. .. doctest:: >>> manager = MagicMock() >>> with patch('mymodule.Class1') as MockClass1: ... with patch('mymodule.Class2') as MockClass2: ... manager.attach_mock(MockClass1, 'MockClass1') ... manager.attach_mock(MockClass2, 'MockClass2') ... MockClass1().foo() ... MockClass2().bar() ... >>> manager.mock_calls [call.MockClass1(), call.MockClass1().foo(), call.MockClass2(), call.MockClass2().bar()] If many calls have been made, but you're only interested in a particular sequence of them then an alternative is to use the :meth:`~Mock.assert_has_calls` method. This takes a list of calls (constructed with the :data:`call` object). If that sequence of calls are in :attr:`~Mock.mock_calls` then the assert succeeds. .. doctest:: >>> m = MagicMock() >>> m().foo().bar().baz() >>> m.one().two().three() >>> calls = call.one().two().three().call_list() >>> m.assert_has_calls(calls) Even though the chained call `m.one().two().three()` aren't the only calls that have been made to the mock, the assert still succeeds. Sometimes a mock may have several calls made to it, and you are only interested in asserting about *some* of those calls. You may not even care about the order. In this case you can pass `any_order=True` to `assert_has_calls`: .. doctest:: >>> m = MagicMock() >>> m(1), m.two(2, 3), m.seven(7), m.fifty('50') (...) >>> calls = [call.fifty('50'), call(1), call.seven(7)] >>> m.assert_has_calls(calls, any_order=True) More complex argument matching ============================== Using the same basic concept as `ANY` we can implement matchers to do more complex assertions on objects used as arguments to mocks. Suppose we expect some object to be passed to a mock that by default compares equal based on object identity (which is the Python default for user defined classes). To use :meth:`~Mock.assert_called_with` we would need to pass in the exact same object. If we are only interested in some of the attributes of this object then we can create a matcher that will check these attributes for us. You can see in this example how a 'standard' call to `assert_called_with` isn't sufficient: .. doctest:: >>> class Foo(object): ... def __init__(self, a, b): ... self.a, self.b = a, b ... >>> mock = Mock(return_value=None) >>> mock(Foo(1, 2)) >>> mock.assert_called_with(Foo(1, 2)) Traceback (most recent call last): ... AssertionError: Expected: call(<__main__.Foo object at 0x...>) Actual call: call(<__main__.Foo object at 0x...>) A comparison function for our `Foo` class might look something like this: .. doctest:: >>> def compare(self, other): ... if not type(self) == type(other): ... return False ... if self.a != other.a: ... return False ... if self.b != other.b: ... return False ... return True ... And a matcher object that can use comparison functions like this for its equality operation would look something like this: .. doctest:: >>> class Matcher(object): ... def __init__(self, compare, some_obj): ... self.compare = compare ... self.some_obj = some_obj ... def __eq__(self, other): ... return self.compare(self.some_obj, other) ... Putting all this together: .. doctest:: >>> match_foo = Matcher(compare, Foo(1, 2)) >>> mock.assert_called_with(match_foo) The `Matcher` is instantiated with our compare function and the `Foo` object we want to compare against. In `assert_called_with` the `Matcher` equality method will be called, which compares the object the mock was called with against the one we created our matcher with. If they match then `assert_called_with` passes, and if they don't an `AssertionError` is raised: .. doctest:: >>> match_wrong = Matcher(compare, Foo(3, 4)) >>> mock.assert_called_with(match_wrong) Traceback (most recent call last): ... AssertionError: Expected: ((,), {}) Called with: ((,), {}) With a bit of tweaking you could have the comparison function raise the `AssertionError` directly and provide a more useful failure message. As of version 1.5, the Python testing library `PyHamcrest `_ provides similar functionality, that may be useful here, in the form of its equality matcher (`hamcrest.library.integration.match_equality `_). Less verbose configuration of mock objects ========================================== This recipe, for easier configuration of mock objects, is now part of `Mock`. See the :meth:`~Mock.configure_mock` method. Matching any argument in assertions =================================== This example is now built in to mock. See :data:`ANY`. Mocking Properties ================== This example is now built in to mock. See :class:`PropertyMock`. Mocking open ============ This example is now built in to mock. See :func:`mock_open`. Mocks without some attributes ============================= This example is now built in to mock. See :ref:`deleting-attributes`. mock-1.0.1/docs/getting-started.txt0000644000076500000240000003505611742100665020000 0ustar michaelstaff00000000000000=========================== Getting Started with Mock =========================== .. _getting-started: .. index:: Getting Started .. testsetup:: class SomeClass(object): static_method = None class_method = None attribute = None sys.modules['package'] = package = Mock(name='package') sys.modules['package.module'] = module = package.module sys.modules['module'] = package.module Using Mock ========== Mock Patching Methods --------------------- Common uses for :class:`Mock` objects include: * Patching methods * Recording method calls on objects You might want to replace a method on an object to check that it is called with the correct arguments by another part of the system: .. doctest:: >>> real = SomeClass() >>> real.method = MagicMock(name='method') >>> real.method(3, 4, 5, key='value') Once our mock has been used (`real.method` in this example) it has methods and attributes that allow you to make assertions about how it has been used. .. note:: In most of these examples the :class:`Mock` and :class:`MagicMock` classes are interchangeable. As the `MagicMock` is the more capable class it makes a sensible one to use by default. Once the mock has been called its :attr:`~Mock.called` attribute is set to `True`. More importantly we can use the :meth:`~Mock.assert_called_with` or :meth:`~Mock.assert_called_once_with` method to check that it was called with the correct arguments. This example tests that calling `ProductionClass().method` results in a call to the `something` method: .. doctest:: >>> from mock import MagicMock >>> class ProductionClass(object): ... def method(self): ... self.something(1, 2, 3) ... def something(self, a, b, c): ... pass ... >>> real = ProductionClass() >>> real.something = MagicMock() >>> real.method() >>> real.something.assert_called_once_with(1, 2, 3) Mock for Method Calls on an Object ---------------------------------- In the last example we patched a method directly on an object to check that it was called correctly. Another common use case is to pass an object into a method (or some part of the system under test) and then check that it is used in the correct way. The simple `ProductionClass` below has a `closer` method. If it is called with an object then it calls `close` on it. .. doctest:: >>> class ProductionClass(object): ... def closer(self, something): ... something.close() ... So to test it we need to pass in an object with a `close` method and check that it was called correctly. .. doctest:: >>> real = ProductionClass() >>> mock = Mock() >>> real.closer(mock) >>> mock.close.assert_called_with() We don't have to do any work to provide the 'close' method on our mock. Accessing close creates it. So, if 'close' hasn't already been called then accessing it in the test will create it, but :meth:`~Mock.assert_called_with` will raise a failure exception. Mocking Classes --------------- A common use case is to mock out classes instantiated by your code under test. When you patch a class, then that class is replaced with a mock. Instances are created by *calling the class*. This means you access the "mock instance" by looking at the return value of the mocked class. In the example below we have a function `some_function` that instantiates `Foo` and calls a method on it. The call to `patch` replaces the class `Foo` with a mock. The `Foo` instance is the result of calling the mock, so it is configured by modifying the mock :attr:`~Mock.return_value`. .. doctest:: >>> def some_function(): ... instance = module.Foo() ... return instance.method() ... >>> with patch('module.Foo') as mock: ... instance = mock.return_value ... instance.method.return_value = 'the result' ... result = some_function() ... assert result == 'the result' Naming your mocks ----------------- It can be useful to give your mocks a name. The name is shown in the repr of the mock and can be helpful when the mock appears in test failure messages. The name is also propagated to attributes or methods of the mock: .. doctest:: >>> mock = MagicMock(name='foo') >>> mock >>> mock.method Tracking all Calls ------------------ Often you want to track more than a single call to a method. The :attr:`~Mock.mock_calls` attribute records all calls to child attributes of the mock - and also to their children. .. doctest:: >>> mock = MagicMock() >>> mock.method() >>> mock.attribute.method(10, x=53) >>> mock.mock_calls [call.method(), call.attribute.method(10, x=53)] If you make an assertion about `mock_calls` and any unexpected methods have been called, then the assertion will fail. This is useful because as well as asserting that the calls you expected have been made, you are also checking that they were made in the right order and with no additional calls: You use the :data:`call` object to construct lists for comparing with `mock_calls`: .. doctest:: >>> expected = [call.method(), call.attribute.method(10, x=53)] >>> mock.mock_calls == expected True Setting Return Values and Attributes ------------------------------------ Setting the return values on a mock object is trivially easy: .. doctest:: >>> mock = Mock() >>> mock.return_value = 3 >>> mock() 3 Of course you can do the same for methods on the mock: .. doctest:: >>> mock = Mock() >>> mock.method.return_value = 3 >>> mock.method() 3 The return value can also be set in the constructor: .. doctest:: >>> mock = Mock(return_value=3) >>> mock() 3 If you need an attribute setting on your mock, just do it: .. doctest:: >>> mock = Mock() >>> mock.x = 3 >>> mock.x 3 Sometimes you want to mock up a more complex situation, like for example `mock.connection.cursor().execute("SELECT 1")`. If we wanted this call to return a list, then we have to configure the result of the nested call. We can use :data:`call` to construct the set of calls in a "chained call" like this for easy assertion afterwards: .. doctest:: >>> mock = Mock() >>> cursor = mock.connection.cursor.return_value >>> cursor.execute.return_value = ['foo'] >>> mock.connection.cursor().execute("SELECT 1") ['foo'] >>> expected = call.connection.cursor().execute("SELECT 1").call_list() >>> mock.mock_calls [call.connection.cursor(), call.connection.cursor().execute('SELECT 1')] >>> mock.mock_calls == expected True It is the call to `.call_list()` that turns our call object into a list of calls representing the chained calls. Raising exceptions with mocks ----------------------------- A useful attribute is :attr:`~Mock.side_effect`. If you set this to an exception class or instance then the exception will be raised when the mock is called. .. doctest:: >>> mock = Mock(side_effect=Exception('Boom!')) >>> mock() Traceback (most recent call last): ... Exception: Boom! Side effect functions and iterables ----------------------------------- `side_effect` can also be set to a function or an iterable. The use case for `side_effect` as an iterable is where your mock is going to be called several times, and you want each call to return a different value. When you set `side_effect` to an iterable every call to the mock returns the next value from the iterable: .. doctest:: >>> mock = MagicMock(side_effect=[4, 5, 6]) >>> mock() 4 >>> mock() 5 >>> mock() 6 For more advanced use cases, like dynamically varying the return values depending on what the mock is called with, `side_effect` can be a function. The function will be called with the same arguments as the mock. Whatever the function returns is what the call returns: .. doctest:: >>> vals = {(1, 2): 1, (2, 3): 2} >>> def side_effect(*args): ... return vals[args] ... >>> mock = MagicMock(side_effect=side_effect) >>> mock(1, 2) 1 >>> mock(2, 3) 2 Creating a Mock from an Existing Object --------------------------------------- One problem with over use of mocking is that it couples your tests to the implementation of your mocks rather than your real code. Suppose you have a class that implements `some_method`. In a test for another class, you provide a mock of this object that *also* provides `some_method`. If later you refactor the first class, so that it no longer has `some_method` - then your tests will continue to pass even though your code is now broken! `Mock` allows you to provide an object as a specification for the mock, using the `spec` keyword argument. Accessing methods / attributes on the mock that don't exist on your specification object will immediately raise an attribute error. If you change the implementation of your specification, then tests that use that class will start failing immediately without you having to instantiate the class in those tests. .. doctest:: >>> mock = Mock(spec=SomeClass) >>> mock.old_method() Traceback (most recent call last): ... AttributeError: object has no attribute 'old_method' If you want a stronger form of specification that prevents the setting of arbitrary attributes as well as the getting of them then you can use `spec_set` instead of `spec`. Patch Decorators ================ .. note:: With `patch` it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read :ref:`where to patch `. A common need in tests is to patch a class attribute or a module attribute, for example patching a builtin or patching a class in a module to test that it is instantiated. Modules and classes are effectively global, so patching on them has to be undone after the test or the patch will persist into other tests and cause hard to diagnose problems. mock provides three convenient decorators for this: `patch`, `patch.object` and `patch.dict`. `patch` takes a single string, of the form `package.module.Class.attribute` to specify the attribute you are patching. It also optionally takes a value that you want the attribute (or class or whatever) to be replaced with. 'patch.object' takes an object and the name of the attribute you would like patched, plus optionally the value to patch it with. `patch.object`: .. doctest:: >>> original = SomeClass.attribute >>> @patch.object(SomeClass, 'attribute', sentinel.attribute) ... def test(): ... assert SomeClass.attribute == sentinel.attribute ... >>> test() >>> assert SomeClass.attribute == original >>> @patch('package.module.attribute', sentinel.attribute) ... def test(): ... from package.module import attribute ... assert attribute is sentinel.attribute ... >>> test() If you are patching a module (including `__builtin__`) then use `patch` instead of `patch.object`: .. doctest:: >>> mock = MagicMock(return_value = sentinel.file_handle) >>> with patch('__builtin__.open', mock): ... handle = open('filename', 'r') ... >>> mock.assert_called_with('filename', 'r') >>> assert handle == sentinel.file_handle, "incorrect file handle returned" The module name can be 'dotted', in the form `package.module` if needed: .. doctest:: >>> @patch('package.module.ClassName.attribute', sentinel.attribute) ... def test(): ... from package.module import ClassName ... assert ClassName.attribute == sentinel.attribute ... >>> test() A nice pattern is to actually decorate test methods themselves: .. doctest:: >>> class MyTest(unittest2.TestCase): ... @patch.object(SomeClass, 'attribute', sentinel.attribute) ... def test_something(self): ... self.assertEqual(SomeClass.attribute, sentinel.attribute) ... >>> original = SomeClass.attribute >>> MyTest('test_something').test_something() >>> assert SomeClass.attribute == original If you want to patch with a Mock, you can use `patch` with only one argument (or `patch.object` with two arguments). The mock will be created for you and passed into the test function / method: .. doctest:: >>> class MyTest(unittest2.TestCase): ... @patch.object(SomeClass, 'static_method') ... def test_something(self, mock_method): ... SomeClass.static_method() ... mock_method.assert_called_with() ... >>> MyTest('test_something').test_something() You can stack up multiple patch decorators using this pattern: .. doctest:: >>> class MyTest(unittest2.TestCase): ... @patch('package.module.ClassName1') ... @patch('package.module.ClassName2') ... def test_something(self, MockClass2, MockClass1): ... self.assertTrue(package.module.ClassName1 is MockClass1) ... self.assertTrue(package.module.ClassName2 is MockClass2) ... >>> MyTest('test_something').test_something() When you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal *python* order that decorators are applied). This means from the bottom up, so in the example above the mock for `test_module.ClassName2` is passed in first. There is also :func:`patch.dict` for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends: .. doctest:: >>> foo = {'key': 'value'} >>> original = foo.copy() >>> with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == original `patch`, `patch.object` and `patch.dict` can all be used as context managers. Where you use `patch` to create a mock for you, you can get a reference to the mock using the "as" form of the with statement: .. doctest:: >>> class ProductionClass(object): ... def method(self): ... pass ... >>> with patch.object(ProductionClass, 'method') as mock_method: ... mock_method.return_value = None ... real = ProductionClass() ... real.method(1, 2, 3) ... >>> mock_method.assert_called_with(1, 2, 3) As an alternative `patch`, `patch.object` and `patch.dict` can be used as class decorators. When used in this way it is the same as applying the decorator indvidually to every method whose name starts with "test". For some more advanced examples, see the :ref:`further-examples` page. mock-1.0.1/docs/helpers.txt0000644000076500001200000004640211742046462016320 0ustar michaeladmin00000000000000========= Helpers ========= .. currentmodule:: mock .. testsetup:: mock.FILTER_DIR = True from pprint import pprint as pp original_dir = dir def dir(obj): print pp(original_dir(obj)) import urllib2 __main__.urllib2 = urllib2 .. testcleanup:: dir = original_dir mock.FILTER_DIR = True call ==== .. function:: call(*args, **kwargs) `call` is a helper object for making simpler assertions, for comparing with :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock.mock_calls` and :attr: `~Mock.method_calls`. `call` can also be used with :meth:`~Mock.assert_has_calls`. .. doctest:: >>> m = MagicMock(return_value=None) >>> m(1, 2, a='foo', b='bar') >>> m() >>> m.call_args_list == [call(1, 2, a='foo', b='bar'), call()] True .. method:: call.call_list() For a call object that represents multiple calls, `call_list` returns a list of all the intermediate calls as well as the final call. `call_list` is particularly useful for making assertions on "chained calls". A chained call is multiple calls on a single line of code. This results in multiple entries in :attr:`~Mock.mock_calls` on a mock. Manually constructing the sequence of calls can be tedious. :meth:`~call.call_list` can construct the sequence of calls from the same chained call: .. doctest:: >>> m = MagicMock() >>> m(1).method(arg='foo').other('bar')(2.0) >>> kall = call(1).method(arg='foo').other('bar')(2.0) >>> kall.call_list() [call(1), call().method(arg='foo'), call().method().other('bar'), call().method().other()(2.0)] >>> m.mock_calls == kall.call_list() True .. _calls-as-tuples: A `call` object is either a tuple of (positional args, keyword args) or (name, positional args, keyword args) depending on how it was constructed. When you construct them yourself this isn't particularly interesting, but the `call` objects that are in the :attr:`Mock.call_args`, :attr:`Mock.call_args_list` and :attr:`Mock.mock_calls` attributes can be introspected to get at the individual arguments they contain. The `call` objects in :attr:`Mock.call_args` and :attr:`Mock.call_args_list` are two-tuples of (positional args, keyword args) whereas the `call` objects in :attr:`Mock.mock_calls`, along with ones you construct yourself, are three-tuples of (name, positional args, keyword args). You can use their "tupleness" to pull out the individual arguments for more complex introspection and assertions. The positional arguments are a tuple (an empty tuple if there are no positional arguments) and the keyword arguments are a dictionary: .. doctest:: >>> m = MagicMock(return_value=None) >>> m(1, 2, 3, arg='one', arg2='two') >>> kall = m.call_args >>> args, kwargs = kall >>> args (1, 2, 3) >>> kwargs {'arg2': 'two', 'arg': 'one'} >>> args is kall[0] True >>> kwargs is kall[1] True >>> m = MagicMock() >>> m.foo(4, 5, 6, arg='two', arg2='three') >>> kall = m.mock_calls[0] >>> name, args, kwargs = kall >>> name 'foo' >>> args (4, 5, 6) >>> kwargs {'arg2': 'three', 'arg': 'two'} >>> name is m.mock_calls[0][0] True create_autospec =============== .. function:: create_autospec(spec, spec_set=False, instance=False, **kwargs) Create a mock object using another object as a spec. Attributes on the mock will use the corresponding attribute on the `spec` object as their spec. Functions or methods being mocked will have their arguments checked to ensure that they are called with the correct signature. If `spec_set` is `True` then attempting to set attributes that don't exist on the spec object will raise an `AttributeError`. If a class is used as a spec then the return value of the mock (the instance of the class) will have the same spec. You can use a class as the spec for an instance object by passing `instance=True`. The returned mock will only be callable if instances of the mock are callable. `create_autospec` also takes arbitrary keyword arguments that are passed to the constructor of the created mock. See :ref:`auto-speccing` for examples of how to use auto-speccing with `create_autospec` and the `autospec` argument to :func:`patch`. ANY === .. data:: ANY Sometimes you may need to make assertions about *some* of the arguments in a call to mock, but either not care about some of the arguments or want to pull them individually out of :attr:`~Mock.call_args` and make more complex assertions on them. To ignore certain arguments you can pass in objects that compare equal to *everything*. Calls to :meth:`~Mock.assert_called_with` and :meth:`~Mock.assert_called_once_with` will then succeed no matter what was passed in. .. doctest:: >>> mock = Mock(return_value=None) >>> mock('foo', bar=object()) >>> mock.assert_called_once_with('foo', bar=ANY) `ANY` can also be used in comparisons with call lists like :attr:`~Mock.mock_calls`: .. doctest:: >>> m = MagicMock(return_value=None) >>> m(1) >>> m(1, 2) >>> m(object()) >>> m.mock_calls == [call(1), call(1, 2), ANY] True FILTER_DIR ========== .. data:: FILTER_DIR `FILTER_DIR` is a module level variable that controls the way mock objects respond to `dir` (only for Python 2.6 or more recent). The default is `True`, which uses the filtering described below, to only show useful members. If you dislike this filtering, or need to switch it off for diagnostic purposes, then set `mock.FILTER_DIR = False`. With filtering on, `dir(some_mock)` shows only useful attributes and will include any dynamically created attributes that wouldn't normally be shown. If the mock was created with a `spec` (or `autospec` of course) then all the attributes from the original are shown, even if they haven't been accessed yet: .. doctest:: >>> dir(Mock()) ['assert_any_call', 'assert_called_once_with', 'assert_called_with', 'assert_has_calls', 'attach_mock', ... >>> import urllib2 >>> dir(Mock(spec=urllib2)) ['AbstractBasicAuthHandler', 'AbstractDigestAuthHandler', 'AbstractHTTPHandler', 'BaseHandler', ... Many of the not-very-useful (private to `Mock` rather than the thing being mocked) underscore and double underscore prefixed attributes have been filtered from the result of calling `dir` on a `Mock`. If you dislike this behaviour you can switch it off by setting the module level switch `FILTER_DIR`: .. doctest:: >>> import mock >>> mock.FILTER_DIR = False >>> dir(mock.Mock()) ['_NonCallableMock__get_return_value', '_NonCallableMock__get_side_effect', '_NonCallableMock__return_value_doc', '_NonCallableMock__set_return_value', '_NonCallableMock__set_side_effect', '__call__', '__class__', ... Alternatively you can just use `vars(my_mock)` (instance members) and `dir(type(my_mock))` (type members) to bypass the filtering irrespective of `mock.FILTER_DIR`. mock_open ========= .. function:: mock_open(mock=None, read_data=None) A helper function to create a mock to replace the use of `open`. It works for `open` called directly or used as a context manager. The `mock` argument is the mock object to configure. If `None` (the default) then a `MagicMock` will be created for you, with the API limited to methods or attributes available on standard file handles. `read_data` is a string for the `read` method of the file handle to return. This is an empty string by default. Using `open` as a context manager is a great way to ensure your file handles are closed properly and is becoming common:: with open('/some/path', 'w') as f: f.write('something') The issue is that even if you mock out the call to `open` it is the *returned object* that is used as a context manager (and has `__enter__` and `__exit__` called). Mocking context managers with a :class:`MagicMock` is common enough and fiddly enough that a helper function is useful. .. doctest:: >>> from mock import mock_open >>> m = mock_open() >>> with patch('__main__.open', m, create=True): ... with open('foo', 'w') as h: ... h.write('some stuff') ... >>> m.mock_calls [call('foo', 'w'), call().__enter__(), call().write('some stuff'), call().__exit__(None, None, None)] >>> m.assert_called_once_with('foo', 'w') >>> handle = m() >>> handle.write.assert_called_once_with('some stuff') And for reading files: .. doctest:: >>> with patch('__main__.open', mock_open(read_data='bibble'), create=True) as m: ... with open('foo') as h: ... result = h.read() ... >>> m.assert_called_once_with('foo') >>> assert result == 'bibble' .. _auto-speccing: Autospeccing ============ Autospeccing is based on the existing `spec` feature of mock. It limits the api of mocks to the api of an original object (the spec), but it is recursive (implemented lazily) so that attributes of mocks only have the same api as the attributes of the spec. In addition mocked functions / methods have the same call signature as the original so they raise a `TypeError` if they are called incorrectly. Before I explain how auto-speccing works, here's why it is needed. `Mock` is a very powerful and flexible object, but it suffers from two flaws when used to mock out objects from a system under test. One of these flaws is specific to the `Mock` api and the other is a more general problem with using mock objects. First the problem specific to `Mock`. `Mock` has two assert methods that are extremely handy: :meth:`~Mock.assert_called_with` and :meth:`~Mock.assert_called_once_with`. .. doctest:: >>> mock = Mock(name='Thing', return_value=None) >>> mock(1, 2, 3) >>> mock.assert_called_once_with(1, 2, 3) >>> mock(1, 2, 3) >>> mock.assert_called_once_with(1, 2, 3) Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times. Because mocks auto-create attributes on demand, and allow you to call them with arbitrary arguments, if you misspell one of these assert methods then your assertion is gone: .. code-block:: pycon >>> mock = Mock(name='Thing', return_value=None) >>> mock(1, 2, 3) >>> mock.assret_called_once_with(4, 5, 6) Your tests can pass silently and incorrectly because of the typo. The second issue is more general to mocking. If you refactor some of your code, rename members and so on, any tests for code that is still using the *old api* but uses mocks instead of the real objects will still pass. This means your tests can all pass even though your code is broken. Note that this is another reason why you need integration tests as well as unit tests. Testing everything in isolation is all fine and dandy, but if you don't test how your units are "wired together" there is still lots of room for bugs that tests might have caught. `mock` already provides a feature to help with this, called speccing. If you use a class or instance as the `spec` for a mock then you can only access attributes on the mock that exist on the real class: .. doctest:: >>> import urllib2 >>> mock = Mock(spec=urllib2.Request) >>> mock.assret_called_with Traceback (most recent call last): ... AttributeError: Mock object has no attribute 'assret_called_with' The spec only applies to the mock itself, so we still have the same issue with any methods on the mock: .. code-block:: pycon >>> mock.has_data() >>> mock.has_data.assret_called_with() Auto-speccing solves this problem. You can either pass `autospec=True` to `patch` / `patch.object` or use the `create_autospec` function to create a mock with a spec. If you use the `autospec=True` argument to `patch` then the object that is being replaced will be used as the spec object. Because the speccing is done "lazily" (the spec is created as attributes on the mock are accessed) you can use it with very complex or deeply nested objects (like modules that import modules that import modules) without a big performance hit. Here's an example of it in use: .. doctest:: >>> import urllib2 >>> patcher = patch('__main__.urllib2', autospec=True) >>> mock_urllib2 = patcher.start() >>> urllib2 is mock_urllib2 True >>> urllib2.Request You can see that `urllib2.Request` has a spec. `urllib2.Request` takes two arguments in the constructor (one of which is `self`). Here's what happens if we try to call it incorrectly: .. doctest:: >>> req = urllib2.Request() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (1 given) The spec also applies to instantiated classes (i.e. the return value of specced mocks): .. doctest:: >>> req = urllib2.Request('foo') >>> req `Request` objects are not callable, so the return value of instantiating our mocked out `urllib2.Request` is a non-callable mock. With the spec in place any typos in our asserts will raise the correct error: .. doctest:: >>> req.add_header('spam', 'eggs') >>> req.add_header.assret_called_with Traceback (most recent call last): ... AttributeError: Mock object has no attribute 'assret_called_with' >>> req.add_header.assert_called_with('spam', 'eggs') In many cases you will just be able to add `autospec=True` to your existing `patch` calls and then be protected against bugs due to typos and api changes. As well as using `autospec` through `patch` there is a :func:`create_autospec` for creating autospecced mocks directly: .. doctest:: >>> import urllib2 >>> mock_urllib2 = create_autospec(urllib2) >>> mock_urllib2.Request('foo', 'bar') This isn't without caveats and limitations however, which is why it is not the default behaviour. In order to know what attributes are available on the spec object, autospec has to introspect (access attributes) the spec. As you traverse attributes on the mock a corresponding traversal of the original object is happening under the hood. If any of your specced objects have properties or descriptors that can trigger code execution then you may not be able to use autospec. On the other hand it is much better to design your objects so that introspection is safe [#]_. A more serious problem is that it is common for instance attributes to be created in the `__init__` method and not to exist on the class at all. `autospec` can't know about any dynamically created attributes and restricts the api to visible attributes. .. doctest:: >>> class Something(object): ... def __init__(self): ... self.a = 33 ... >>> with patch('__main__.Something', autospec=True): ... thing = Something() ... thing.a ... Traceback (most recent call last): ... AttributeError: Mock object has no attribute 'a' There are a few different ways of resolving this problem. The easiest, but not necessarily the least annoying, way is to simply set the required attributes on the mock after creation. Just because `autospec` doesn't allow you to fetch attributes that don't exist on the spec it doesn't prevent you setting them: .. doctest:: >>> with patch('__main__.Something', autospec=True): ... thing = Something() ... thing.a = 33 ... There is a more aggressive version of both `spec` and `autospec` that *does* prevent you setting non-existent attributes. This is useful if you want to ensure your code only *sets* valid attributes too, but obviously it prevents this particular scenario: .. doctest:: >>> with patch('__main__.Something', autospec=True, spec_set=True): ... thing = Something() ... thing.a = 33 ... Traceback (most recent call last): ... AttributeError: Mock object has no attribute 'a' Probably the best way of solving the problem is to add class attributes as default values for instance members initialised in `__init__`. Note that if you are only setting default attributes in `__init__` then providing them via class attributes (shared between instances of course) is faster too. e.g. .. code-block:: python class Something(object): a = 33 This brings up another issue. It is relatively common to provide a default value of `None` for members that will later be an object of a different type. `None` would be useless as a spec because it wouldn't let you access *any* attributes or methods on it. As `None` is *never* going to be useful as a spec, and probably indicates a member that will normally of some other type, `autospec` doesn't use a spec for members that are set to `None`. These will just be ordinary mocks (well - `MagicMocks`): .. doctest:: >>> class Something(object): ... member = None ... >>> mock = create_autospec(Something) >>> mock.member.foo.bar.baz() If modifying your production classes to add defaults isn't to your liking then there are more options. One of these is simply to use an instance as the spec rather than the class. The other is to create a subclass of the production class and add the defaults to the subclass without affecting the production class. Both of these require you to use an alternative object as the spec. Thankfully `patch` supports this - you can simply pass the alternative object as the `autospec` argument: .. doctest:: >>> class Something(object): ... def __init__(self): ... self.a = 33 ... >>> class SomethingForTest(Something): ... a = 33 ... >>> p = patch('__main__.Something', autospec=SomethingForTest) >>> mock = p.start() >>> mock.a .. note:: An additional limitation (currently) with `autospec` is that unbound methods on mocked classes *don't* take an "explicit self" as the first argument - so this usage will fail with `autospec`. .. doctest:: >>> class Foo(object): ... def foo(self): ... pass ... >>> Foo.foo(Foo()) >>> MockFoo = create_autospec(Foo) >>> MockFoo.foo(MockFoo()) Traceback (most recent call last): ... TypeError: () takes exactly 1 argument (2 given) The reason is that its very hard to tell the difference between functions, unbound methods and staticmethods across Python 2 & 3 and the alternative implementations. This restriction may be fixed in future versions. ------ .. [#] This only applies to classes or already instantiated objects. Calling a mocked class to create a mock instance *does not* create a real instance. It is only attribute lookups - along with calls to `dir` - that are done. A way round this problem would have been to use `getattr_static `_, which can fetch attributes without triggering code execution. Descriptors like `classmethod` and `staticmethod` *need* to be fetched correctly though, so that their signatures can be mocked correctly. mock-1.0.1/docs/index.txt0000644000076500001200000003252512034411261015752 0ustar michaeladmin00000000000000==================================== Mock - Mocking and Testing Library ==================================== .. currentmodule:: mock :Author: `Michael Foord `_ :Version: |release| :Date: 2012/10/07 :Homepage: `Mock Homepage`_ :Download: `Mock on PyPI`_ :Documentation: `PDF Documentation `_ :License: `BSD License`_ :Support: `Mailing list (testing-in-python@lists.idyll.org) `_ :Issue tracker: `Google code project `_ .. _Mock Homepage: http://www.voidspace.org.uk/python/mock/ .. _BSD License: http://www.voidspace.org.uk/python/license.shtml .. currentmodule:: mock .. module:: mock :synopsis: Mock object and testing library. .. index:: introduction mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used. mock is now part of the Python standard library, available as `unittest.mock `_ in Python 3.3 onwards. mock provides a core :class:`Mock` class removing the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way. Additionally, mock provides a :func:`patch` decorator that handles patching module and class level attributes within the scope of a test, along with :const:`sentinel` for creating unique objects. See the `quick guide`_ for some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:`patch`. Mock is very easy to use and is designed for use with `unittest `_. Mock is based on the 'action -> assertion' pattern instead of `'record -> replay'` used by many mocking frameworks. mock is tested on Python versions 2.4-2.7, Python 3 plus the latest versions of Jython and PyPy. .. testsetup:: class ProductionClass(object): def method(self, *args): pass module = sys.modules['module'] = ProductionClass ProductionClass.ClassName1 = ProductionClass ProductionClass.ClassName2 = ProductionClass API Documentation ================= .. toctree:: :maxdepth: 2 mock patch helpers sentinel magicmock User Guide ========== .. toctree:: :maxdepth: 2 getting-started examples compare changelog .. index:: installing Installing ========== The current version is |release|. Mock is stable and widely used. If you do find any bugs, or have suggestions for improvements / extensions then please contact us. * `mock on PyPI `_ * `mock documentation as PDF `_ * `Google Code Home & Mercurial Repository `_ .. index:: repository .. index:: hg You can checkout the latest development version from the Google Code Mercurial repository with the following command: ``hg clone https://mock.googlecode.com/hg/ mock`` .. index:: pip .. index:: easy_install .. index:: setuptools If you have pip, setuptools or distribute you can install mock with: | ``easy_install -U mock`` | ``pip install -U mock`` Alternatively you can download the mock distribution from PyPI and after unpacking run: ``python setup.py install`` Quick Guide =========== :class:`Mock` and :class:`MagicMock` objects create all attributes and methods as you access them and store details of how they have been used. You can configure them, to specify return values or limit what attributes are available, and then make assertions about how they have been used: .. doctest:: >>> from mock import MagicMock >>> thing = ProductionClass() >>> thing.method = MagicMock(return_value=3) >>> thing.method(3, 4, 5, key='value') 3 >>> thing.method.assert_called_with(3, 4, 5, key='value') :attr:`side_effect` allows you to perform side effects, including raising an exception when a mock is called: .. doctest:: >>> mock = Mock(side_effect=KeyError('foo')) >>> mock() Traceback (most recent call last): ... KeyError: 'foo' >>> values = {'a': 1, 'b': 2, 'c': 3} >>> def side_effect(arg): ... return values[arg] ... >>> mock.side_effect = side_effect >>> mock('a'), mock('b'), mock('c') (1, 2, 3) >>> mock.side_effect = [5, 4, 3, 2, 1] >>> mock(), mock(), mock() (5, 4, 3) Mock has many other ways you can configure it and control its behaviour. For example the `spec` argument configures the mock to take its specification from another object. Attempting to access attributes or methods on the mock that don't exist on the spec will fail with an `AttributeError`. The :func:`patch` decorator / context manager makes it easy to mock classes or objects in a module under test. The object you specify will be replaced with a mock (or other object) during the test and restored when the test ends: .. doctest:: >>> from mock import patch >>> @patch('module.ClassName2') ... @patch('module.ClassName1') ... def test(MockClass1, MockClass2): ... module.ClassName1() ... module.ClassName2() ... assert MockClass1 is module.ClassName1 ... assert MockClass2 is module.ClassName2 ... assert MockClass1.called ... assert MockClass2.called ... >>> test() .. note:: When you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal *python* order that decorators are applied). This means from the bottom up, so in the example above the mock for `module.ClassName1` is passed in first. With `patch` it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read :ref:`where to patch `. As well as a decorator `patch` can be used as a context manager in a with statement: .. doctest:: >>> with patch.object(ProductionClass, 'method', return_value=None) as mock_method: ... thing = ProductionClass() ... thing.method(1, 2, 3) ... >>> mock_method.assert_called_once_with(1, 2, 3) There is also :func:`patch.dict` for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends: .. doctest:: >>> foo = {'key': 'value'} >>> original = foo.copy() >>> with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == original Mock supports the mocking of Python :ref:`magic methods `. The easiest way of using magic methods is with the :class:`MagicMock` class. It allows you to do things like: .. doctest:: >>> mock = MagicMock() >>> mock.__str__.return_value = 'foobarbaz' >>> str(mock) 'foobarbaz' >>> mock.__str__.assert_called_with() Mock allows you to assign functions (or other Mock instances) to magic methods and they will be called appropriately. The `MagicMock` class is just a Mock variant that has all of the magic methods pre-created for you (well, all the useful ones anyway). The following is an example of using magic methods with the ordinary Mock class: .. doctest:: >>> mock = Mock() >>> mock.__str__ = Mock(return_value='wheeeeee') >>> str(mock) 'wheeeeee' For ensuring that the mock objects in your tests have the same api as the objects they are replacing, you can use :ref:`auto-speccing `. Auto-speccing can be done through the `autospec` argument to patch, or the :func:`create_autospec` function. Auto-speccing creates mock objects that have the same attributes and methods as the objects they are replacing, and any functions and methods (including constructors) have the same call signature as the real object. This ensures that your mocks will fail in the same way as your production code if they are used incorrectly: .. doctest:: >>> from mock import create_autospec >>> def function(a, b, c): ... pass ... >>> mock_function = create_autospec(function, return_value='fishy') >>> mock_function(1, 2, 3) 'fishy' >>> mock_function.assert_called_once_with(1, 2, 3) >>> mock_function('wrong arguments') Traceback (most recent call last): ... TypeError: () takes exactly 3 arguments (1 given) `create_autospec` can also be used on classes, where it copies the signature of the `__init__` method, and on callable objects where it copies the signature of the `__call__` method. .. index:: references .. index:: articles References ========== Articles, blog entries and other stuff related to testing with Mock: * `Imposing a No DB Discipline on Django unit tests `_ * `mock-django: tools for mocking the Django ORM and models `_ * `PyCon 2011 Video: Testing with mock `_ * `Mock objects in Python `_ * `Python: Injecting Mock Objects for Powerful Testing `_ * `Python Mock: How to assert a substring of logger output `_ * `Mocking Django `_ * `Mocking dates and other classes that can't be modified `_ * `Mock recipes `_ * `Mockity mock mock - some love for the mock module `_ * `Coverage and Mock (with django) `_ * `Python Unit Testing with Mock `_ * `Getting started with Python Mock `_ * `Smart Parameter Checks with mock `_ * `Python mock testing techniques and tools `_ * `How To Test Django Template Tags `_ * `A presentation on Unit Testing with Mock `_ * `Mocking with Django and Google AppEngine `_ .. index:: tests .. index:: unittest2 Tests ===== Mock uses `unittest2 `_ for its own test suite. In order to run it, use the `unit2` script that comes with `unittest2` module on a checkout of the source repository: `unit2 discover` If you have `setuptools `_ as well as unittest2 you can run: ``python setup.py test`` On Python 3.2 you can use ``unittest`` module from the standard library. ``python3.2 -m unittest discover`` .. index:: Python 3 On Python 3 the tests for unicode are skipped as they are not relevant. On Python 2.4 tests that use the with statements are skipped as the with statement is invalid syntax on Python 2.4. .. index:: older versions Older Versions ============== Documentation for older versions of mock: * `mock 0.8 `_ * `mock 0.7 `_ * `mock 0.6 `_ Docs from the in-development version of `mock` can be found at `mock.readthedocs.org `_. Terminology =========== Terminology for objects used to replace other ones can be confusing. Terms like double, fake, mock, stub, and spy are all used with varying meanings. In `classic mock terminology `_ :class:`mock.Mock` is a `spy `_ that allows for *post-mortem* examination. This is what I call the "action -> assertion" [#]_ pattern of testing. I'm not however a fan of this "statically typed mocking terminology" promulgated by `Martin Fowler `_. It confuses usage patterns with implementation and prevents you from using natural terminology when discussing mocking. I much prefer duck typing, if an object used in your test suite looks like a mock object and quacks like a mock object then it's fine to call it a mock, no matter what the implementation looks like. This terminology is perhaps more useful in less capable languages where different usage patterns will *require* different implementations. `mock.Mock()` is capable of being used in most of the different roles described by Fowler, except (annoyingly / frustratingly / ironically) a Mock itself! How about a simpler definition: a "mock object" is an object used to replace a real one in a system under test. .. [#] This pattern is called "AAA" by some members of the testing community; "Arrange - Act - Assert". mock-1.0.1/docs/magicmock.txt0000644000076500001200000001731111731232226016576 0ustar michaeladmin00000000000000 .. currentmodule:: mock .. _magic-methods: Mocking Magic Methods ===================== .. currentmodule:: mock :class:`Mock` supports mocking `magic methods `_. This allows mock objects to replace containers or other objects that implement Python protocols. Because magic methods are looked up differently from normal methods [#]_, this support has been specially implemented. This means that only specific magic methods are supported. The supported list includes *almost* all of them. If there are any missing that you need please let us know! You mock magic methods by setting the method you are interested in to a function or a mock instance. If you are using a function then it *must* take ``self`` as the first argument [#]_. .. doctest:: >>> def __str__(self): ... return 'fooble' ... >>> mock = Mock() >>> mock.__str__ = __str__ >>> str(mock) 'fooble' >>> mock = Mock() >>> mock.__str__ = Mock() >>> mock.__str__.return_value = 'fooble' >>> str(mock) 'fooble' >>> mock = Mock() >>> mock.__iter__ = Mock(return_value=iter([])) >>> list(mock) [] One use case for this is for mocking objects used as context managers in a `with` statement: .. doctest:: >>> mock = Mock() >>> mock.__enter__ = Mock(return_value='foo') >>> mock.__exit__ = Mock(return_value=False) >>> with mock as m: ... assert m == 'foo' ... >>> mock.__enter__.assert_called_with() >>> mock.__exit__.assert_called_with(None, None, None) Calls to magic methods do not appear in :attr:`~Mock.method_calls`, but they are recorded in :attr:`~Mock.mock_calls`. .. note:: If you use the `spec` keyword argument to create a mock then attempting to set a magic method that isn't in the spec will raise an `AttributeError`. The full list of supported magic methods is: * ``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__`` * ``__dir__``, ``__format__`` and ``__subclasses__`` * ``__floor__``, ``__trunc__`` and ``__ceil__`` * Comparisons: ``__cmp__``, ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and ``__ne__`` * Container methods: ``__getitem__``, ``__setitem__``, ``__delitem__``, ``__contains__``, ``__len__``, ``__iter__``, ``__getslice__``, ``__setslice__``, ``__reversed__`` and ``__missing__`` * Context manager: ``__enter__`` and ``__exit__`` * Unary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__`` * The numeric methods (including right hand and in-place variants): ``__add__``, ``__sub__``, ``__mul__``, ``__div__``, ``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``, ``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and ``__pow__`` * Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__``, ``__index__`` and ``__coerce__`` * Descriptor methods: ``__get__``, ``__set__`` and ``__delete__`` * Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, ``__getstate__`` and ``__setstate__`` The following methods are supported in Python 2 but don't exist in Python 3: * ``__unicode__``, ``__long__``, ``__oct__``, ``__hex__`` and ``__nonzero__`` * ``__truediv__`` and ``__rtruediv__`` The following methods are supported in Python 3 but don't exist in Python 2: * ``__bool__`` and ``__next__`` The following methods exist but are *not* supported as they are either in use by mock, can't be set dynamically, or can cause problems: * ``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__`` * ``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__`` Magic Mock ========== There are two `MagicMock` variants: `MagicMock` and `NonCallableMagicMock`. .. class:: MagicMock(*args, **kw) ``MagicMock`` is a subclass of :class:`Mock` with default implementations of most of the magic methods. You can use ``MagicMock`` without having to configure the magic methods yourself. The constructor parameters have the same meaning as for :class:`Mock`. If you use the `spec` or `spec_set` arguments then *only* magic methods that exist in the spec will be created. .. class:: NonCallableMagicMock(*args, **kw) A non-callable version of `MagicMock`. The constructor parameters have the same meaning as for :class:`MagicMock`, with the exception of `return_value` and `side_effect` which have no meaning on a non-callable mock. The magic methods are setup with `MagicMock` objects, so you can configure them and use them in the usual way: .. doctest:: >>> mock = MagicMock() >>> mock[3] = 'fish' >>> mock.__setitem__.assert_called_with(3, 'fish') >>> mock.__getitem__.return_value = 'result' >>> mock[2] 'result' By default many of the protocol methods are required to return objects of a specific type. These methods are preconfigured with a default return value, so that they can be used without you having to do anything if you aren't interested in the return value. You can still *set* the return value manually if you want to change the default. Methods and their defaults: * ``__lt__``: NotImplemented * ``__gt__``: NotImplemented * ``__le__``: NotImplemented * ``__ge__``: NotImplemented * ``__int__`` : 1 * ``__contains__`` : False * ``__len__`` : 1 * ``__iter__`` : iter([]) * ``__exit__`` : False * ``__complex__`` : 1j * ``__float__`` : 1.0 * ``__bool__`` : True * ``__nonzero__`` : True * ``__oct__`` : '1' * ``__hex__`` : '0x1' * ``__long__`` : long(1) * ``__index__`` : 1 * ``__hash__`` : default hash for the mock * ``__str__`` : default str for the mock * ``__unicode__`` : default unicode for the mock * ``__sizeof__``: default sizeof for the mock For example: .. doctest:: >>> mock = MagicMock() >>> int(mock) 1 >>> len(mock) 0 >>> hex(mock) '0x1' >>> list(mock) [] >>> object() in mock False The two equality method, `__eq__` and `__ne__`, are special (changed in 0.7.2). They do the default equality comparison on identity, using a side effect, unless you change their return value to return something else: .. doctest:: >>> MagicMock() == 3 False >>> MagicMock() != 3 True >>> mock = MagicMock() >>> mock.__eq__.return_value = True >>> mock == 3 True In `0.8` the `__iter__` also gained special handling implemented with a side effect. The return value of `MagicMock.__iter__` can be any iterable object and isn't required to be an iterator: .. doctest:: >>> mock = MagicMock() >>> mock.__iter__.return_value = ['a', 'b', 'c'] >>> list(mock) ['a', 'b', 'c'] >>> list(mock) ['a', 'b', 'c'] If the return value *is* an iterator, then iterating over it once will consume it and subsequent iterations will result in an empty list: .. doctest:: >>> mock.__iter__.return_value = iter(['a', 'b', 'c']) >>> list(mock) ['a', 'b', 'c'] >>> list(mock) [] ``MagicMock`` has all of the supported magic methods configured except for some of the obscure and obsolete ones. You can still set these up if you want. Magic methods that are supported but not setup by default in ``MagicMock`` are: * ``__cmp__`` * ``__getslice__`` and ``__setslice__`` * ``__coerce__`` * ``__subclasses__`` * ``__dir__`` * ``__format__`` * ``__get__``, ``__set__`` and ``__delete__`` * ``__reversed__`` and ``__missing__`` * ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, ``__getstate__`` and ``__setstate__`` * ``__getformat__`` and ``__setformat__`` ------------ .. [#] Magic methods *should* be looked up on the class rather than the instance. Different versions of Python are inconsistent about applying this rule. The supported protocol methods should work with all supported versions of Python. .. [#] The function is basically hooked up to the class, but each ``Mock`` instance is kept isolated from the others. mock-1.0.1/docs/mock.txt0000644000076500001200000006521411744401311015577 0ustar michaeladmin00000000000000The Mock Class ============== .. currentmodule:: mock .. testsetup:: class SomeClass: pass `Mock` is a flexible mock object intended to replace the use of stubs and test doubles throughout your code. Mocks are callable and create attributes as new mocks when you access them [#]_. Accessing the same attribute will always return the same mock. Mocks record how you use them, allowing you to make assertions about what your code has done to them. :class:`MagicMock` is a subclass of `Mock` with all the magic methods pre-created and ready to use. There are also non-callable variants, useful when you are mocking out objects that aren't callable: :class:`NonCallableMock` and :class:`NonCallableMagicMock` The :func:`patch` decorators makes it easy to temporarily replace classes in a particular module with a `Mock` object. By default `patch` will create a `MagicMock` for you. You can specify an alternative class of `Mock` using the `new_callable` argument to `patch`. .. index:: side_effect .. index:: return_value .. index:: wraps .. index:: name .. index:: spec .. class:: Mock(spec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec_set=None, **kwargs) Create a new `Mock` object. `Mock` takes several optional arguments that specify the behaviour of the Mock object: * `spec`: This can be either a list of strings or an existing object (a class or instance) that acts as the specification for the mock object. If you pass in an object then a list of strings is formed by calling dir on the object (excluding unsupported magic attributes and methods). Accessing any attribute not in this list will raise an `AttributeError`. If `spec` is an object (rather than a list of strings) then :attr:`__class__` returns the class of the spec object. This allows mocks to pass `isinstance` tests. * `spec_set`: A stricter variant of `spec`. If used, attempting to *set* or get an attribute on the mock that isn't on the object passed as `spec_set` will raise an `AttributeError`. * `side_effect`: A function to be called whenever the Mock is called. See the :attr:`~Mock.side_effect` attribute. Useful for raising exceptions or dynamically changing return values. The function is called with the same arguments as the mock, and unless it returns :data:`DEFAULT`, the return value of this function is used as the return value. Alternatively `side_effect` can be an exception class or instance. In this case the exception will be raised when the mock is called. If `side_effect` is an iterable then each call to the mock will return the next value from the iterable. If any of the members of the iterable are exceptions they will be raised instead of returned. A `side_effect` can be cleared by setting it to `None`. * `return_value`: The value returned when the mock is called. By default this is a new Mock (created on first access). See the :attr:`return_value` attribute. * `wraps`: Item for the mock object to wrap. If `wraps` is not None then calling the Mock will pass the call through to the wrapped object (returning the real result and ignoring `return_value`). Attribute access on the mock will return a Mock object that wraps the corresponding attribute of the wrapped object (so attempting to access an attribute that doesn't exist will raise an `AttributeError`). If the mock has an explicit `return_value` set then calls are not passed to the wrapped object and the `return_value` is returned instead. * `name`: If the mock has a name then it will be used in the repr of the mock. This can be useful for debugging. The name is propagated to child mocks. Mocks can also be called with arbitrary keyword arguments. These will be used to set attributes on the mock after it is created. See the :meth:`configure_mock` method for details. .. method:: assert_called_with(*args, **kwargs) This method is a convenient way of asserting that calls are made in a particular way: .. doctest:: >>> mock = Mock() >>> mock.method(1, 2, 3, test='wow') >>> mock.method.assert_called_with(1, 2, 3, test='wow') .. method:: assert_called_once_with(*args, **kwargs) Assert that the mock was called exactly once and with the specified arguments. .. doctest:: >>> mock = Mock(return_value=None) >>> mock('foo', bar='baz') >>> mock.assert_called_once_with('foo', bar='baz') >>> mock('foo', bar='baz') >>> mock.assert_called_once_with('foo', bar='baz') Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times. .. method:: assert_any_call(*args, **kwargs) assert the mock has been called with the specified arguments. The assert passes if the mock has *ever* been called, unlike :meth:`assert_called_with` and :meth:`assert_called_once_with` that only pass if the call is the most recent one. .. doctest:: >>> mock = Mock(return_value=None) >>> mock(1, 2, arg='thing') >>> mock('some', 'thing', 'else') >>> mock.assert_any_call(1, 2, arg='thing') .. method:: assert_has_calls(calls, any_order=False) assert the mock has been called with the specified calls. The `mock_calls` list is checked for the calls. If `any_order` is False (the default) then the calls must be sequential. There can be extra calls before or after the specified calls. If `any_order` is True then the calls can be in any order, but they must all appear in :attr:`mock_calls`. .. doctest:: >>> mock = Mock(return_value=None) >>> mock(1) >>> mock(2) >>> mock(3) >>> mock(4) >>> calls = [call(2), call(3)] >>> mock.assert_has_calls(calls) >>> calls = [call(4), call(2), call(3)] >>> mock.assert_has_calls(calls, any_order=True) .. method:: reset_mock() The reset_mock method resets all the call attributes on a mock object: .. doctest:: >>> mock = Mock(return_value=None) >>> mock('hello') >>> mock.called True >>> mock.reset_mock() >>> mock.called False This can be useful where you want to make a series of assertions that reuse the same object. Note that `reset_mock` *doesn't* clear the return value, :attr:`side_effect` or any child attributes you have set using normal assignment. Child mocks and the return value mock (if any) are reset as well. .. method:: mock_add_spec(spec, spec_set=False) Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock. If `spec_set` is `True` then only attributes on the spec can be set. .. method:: attach_mock(mock, attribute) Attach a mock as an attribute of this one, replacing its name and parent. Calls to the attached mock will be recorded in the :attr:`method_calls` and :attr:`mock_calls` attributes of this one. .. method:: configure_mock(**kwargs) Set attributes on the mock through keyword arguments. Attributes plus return values and side effects can be set on child mocks using standard dot notation and unpacking a dictionary in the method call: .. doctest:: >>> mock = Mock() >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock.configure_mock(**attrs) >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyError The same thing can be achieved in the constructor call to mocks: .. doctest:: >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock = Mock(some_attribute='eggs', **attrs) >>> mock.some_attribute 'eggs' >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyError `configure_mock` exists to make it easier to do configuration after the mock has been created. .. method:: __dir__() `Mock` objects limit the results of `dir(some_mock)` to useful results. For mocks with a `spec` this includes all the permitted attributes for the mock. See :data:`FILTER_DIR` for what this filtering does, and how to switch it off. .. method:: _get_child_mock(**kw) Create the child mocks for attributes and return value. By default child mocks will be the same type as the parent. Subclasses of Mock may want to override this to customize the way child mocks are made. For non-callable mocks the callable variant will be used (rather than any custom subclass). .. attribute:: called A boolean representing whether or not the mock object has been called: .. doctest:: >>> mock = Mock(return_value=None) >>> mock.called False >>> mock() >>> mock.called True .. attribute:: call_count An integer telling you how many times the mock object has been called: .. doctest:: >>> mock = Mock(return_value=None) >>> mock.call_count 0 >>> mock() >>> mock() >>> mock.call_count 2 .. attribute:: return_value Set this to configure the value returned by calling the mock: .. doctest:: >>> mock = Mock() >>> mock.return_value = 'fish' >>> mock() 'fish' The default return value is a mock object and you can configure it in the normal way: .. doctest:: >>> mock = Mock() >>> mock.return_value.attribute = sentinel.Attribute >>> mock.return_value() >>> mock.return_value.assert_called_with() `return_value` can also be set in the constructor: .. doctest:: >>> mock = Mock(return_value=3) >>> mock.return_value 3 >>> mock() 3 .. attribute:: side_effect This can either be a function to be called when the mock is called, or an exception (class or instance) to be raised. If you pass in a function it will be called with same arguments as the mock and unless the function returns the :data:`DEFAULT` singleton the call to the mock will then return whatever the function returns. If the function returns :data:`DEFAULT` then the mock will return its normal value (from the :attr:`return_value`. An example of a mock that raises an exception (to test exception handling of an API): .. doctest:: >>> mock = Mock() >>> mock.side_effect = Exception('Boom!') >>> mock() Traceback (most recent call last): ... Exception: Boom! Using `side_effect` to return a sequence of values: .. doctest:: >>> mock = Mock() >>> mock.side_effect = [3, 2, 1] >>> mock(), mock(), mock() (3, 2, 1) The `side_effect` function is called with the same arguments as the mock (so it is wise for it to take arbitrary args and keyword arguments) and whatever it returns is used as the return value for the call. The exception is if `side_effect` returns :data:`DEFAULT`, in which case the normal :attr:`return_value` is used. .. doctest:: >>> mock = Mock(return_value=3) >>> def side_effect(*args, **kwargs): ... return DEFAULT ... >>> mock.side_effect = side_effect >>> mock() 3 `side_effect` can be set in the constructor. Here's an example that adds one to the value the mock is called with and returns it: .. doctest:: >>> side_effect = lambda value: value + 1 >>> mock = Mock(side_effect=side_effect) >>> mock(3) 4 >>> mock(-8) -7 Setting `side_effect` to `None` clears it: .. doctest:: >>> from mock import Mock >>> m = Mock(side_effect=KeyError, return_value=3) >>> m() Traceback (most recent call last): ... KeyError >>> m.side_effect = None >>> m() 3 .. attribute:: call_args This is either `None` (if the mock hasn't been called), or the arguments that the mock was last called with. This will be in the form of a tuple: the first member is any ordered arguments the mock was called with (or an empty tuple) and the second member is any keyword arguments (or an empty dictionary). .. doctest:: >>> mock = Mock(return_value=None) >>> print mock.call_args None >>> mock() >>> mock.call_args call() >>> mock.call_args == () True >>> mock(3, 4) >>> mock.call_args call(3, 4) >>> mock.call_args == ((3, 4),) True >>> mock(3, 4, 5, key='fish', next='w00t!') >>> mock.call_args call(3, 4, 5, key='fish', next='w00t!') `call_args`, along with members of the lists :attr:`call_args_list`, :attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These are tuples, so they can be unpacked to get at the individual arguments and make more complex assertions. See :ref:`calls as tuples `. .. attribute:: call_args_list This is a list of all the calls made to the mock object in sequence (so the length of the list is the number of times it has been called). Before any calls have been made it is an empty list. The :data:`call` object can be used for conveniently constructing lists of calls to compare with `call_args_list`. .. doctest:: >>> mock = Mock(return_value=None) >>> mock() >>> mock(3, 4) >>> mock(key='fish', next='w00t!') >>> mock.call_args_list [call(), call(3, 4), call(key='fish', next='w00t!')] >>> expected = [(), ((3, 4),), ({'key': 'fish', 'next': 'w00t!'},)] >>> mock.call_args_list == expected True Members of `call_args_list` are :data:`call` objects. These can be unpacked as tuples to get at the individual arguments. See :ref:`calls as tuples `. .. attribute:: method_calls As well as tracking calls to themselves, mocks also track calls to methods and attributes, and *their* methods and attributes: .. doctest:: >>> mock = Mock() >>> mock.method() >>> mock.property.method.attribute() >>> mock.method_calls [call.method(), call.property.method.attribute()] Members of `method_calls` are :data:`call` objects. These can be unpacked as tuples to get at the individual arguments. See :ref:`calls as tuples `. .. attribute:: mock_calls `mock_calls` records *all* calls to the mock object, its methods, magic methods *and* return value mocks. .. doctest:: >>> mock = MagicMock() >>> result = mock(1, 2, 3) >>> mock.first(a=3) >>> mock.second() >>> int(mock) 1 >>> result(1) >>> expected = [call(1, 2, 3), call.first(a=3), call.second(), ... call.__int__(), call()(1)] >>> mock.mock_calls == expected True Members of `mock_calls` are :data:`call` objects. These can be unpacked as tuples to get at the individual arguments. See :ref:`calls as tuples `. .. attribute:: __class__ Normally the `__class__` attribute of an object will return its type. For a mock object with a `spec` `__class__` returns the spec class instead. This allows mock objects to pass `isinstance` tests for the object they are replacing / masquerading as: .. doctest:: >>> mock = Mock(spec=3) >>> isinstance(mock, int) True `__class__` is assignable to, this allows a mock to pass an `isinstance` check without forcing you to use a spec: .. doctest:: >>> mock = Mock() >>> mock.__class__ = dict >>> isinstance(mock, dict) True .. class:: NonCallableMock(spec=None, wraps=None, name=None, spec_set=None, **kwargs) A non-callable version of `Mock`. The constructor parameters have the same meaning of `Mock`, with the exception of `return_value` and `side_effect` which have no meaning on a non-callable mock. Mock objects that use a class or an instance as a `spec` or `spec_set` are able to pass `isintance` tests: .. doctest:: >>> mock = Mock(spec=SomeClass) >>> isinstance(mock, SomeClass) True >>> mock = Mock(spec_set=SomeClass()) >>> isinstance(mock, SomeClass) True The `Mock` classes have support for mocking magic methods. See :ref:`magic methods ` for the full details. The mock classes and the :func:`patch` decorators all take arbitrary keyword arguments for configuration. For the `patch` decorators the keywords are passed to the constructor of the mock being created. The keyword arguments are for configuring attributes of the mock: .. doctest:: >>> m = MagicMock(attribute=3, other='fish') >>> m.attribute 3 >>> m.other 'fish' The return value and side effect of child mocks can be set in the same way, using dotted notation. As you can't use dotted names directly in a call you have to create a dictionary and unpack it using `**`: .. doctest:: >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock = Mock(some_attribute='eggs', **attrs) >>> mock.some_attribute 'eggs' >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyError .. class:: PropertyMock(*args, **kwargs) A mock intended to be used as a property, or other descriptor, on a class. `PropertyMock` provides `__get__` and `__set__` methods so you can specify a return value when it is fetched. Fetching a `PropertyMock` instance from an object calls the mock, with no args. Setting it calls the mock with the value being set. .. doctest:: >>> class Foo(object): ... @property ... def foo(self): ... return 'something' ... @foo.setter ... def foo(self, value): ... pass ... >>> with patch('__main__.Foo.foo', new_callable=PropertyMock) as mock_foo: ... mock_foo.return_value = 'mockity-mock' ... this_foo = Foo() ... print this_foo.foo ... this_foo.foo = 6 ... mockity-mock >>> mock_foo.mock_calls [call(), call(6)] Because of the way mock attributes are stored you can't directly attach a `PropertyMock` to a mock object. Instead you can attach it to the mock type object: .. doctest:: >>> m = MagicMock() >>> p = PropertyMock(return_value=3) >>> type(m).foo = p >>> m.foo 3 >>> p.assert_called_once_with() .. index:: __call__ .. index:: calling Calling ======= Mock objects are callable. The call will return the value set as the :attr:`~Mock.return_value` attribute. The default return value is a new Mock object; it is created the first time the return value is accessed (either explicitly or by calling the Mock) - but it is stored and the same one returned each time. Calls made to the object will be recorded in the attributes like :attr:`~Mock.call_args` and :attr:`~Mock.call_args_list`. If :attr:`~Mock.side_effect` is set then it will be called after the call has been recorded, so if `side_effect` raises an exception the call is still recorded. The simplest way to make a mock raise an exception when called is to make :attr:`~Mock.side_effect` an exception class or instance: .. doctest:: >>> m = MagicMock(side_effect=IndexError) >>> m(1, 2, 3) Traceback (most recent call last): ... IndexError >>> m.mock_calls [call(1, 2, 3)] >>> m.side_effect = KeyError('Bang!') >>> m('two', 'three', 'four') Traceback (most recent call last): ... KeyError: 'Bang!' >>> m.mock_calls [call(1, 2, 3), call('two', 'three', 'four')] If `side_effect` is a function then whatever that function returns is what calls to the mock return. The `side_effect` function is called with the same arguments as the mock. This allows you to vary the return value of the call dynamically, based on the input: .. doctest:: >>> def side_effect(value): ... return value + 1 ... >>> m = MagicMock(side_effect=side_effect) >>> m(1) 2 >>> m(2) 3 >>> m.mock_calls [call(1), call(2)] If you want the mock to still return the default return value (a new mock), or any set return value, then there are two ways of doing this. Either return `mock.return_value` from inside `side_effect`, or return :data:`DEFAULT`: .. doctest:: >>> m = MagicMock() >>> def side_effect(*args, **kwargs): ... return m.return_value ... >>> m.side_effect = side_effect >>> m.return_value = 3 >>> m() 3 >>> def side_effect(*args, **kwargs): ... return DEFAULT ... >>> m.side_effect = side_effect >>> m() 3 To remove a `side_effect`, and return to the default behaviour, set the `side_effect` to `None`: .. doctest:: >>> m = MagicMock(return_value=6) >>> def side_effect(*args, **kwargs): ... return 3 ... >>> m.side_effect = side_effect >>> m() 3 >>> m.side_effect = None >>> m() 6 The `side_effect` can also be any iterable object. Repeated calls to the mock will return values from the iterable (until the iterable is exhausted and a `StopIteration` is raised): .. doctest:: >>> m = MagicMock(side_effect=[1, 2, 3]) >>> m() 1 >>> m() 2 >>> m() 3 >>> m() Traceback (most recent call last): ... StopIteration If any members of the iterable are exceptions they will be raised instead of returned: .. doctest:: >>> iterable = (33, ValueError, 66) >>> m = MagicMock(side_effect=iterable) >>> m() 33 >>> m() Traceback (most recent call last): ... ValueError >>> m() 66 .. _deleting-attributes: Deleting Attributes =================== Mock objects create attributes on demand. This allows them to pretend to be objects of any type. You may want a mock object to return `False` to a `hasattr` call, or raise an `AttributeError` when an attribute is fetched. You can do this by providing an object as a `spec` for a mock, but that isn't always convenient. You "block" attributes by deleting them. Once deleted, accessing an attribute will raise an `AttributeError`. .. doctest:: >>> mock = MagicMock() >>> hasattr(mock, 'm') True >>> del mock.m >>> hasattr(mock, 'm') False >>> del mock.f >>> mock.f Traceback (most recent call last): ... AttributeError: f Attaching Mocks as Attributes ============================= When you attach a mock as an attribute of another mock (or as the return value) it becomes a "child" of that mock. Calls to the child are recorded in the :attr:`~Mock.method_calls` and :attr:`~Mock.mock_calls` attributes of the parent. This is useful for configuring child mocks and then attaching them to the parent, or for attaching mocks to a parent that records all calls to the children and allows you to make assertions about the order of calls between mocks: .. doctest:: >>> parent = MagicMock() >>> child1 = MagicMock(return_value=None) >>> child2 = MagicMock(return_value=None) >>> parent.child1 = child1 >>> parent.child2 = child2 >>> child1(1) >>> child2(2) >>> parent.mock_calls [call.child1(1), call.child2(2)] The exception to this is if the mock has a name. This allows you to prevent the "parenting" if for some reason you don't want it to happen. .. doctest:: >>> mock = MagicMock() >>> not_a_child = MagicMock(name='not-a-child') >>> mock.attribute = not_a_child >>> mock.attribute() >>> mock.mock_calls [] Mocks created for you by :func:`patch` are automatically given names. To attach mocks that have names to a parent you use the :meth:`~Mock.attach_mock` method: .. doctest:: >>> thing1 = object() >>> thing2 = object() >>> parent = MagicMock() >>> with patch('__main__.thing1', return_value=None) as child1: ... with patch('__main__.thing2', return_value=None) as child2: ... parent.attach_mock(child1, 'child1') ... parent.attach_mock(child2, 'child2') ... child1('one') ... child2('two') ... >>> parent.mock_calls [call.child1('one'), call.child2('two')] ----- .. [#] The only exceptions are magic methods and attributes (those that have leading and trailing double underscores). Mock doesn't create these but instead of raises an ``AttributeError``. This is because the interpreter will often implicitly request these methods, and gets *very* confused to get a new Mock object when it expects a magic method. If you need magic method support see :ref:`magic methods `. mock-1.0.1/docs/patch.txt0000644000076500000240000005366711765173623016013 0ustar michaelstaff00000000000000================== Patch Decorators ================== .. currentmodule:: mock .. testsetup:: class SomeClass(object): static_method = None class_method = None attribute = None sys.modules['package'] = package = Mock(name='package') sys.modules['package.module'] = package.module class TestCase(unittest2.TestCase): def run(self): result = unittest2.TestResult() super(unittest2.TestCase, self).run(result) assert result.wasSuccessful() .. testcleanup:: patch.TEST_PREFIX = 'test' The patch decorators are used for patching objects only within the scope of the function they decorate. They automatically handle the unpatching for you, even if exceptions are raised. All of these functions can also be used in with statements or as class decorators. patch ===== .. note:: `patch` is straightforward to use. The key is to do the patching in the right namespace. See the section `where to patch`_. .. function:: patch(target, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs) `patch` acts as a function decorator, class decorator or a context manager. Inside the body of the function or with statement, the `target` is patched with a `new` object. When the function/with statement exits the patch is undone. If `new` is omitted, then the target is replaced with a :class:`MagicMock`. If `patch` is used as a decorator and `new` is omitted, the created mock is passed in as an extra argument to the decorated function. If `patch` is used as a context manager the created mock is returned by the context manager. `target` should be a string in the form `'package.module.ClassName'`. The `target` is imported and the specified object replaced with the `new` object, so the `target` must be importable from the environment you are calling `patch` from. The target is imported when the decorated function is executed, not at decoration time. The `spec` and `spec_set` keyword arguments are passed to the `MagicMock` if patch is creating one for you. In addition you can pass `spec=True` or `spec_set=True`, which causes patch to pass in the object being mocked as the spec/spec_set object. `new_callable` allows you to specify a different class, or callable object, that will be called to create the `new` object. By default `MagicMock` is used. A more powerful form of `spec` is `autospec`. If you set `autospec=True` then the mock with be created with a spec from the object being replaced. All attributes of the mock will also have the spec of the corresponding attribute of the object being replaced. Methods and functions being mocked will have their arguments checked and will raise a `TypeError` if they are called with the wrong signature. For mocks replacing a class, their return value (the 'instance') will have the same spec as the class. See the :func:`create_autospec` function and :ref:`auto-speccing`. Instead of `autospec=True` you can pass `autospec=some_object` to use an arbitrary object as the spec instead of the one being replaced. By default `patch` will fail to replace attributes that don't exist. If you pass in `create=True`, and the attribute doesn't exist, patch will create the attribute for you when the patched function is called, and delete it again afterwards. This is useful for writing tests against attributes that your production code creates at runtime. It is off by by default because it can be dangerous. With it switched on you can write passing tests against APIs that don't actually exist! Patch can be used as a `TestCase` class decorator. It works by decorating each test method in the class. This reduces the boilerplate code when your test methods share a common patchings set. `patch` finds tests by looking for method names that start with `patch.TEST_PREFIX`. By default this is `test`, which matches the way `unittest` finds tests. You can specify an alternative prefix by setting `patch.TEST_PREFIX`. Patch can be used as a context manager, with the with statement. Here the patching applies to the indented block after the with statement. If you use "as" then the patched object will be bound to the name after the "as"; very useful if `patch` is creating a mock object for you. `patch` takes arbitrary keyword arguments. These will be passed to the `Mock` (or `new_callable`) on construction. `patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are available for alternate use-cases. `patch` as function decorator, creating the mock for you and passing it into the decorated function: .. doctest:: >>> @patch('__main__.SomeClass') ... def function(normal_argument, mock_class): ... print mock_class is SomeClass ... >>> function(None) True Patching a class replaces the class with a `MagicMock` *instance*. If the class is instantiated in the code under test then it will be the :attr:`~Mock.return_value` of the mock that will be used. If the class is instantiated multiple times you could use :attr:`~Mock.side_effect` to return a new mock each time. Alternatively you can set the `return_value` to be anything you want. To configure return values on methods of *instances* on the patched class you must do this on the `return_value`. For example: .. doctest:: >>> class Class(object): ... def method(self): ... pass ... >>> with patch('__main__.Class') as MockClass: ... instance = MockClass.return_value ... instance.method.return_value = 'foo' ... assert Class() is instance ... assert Class().method() == 'foo' ... If you use `spec` or `spec_set` and `patch` is replacing a *class*, then the return value of the created mock will have the same spec. .. doctest:: >>> Original = Class >>> patcher = patch('__main__.Class', spec=True) >>> MockClass = patcher.start() >>> instance = MockClass() >>> assert isinstance(instance, Original) >>> patcher.stop() The `new_callable` argument is useful where you want to use an alternative class to the default :class:`MagicMock` for the created mock. For example, if you wanted a :class:`NonCallableMock` to be used: .. doctest:: >>> thing = object() >>> with patch('__main__.thing', new_callable=NonCallableMock) as mock_thing: ... assert thing is mock_thing ... thing() ... Traceback (most recent call last): ... TypeError: 'NonCallableMock' object is not callable Another use case might be to replace an object with a `StringIO` instance: .. doctest:: >>> from StringIO import StringIO >>> def foo(): ... print 'Something' ... >>> @patch('sys.stdout', new_callable=StringIO) ... def test(mock_stdout): ... foo() ... assert mock_stdout.getvalue() == 'Something\n' ... >>> test() When `patch` is creating a mock for you, it is common that the first thing you need to do is to configure the mock. Some of that configuration can be done in the call to patch. Any arbitrary keywords you pass into the call will be used to set attributes on the created mock: .. doctest:: >>> patcher = patch('__main__.thing', first='one', second='two') >>> mock_thing = patcher.start() >>> mock_thing.first 'one' >>> mock_thing.second 'two' As well as attributes on the created mock attributes, like the :attr:`~Mock.return_value` and :attr:`~Mock.side_effect`, of child mocks can also be configured. These aren't syntactically valid to pass in directly as keyword arguments, but a dictionary with these as keys can still be expanded into a `patch` call using `**`: .. doctest:: >>> config = {'method.return_value': 3, 'other.side_effect': KeyError} >>> patcher = patch('__main__.thing', **config) >>> mock_thing = patcher.start() >>> mock_thing.method() 3 >>> mock_thing.other() Traceback (most recent call last): ... KeyError patch.object ============ .. function:: patch.object(target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs) patch the named member (`attribute`) on an object (`target`) with a mock object. `patch.object` can be used as a decorator, class decorator or a context manager. Arguments `new`, `spec`, `create`, `spec_set`, `autospec` and `new_callable` have the same meaning as for `patch`. Like `patch`, `patch.object` takes arbitrary keyword arguments for configuring the mock object it creates. When used as a class decorator `patch.object` honours `patch.TEST_PREFIX` for choosing which methods to wrap. You can either call `patch.object` with three arguments or two arguments. The three argument form takes the object to be patched, the attribute name and the object to replace the attribute with. When calling with the two argument form you omit the replacement object, and a mock is created for you and passed in as an extra argument to the decorated function: .. doctest:: >>> @patch.object(SomeClass, 'class_method') ... def test(mock_method): ... SomeClass.class_method(3) ... mock_method.assert_called_with(3) ... >>> test() `spec`, `create` and the other arguments to `patch.object` have the same meaning as they do for `patch`. patch.dict ========== .. function:: patch.dict(in_dict, values=(), clear=False, **kwargs) Patch a dictionary, or dictionary like object, and restore the dictionary to its original state after the test. `in_dict` can be a dictionary or a mapping like container. If it is a mapping then it must at least support getting, setting and deleting items plus iterating over keys. `in_dict` can also be a string specifying the name of the dictionary, which will then be fetched by importing it. `values` can be a dictionary of values to set in the dictionary. `values` can also be an iterable of `(key, value)` pairs. If `clear` is True then the dictionary will be cleared before the new values are set. `patch.dict` can also be called with arbitrary keyword arguments to set values in the dictionary. `patch.dict` can be used as a context manager, decorator or class decorator. When used as a class decorator `patch.dict` honours `patch.TEST_PREFIX` for choosing which methods to wrap. `patch.dict` can be used to add members to a dictionary, or simply let a test change a dictionary, and ensure the dictionary is restored when the test ends. .. doctest:: >>> from mock import patch >>> foo = {} >>> with patch.dict(foo, {'newkey': 'newvalue'}): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == {} >>> import os >>> with patch.dict('os.environ', {'newkey': 'newvalue'}): ... print os.environ['newkey'] ... newvalue >>> assert 'newkey' not in os.environ Keywords can be used in the `patch.dict` call to set values in the dictionary: .. doctest:: >>> mymodule = MagicMock() >>> mymodule.function.return_value = 'fish' >>> with patch.dict('sys.modules', mymodule=mymodule): ... import mymodule ... mymodule.function('some', 'args') ... 'fish' `patch.dict` can be used with dictionary like objects that aren't actually dictionaries. At the very minimum they must support item getting, setting, deleting and either iteration or membership test. This corresponds to the magic methods `__getitem__`, `__setitem__`, `__delitem__` and either `__iter__` or `__contains__`. .. doctest:: >>> class Container(object): ... def __init__(self): ... self.values = {} ... def __getitem__(self, name): ... return self.values[name] ... def __setitem__(self, name, value): ... self.values[name] = value ... def __delitem__(self, name): ... del self.values[name] ... def __iter__(self): ... return iter(self.values) ... >>> thing = Container() >>> thing['one'] = 1 >>> with patch.dict(thing, one=2, two=3): ... assert thing['one'] == 2 ... assert thing['two'] == 3 ... >>> assert thing['one'] == 1 >>> assert list(thing) == ['one'] patch.multiple ============== .. function:: patch.multiple(target, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs) Perform multiple patches in a single call. It takes the object to be patched (either as an object or a string to fetch the object by importing) and keyword arguments for the patches:: with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'): ... Use :data:`DEFAULT` as the value if you want `patch.multiple` to create mocks for you. In this case the created mocks are passed into a decorated function by keyword, and a dictionary is returned when `patch.multiple` is used as a context manager. `patch.multiple` can be used as a decorator, class decorator or a context manager. The arguments `spec`, `spec_set`, `create`, `autospec` and `new_callable` have the same meaning as for `patch`. These arguments will be applied to *all* patches done by `patch.multiple`. When used as a class decorator `patch.multiple` honours `patch.TEST_PREFIX` for choosing which methods to wrap. If you want `patch.multiple` to create mocks for you, then you can use :data:`DEFAULT` as the value. If you use `patch.multiple` as a decorator then the created mocks are passed into the decorated function by keyword. .. doctest:: >>> thing = object() >>> other = object() >>> @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) ... def test_function(thing, other): ... assert isinstance(thing, MagicMock) ... assert isinstance(other, MagicMock) ... >>> test_function() `patch.multiple` can be nested with other `patch` decorators, but put arguments passed by keyword *after* any of the standard arguments created by `patch`: .. doctest:: >>> @patch('sys.exit') ... @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) ... def test_function(mock_exit, other, thing): ... assert 'other' in repr(other) ... assert 'thing' in repr(thing) ... assert 'exit' in repr(mock_exit) ... >>> test_function() If `patch.multiple` is used as a context manager, the value returned by the context manger is a dictionary where created mocks are keyed by name: .. doctest:: >>> with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as values: ... assert 'other' in repr(values['other']) ... assert 'thing' in repr(values['thing']) ... assert values['thing'] is thing ... assert values['other'] is other ... .. _start-and-stop: patch methods: start and stop ============================= All the patchers have `start` and `stop` methods. These make it simpler to do patching in `setUp` methods or where you want to do multiple patches without nesting decorators or with statements. To use them call `patch`, `patch.object` or `patch.dict` as normal and keep a reference to the returned `patcher` object. You can then call `start` to put the patch in place and `stop` to undo it. If you are using `patch` to create a mock for you then it will be returned by the call to `patcher.start`. .. doctest:: >>> patcher = patch('package.module.ClassName') >>> from package import module >>> original = module.ClassName >>> new_mock = patcher.start() >>> assert module.ClassName is not original >>> assert module.ClassName is new_mock >>> patcher.stop() >>> assert module.ClassName is original >>> assert module.ClassName is not new_mock A typical use case for this might be for doing multiple patches in the `setUp` method of a `TestCase`: .. doctest:: >>> class MyTest(TestCase): ... def setUp(self): ... self.patcher1 = patch('package.module.Class1') ... self.patcher2 = patch('package.module.Class2') ... self.MockClass1 = self.patcher1.start() ... self.MockClass2 = self.patcher2.start() ... ... def tearDown(self): ... self.patcher1.stop() ... self.patcher2.stop() ... ... def test_something(self): ... assert package.module.Class1 is self.MockClass1 ... assert package.module.Class2 is self.MockClass2 ... >>> MyTest('test_something').run() .. caution:: If you use this technique you must ensure that the patching is "undone" by calling `stop`. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. `unittest2 `_ cleanup functions make this easier. .. doctest:: >>> class MyTest(TestCase): ... def setUp(self): ... patcher = patch('package.module.Class') ... self.MockClass = patcher.start() ... self.addCleanup(patcher.stop) ... ... def test_something(self): ... assert package.module.Class is self.MockClass ... >>> MyTest('test_something').run() As an added bonus you no longer need to keep a reference to the `patcher` object. It is also possible to stop all patches which have been started by using `patch.stopall`. .. function:: patch.stopall Stop all active patches. Only stops patches started with `start`. TEST_PREFIX =========== All of the patchers can be used as class decorators. When used in this way they wrap every test method on the class. The patchers recognise methods that start with `test` as being test methods. This is the same way that the `unittest.TestLoader` finds test methods by default. It is possible that you want to use a different prefix for your tests. You can inform the patchers of the different prefix by setting `patch.TEST_PREFIX`: .. doctest:: >>> patch.TEST_PREFIX = 'foo' >>> value = 3 >>> >>> @patch('__main__.value', 'not three') ... class Thing(object): ... def foo_one(self): ... print value ... def foo_two(self): ... print value ... >>> >>> Thing().foo_one() not three >>> Thing().foo_two() not three >>> value 3 Nesting Patch Decorators ======================== If you want to perform multiple patches then you can simply stack up the decorators. You can stack up multiple patch decorators using this pattern: .. doctest:: >>> @patch.object(SomeClass, 'class_method') ... @patch.object(SomeClass, 'static_method') ... def test(mock1, mock2): ... assert SomeClass.static_method is mock1 ... assert SomeClass.class_method is mock2 ... SomeClass.static_method('foo') ... SomeClass.class_method('bar') ... return mock1, mock2 ... >>> mock1, mock2 = test() >>> mock1.assert_called_once_with('foo') >>> mock2.assert_called_once_with('bar') Note that the decorators are applied from the bottom upwards. This is the standard way that Python applies decorators. The order of the created mocks passed into your test function matches this order. Like all context-managers patches can be nested using contextlib's nested function; *every* patching will appear in the tuple after "as": .. doctest:: >>> from contextlib import nested >>> with nested( ... patch('package.module.ClassName1'), ... patch('package.module.ClassName2') ... ) as (MockClass1, MockClass2): ... assert package.module.ClassName1 is MockClass1 ... assert package.module.ClassName2 is MockClass2 ... .. _where-to-patch: Where to patch ============== `patch` works by (temporarily) changing the object that a *name* points to with another one. There can be many names pointing to any individual object, so for patching to work you must ensure that you patch the name used by the system under test. The basic principle is that you patch where an object is *looked up*, which is not necessarily the same place as where it is defined. A couple of examples will help to clarify this. Imagine we have a project that we want to test with the following structure:: a.py -> Defines SomeClass b.py -> from a import SomeClass -> some_function instantiates SomeClass Now we want to test `some_function` but we want to mock out `SomeClass` using `patch`. The problem is that when we import module b, which we will have to do then it imports `SomeClass` from module a. If we use `patch` to mock out `a.SomeClass` then it will have no effect on our test; module b already has a reference to the *real* `SomeClass` and it looks like our patching had no effect. The key is to patch out `SomeClass` where it is used (or where it is looked up ). In this case `some_function` will actually look up `SomeClass` in module b, where we have imported it. The patching should look like: `@patch('b.SomeClass')` However, consider the alternative scenario where instead of `from a import SomeClass` module b does `import a` and `some_function` uses `a.SomeClass`. Both of these import forms are common. In this case the class we want to patch is being looked up on the a module and so we have to patch `a.SomeClass` instead: `@patch('a.SomeClass')` Patching Descriptors and Proxy Objects ====================================== Since version 0.6.0 both patch_ and patch.object_ have been able to correctly patch and restore descriptors: class methods, static methods and properties. You should patch these on the *class* rather than an instance. Since version 0.7.0 patch_ and patch.object_ work correctly with some objects that proxy attribute access, like the `django setttings object `_. .. note:: In django `import settings` and `from django.conf import settings` return different objects. If you are using libraries / apps that do both you may have to patch both. Grrr... mock-1.0.1/docs/sentinel.txt0000644000076500001200000000300111707122346016460 0ustar michaeladmin00000000000000========== Sentinel ========== .. currentmodule:: mock .. testsetup:: class ProductionClass(object): def something(self): return self.method() class Test(unittest2.TestCase): def testSomething(self): pass self = Test('testSomething') .. data:: sentinel The ``sentinel`` object provides a convenient way of providing unique objects for your tests. Attributes are created on demand when you access them by name. Accessing the same attribute will always return the same object. The objects returned have a sensible repr so that test failure messages are readable. .. data:: DEFAULT The `DEFAULT` object is a pre-created sentinel (actually `sentinel.DEFAULT`). It can be used by :attr:`~Mock.side_effect` functions to indicate that the normal return value should be used. Sentinel Example ================ Sometimes when testing you need to test that a specific object is passed as an argument to another method, or returned. It can be common to create named sentinel objects to test this. `sentinel` provides a convenient way of creating and testing the identity of objects like this. In this example we monkey patch `method` to return `sentinel.some_object`: .. doctest:: >>> real = ProductionClass() >>> real.method = Mock(name="method") >>> real.method.return_value = sentinel.some_object >>> result = real.method() >>> assert result is sentinel.some_object >>> sentinel.some_object sentinel.some_object mock-1.0.1/html/0000755000076500001200000000000012046031032014104 5ustar michaeladmin00000000000000mock-1.0.1/html/.doctrees/0000755000076500001200000000000012046031032015772 5ustar michaeladmin00000000000000mock-1.0.1/html/.doctrees/changelog.doctree0000644000076500001200000105663212046030505021311 0ustar michaeladmin00000000000000€cdocutils.nodes document q)q}q(U nametypesq}q(X2007/12/03 version 0.3.1qNX2007/11/21 version 0.2.1qNX2012/07/13 version 1.0.0 beta 1qNX2007/11/20 version 0.2.0q NX2012/10/07 version 1.0.0q NXtoxq ˆXtodo and limitationsq NX2011/05/06 version 0.7.1q NX unittest.mockqˆX 2012/03/25 version 1.0.0 alpha 1qNX2008/10/12 version 0.4.0qNX sphinx themeqˆX2011/08/05 version 0.8.0 beta 2qNX2011/07/25 version 0.8.0 beta 1qNX2010/06/22 version 0.7.0 beta 1qNX,2012/01/10 version 0.8.0 release candidate 2qNX2010/11/12 version 0.7.0 beta 4qNXreadthedocs.orgqˆX unittest2qˆX2009/04/17 version 0.5.0qNX2011/03/05 version 0.7.0qNX2011/02/16 version 0.7.0 rc 1qNX2010/06/23 version 0.7.0 beta 2qNX2009/08/22 version 0.6.0qNX2011/10/09 version 0.8.0 beta 4qNX2010/09/18 version 0.7.0 beta 3qNX2011/05/30 version 0.7.2q NX2012/02/13 version 0.8.0q!NX konrad delongq"ˆX 2011/06/14 version 0.8.0 alpha 1q#NX,2011/12/29 version 0.8.0 release candidate 1q$NX 2011/07/16 version 0.8.0 alpha 2q%NX2012/11/5 version 1.0.1q&NX changelogq'NXmock issue trackerq(ˆX2011/08/15 version 0.8.0 beta 3q)NX2007/11/30 version 0.3.0q*NX 2012/05/04 version 1.0.0 alpha 2q+NX2007/11/19 version 0.1.0q,NuUsubstitution_defsq-}q.Uparse_messagesq/]q0cdocutils.nodes system_message q1)q2}q3(U rawsourceq4UU attributesq5}q6(Udupnamesq7]q8Ulevelq9KUidsq:]q;Ubackrefsq<]q=Uid1q>aUsourceq?cdocutils.nodes reprunicode q@X /compile/mock/docs/changelog.txtqA…qB}qCbUclassesqD]qEUnamesqF]qGUlineqHKUtypeqIUINFOqJuUparentqKcdocutils.nodes list_item qL)qM}qN(h4XG`Konrad Delong `_ added as co-maintainer qOhKcdocutils.nodes bullet_list qP)qQ}qR(h4UhKcdocutils.nodes section qS)qT}qU(h4UhKhS)qV}qW(h4UhKhUsourceqXhBUtagnameqYUsectionqZh5}q[(h7]q\hD]q]h<]q^h:]q_U changelogq`ahF]qah'auUlineqbKUdocumentqchUchildrenqd]qe(cdocutils.nodes title qf)qg}qh(h4X CHANGELOGqihKhVhXhBhYUtitleqjh5}qk(h7]qlhD]qmh<]qnh:]qohF]qpuhbKhchhd]qqcdocutils.nodes Text qrX CHANGELOGqs…qt}qu(h4hihKhgubaubhS)qv}qw(h4UhKhVhXhBhYhZh5}qx(h7]qyhD]qzh<]q{h:]q|U version-1-0-1q}ahF]q~h&auhbKhchhd]q(hf)q€}q(h4X2012/11/5 Version 1.0.1q‚hKhvhXhBhYhjh5}qƒ(h7]q„hD]q…h<]q†h:]q‡hF]qˆuhbKhchhd]q‰hrX2012/11/5 Version 1.0.1qŠ…q‹}qŒ(h4h‚hKh€ubaubhP)q}qŽ(h4UhKhvhXhBhYU bullet_listqh5}q(Ubulletq‘X*h:]q’h<]q“h7]q”hD]q•hF]q–uhbK hchhd]q—hL)q˜}q™(h4XÜFunctions decorated with `patch` variants have a `__wrapped__` attribute pointing to the original function. This brings compatibility with the default behaviour in Python 3.3 (due to a new feature in `functools.wraps`). qšhKhhXhBhYU list_itemq›h5}qœ(h7]qhD]qžh<]qŸh:]q hF]q¡uhbNhchhd]q¢cdocutils.nodes paragraph q£)q¤}q¥(h4XÛFunctions decorated with `patch` variants have a `__wrapped__` attribute pointing to the original function. This brings compatibility with the default behaviour in Python 3.3 (due to a new feature in `functools.wraps`).q¦hKh˜hXhBhYU paragraphq§h5}q¨(h7]q©hD]qªh<]q«h:]q¬hF]q­uhbK hd]q®(hrXFunctions decorated with q¯…q°}q±(h4XFunctions decorated with q²hKh¤ubcdocutils.nodes title_reference q³)q´}qµ(h4X`patch`q¶h5}q·(h7]q¸hD]q¹h<]qºh:]q»hF]q¼uhKh¤hd]q½hrXpatchq¾…q¿}qÀ(h4UhKh´ubahYUtitle_referenceqÁubhrX variants have a qÂ…qÃ}qÄ(h4X variants have a qÅhKh¤ubh³)qÆ}qÇ(h4X `__wrapped__`qÈh5}qÉ(h7]qÊhD]qËh<]qÌh:]qÍhF]qÎuhKh¤hd]qÏhrX __wrapped__qÐ…qÑ}qÒ(h4UhKhÆubahYhÁubhrXŠ attribute pointing to the original function. This brings compatibility with the default behaviour in Python 3.3 (due to a new feature in qÓ…qÔ}qÕ(h4XŠ attribute pointing to the original function. This brings compatibility with the default behaviour in Python 3.3 (due to a new feature in qÖhKh¤ubh³)q×}qØ(h4X`functools.wraps`qÙh5}qÚ(h7]qÛhD]qÜh<]qÝh:]qÞhF]qßuhKh¤hd]qàhrXfunctools.wrapsqá…qâ}qã(h4UhKh×ubahYhÁubhrX).qä…qå}qæ(h4X).qçhKh¤ubeubaubaubh£)qè}qé(h4X³Note that due to changes in `tox`, `mock` is no longer tested with Python 2.4. The compatibility code has not been removed so it probably still works, but tests are no longer run.qêhKhvhXhBhYh§h5}që(h7]qìhD]qíh<]qîh:]qïhF]qðuhbKhchhd]qñ(hrXNote that due to changes in qò…qó}qô(h4XNote that due to changes in qõhKhèubh³)qö}q÷(h4X`tox`qøh5}qù(h7]qúhD]qûh<]qüh:]qýhF]qþuhKhèhd]qÿhrXtoxr…r}r(h4UhKhöubahYhÁubhrX, r…r}r(h4X, rhKhèubh³)r}r(h4X`mock`r h5}r (h7]r hD]r h<]r h:]rhF]ruhKhèhd]rhrXmockr…r}r(h4UhKjubahYhÁubhrXŠ is no longer tested with Python 2.4. The compatibility code has not been removed so it probably still works, but tests are no longer run.r…r}r(h4XŠ is no longer tested with Python 2.4. The compatibility code has not been removed so it probably still works, but tests are no longer run.rhKhèubeubeubhS)r}r(h4UhKhVhXhBhYhZh5}r(h7]rhD]rh<]rh:]rU version-1-0-0rahF]r h auhbKhchhd]r!(hf)r"}r#(h4X2012/10/07 Version 1.0.0r$hKjhXhBhYhjh5}r%(h7]r&hD]r'h<]r(h:]r)hF]r*uhbKhchhd]r+hrX2012/10/07 Version 1.0.0r,…r-}r.(h4j$hKj"ubaubh£)r/}r0(h4X±No changes since 1.0.0 beta 1. This version has feature parity with `unittest.mock `_ in Python 3.3.r1hKjhXhBhYh§h5}r2(h7]r3hD]r4h<]r5h:]r6hF]r7uhbKhchhd]r8(hrXDNo changes since 1.0.0 beta 1. This version has feature parity with r9…r:}r;(h4XDNo changes since 1.0.0 beta 1. This version has feature parity with r<hKj/ubcdocutils.nodes reference r=)r>}r?(h4X^`unittest.mock `_r@h5}rA(UnamerBX unittest.mockrCUrefurirDXKhttp://docs.python.org/py3k/library/unittest.mock.html#module-unittest.mockrEh:]rFh<]rGh7]rHhD]rIhF]rJuhKj/hd]rKhrX unittest.mockrL…rM}rN(h4UhKj>ubahYU referencerOubcdocutils.nodes target rP)rQ}rR(h4XN rSU referencedrTKhKj/hYUtargetrUh5}rV(UrefurirWjEh:]rXU unittest-mockrYah<]rZh7]r[hD]r\hF]r]hauhd]r^ubhrX in Python 3.3.r_…r`}ra(h4X in Python 3.3.rbhKj/ubeubh£)rc}rd(h4XFull list of changes since 0.8:rehKjhXhBhYh§h5}rf(h7]rghD]rhh<]rih:]rjhF]rkuhbKhchhd]rlhrXFull list of changes since 0.8:rm…rn}ro(h4jehKjcubaubhP)rp}rq(h4UhKjhXhBhYhh5}rr(h‘X*h:]rsh<]rth7]ruhD]rvhF]rwuhbKhchhd]rx(hL)ry}rz(h4XL`mocksignature`, along with the `mocksignature` argument to `patch`, removedr{hKjphXhBhYh›h5}r|(h7]r}hD]r~h<]rh:]r€hF]ruhbNhchhd]r‚h£)rƒ}r„(h4j{hKjyhXhBhYh§h5}r…(h7]r†hD]r‡h<]rˆh:]r‰hF]rŠuhbKhd]r‹(h³)rŒ}r(h4X`mocksignature`rŽh5}r(h7]rhD]r‘h<]r’h:]r“hF]r”uhKjƒhd]r•hrX mocksignaturer–…r—}r˜(h4UhKjŒubahYhÁubhrX, along with the r™…rš}r›(h4X, along with the rœhKjƒubh³)r}rž(h4X`mocksignature`rŸh5}r (h7]r¡hD]r¢h<]r£h:]r¤hF]r¥uhKjƒhd]r¦hrX mocksignaturer§…r¨}r©(h4UhKjubahYhÁubhrX argument to rª…r«}r¬(h4X argument to r­hKjƒubh³)r®}r¯(h4X`patch`r°h5}r±(h7]r²hD]r³h<]r´h:]rµhF]r¶uhKjƒhd]r·hrXpatchr¸…r¹}rº(h4UhKj®ubahYhÁubhrX , removedr»…r¼}r½(h4X , removedr¾hKjƒubeubaubhL)r¿}rÀ(h4X]Support for deleting attributes (accessing deleted attributes will raise an `AttributeError`)rÁhKjphXhBhYh›h5}rÂ(h7]rÃhD]rÄh<]rÅh:]rÆhF]rÇuhbNhchhd]rÈh£)rÉ}rÊ(h4X]Support for deleting attributes (accessing deleted attributes will raise an `AttributeError`)rËhKj¿hXhBhYh§h5}rÌ(h7]rÍhD]rÎh<]rÏh:]rÐhF]rÑuhbKhd]rÒ(hrXLSupport for deleting attributes (accessing deleted attributes will raise an rÓ…rÔ}rÕ(h4XLSupport for deleting attributes (accessing deleted attributes will raise an rÖhKjÉubh³)r×}rØ(h4X`AttributeError`rÙh5}rÚ(h7]rÛhD]rÜh<]rÝh:]rÞhF]rßuhKjÉhd]ràhrXAttributeErrorrá…râ}rã(h4UhKj×ubahYhÁubhrX)…rä}rå(h4X)hKjÉubeubaubhL)ræ}rç(h4XDAdded the `mock_open` helper function for mocking the builtin `open`rèhKjphXhBhYh›h5}ré(h7]rêhD]rëh<]rìh:]ríhF]rîuhbNhchhd]rïh£)rð}rñ(h4jèhKjæhXhBhYh§h5}rò(h7]róhD]rôh<]rõh:]röhF]r÷uhbK hd]rø(hrX Added the rù…rú}rû(h4X Added the rühKjðubh³)rý}rþ(h4X `mock_open`rÿh5}r(h7]rhD]rh<]rh:]rhF]ruhKjðhd]rhrX mock_openr…r}r (h4UhKjýubahYhÁubhrX) helper function for mocking the builtin r …r }r (h4X) helper function for mocking the builtin r hKjðubh³)r}r(h4X`open`rh5}r(h7]rhD]rh<]rh:]rhF]ruhKjðhd]rhrXopenr…r}r(h4UhKjubahYhÁubeubaubhL)r}r(h4X\`__class__` is assignable, so a mock can pass an `isinstance` check without requiring a specrhKjphXhBhYh›h5}r(h7]rhD]r h<]r!h:]r"hF]r#uhbNhchhd]r$h£)r%}r&(h4X\`__class__` is assignable, so a mock can pass an `isinstance` check without requiring a specr'hKjhXhBhYh§h5}r((h7]r)hD]r*h<]r+h:]r,hF]r-uhbK!hd]r.(h³)r/}r0(h4X `__class__`r1h5}r2(h7]r3hD]r4h<]r5h:]r6hF]r7uhKj%hd]r8hrX __class__r9…r:}r;(h4UhKj/ubahYhÁubhrX& is assignable, so a mock can pass an r<…r=}r>(h4X& is assignable, so a mock can pass an r?hKj%ubh³)r@}rA(h4X `isinstance`rBh5}rC(h7]rDhD]rEh<]rFh:]rGhF]rHuhKj%hd]rIhrX isinstancerJ…rK}rL(h4UhKj@ubahYhÁubhrX check without requiring a specrM…rN}rO(h4X check without requiring a specrPhKj%ubeubaubhL)rQ}rR(h4X2Addition of `PropertyMock`, for mocking propertiesrShKjphXhBhYh›h5}rT(h7]rUhD]rVh<]rWh:]rXhF]rYuhbNhchhd]rZh£)r[}r\(h4jShKjQhXhBhYh§h5}r](h7]r^hD]r_h<]r`h:]rahF]rbuhbK#hd]rc(hrX Addition of rd…re}rf(h4X Addition of rghKj[ubh³)rh}ri(h4X`PropertyMock`rjh5}rk(h7]rlhD]rmh<]rnh:]rohF]rpuhKj[hd]rqhrX PropertyMockrr…rs}rt(h4UhKjhubahYhÁubhrX, for mocking propertiesru…rv}rw(h4X, for mocking propertiesrxhKj[ubeubaubhL)ry}rz(h4X`MagicMocks` made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return `NotImplemented`r{hKjphXhBhYh›h5}r|(h7]r}hD]r~h<]rh:]r€hF]ruhbNhchhd]r‚h£)rƒ}r„(h4X`MagicMocks` made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return `NotImplemented`r…hKjyhXhBhYh§h5}r†(h7]r‡hD]rˆh<]r‰h:]rŠhF]r‹uhbK$hd]rŒ(h³)r}rŽ(h4X `MagicMocks`rh5}r(h7]r‘hD]r’h<]r“h:]r”hF]r•uhKjƒhd]r–hrX MagicMocksr—…r˜}r™(h4UhKjubahYhÁubhrXs made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return rš…r›}rœ(h4Xs made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return rhKjƒubh³)rž}rŸ(h4X`NotImplemented`r h5}r¡(h7]r¢hD]r£h<]r¤h:]r¥hF]r¦uhKjƒhd]r§hrXNotImplementedr¨…r©}rª(h4UhKjžubahYhÁubeubaubhL)r«}r¬(h4XNPropagate traceback info to support subclassing of `_patch` by other librariesr­hKjphXhBhYh›h5}r®(h7]r¯hD]r°h<]r±h:]r²hF]r³uhbNhchhd]r´h£)rµ}r¶(h4XNPropagate traceback info to support subclassing of `_patch` by other librariesr·hKj«hXhBhYh§h5}r¸(h7]r¹hD]rºh<]r»h:]r¼hF]r½uhbK&hd]r¾(hrX3Propagate traceback info to support subclassing of r¿…rÀ}rÁ(h4X3Propagate traceback info to support subclassing of rÂhKjµubh³)rÃ}rÄ(h4X`_patch`rÅh5}rÆ(h7]rÇhD]rÈh<]rÉh:]rÊhF]rËuhKjµhd]rÌhrX_patchrÍ…rÎ}rÏ(h4UhKjÃubahYhÁubhrX by other librariesrÐ…rÑ}rÒ(h4X by other librariesrÓhKjµubeubaubhL)rÔ}rÕ(h4X–`create_autospec` works with attributes present in results of `dir` that can't be fetched from the object's class. Contributed by Konstantine RybnikovrÖhKjphXhBhYh›h5}r×(h7]rØhD]rÙh<]rÚh:]rÛhF]rÜuhbNhchhd]rÝh£)rÞ}rß(h4X–`create_autospec` works with attributes present in results of `dir` that can't be fetched from the object's class. Contributed by Konstantine RybnikovràhKjÔhXhBhYh§h5}rá(h7]râhD]rãh<]räh:]råhF]ræuhbK(hd]rç(h³)rè}ré(h4X`create_autospec`rêh5}rë(h7]rìhD]ríh<]rîh:]rïhF]rðuhKjÞhd]rñhrXcreate_autospecrò…ró}rô(h4UhKjèubahYhÁubhrX- works with attributes present in results of rõ…rö}r÷(h4X- works with attributes present in results of røhKjÞubh³)rù}rú(h4X`dir`rûh5}rü(h7]rýhD]rþh<]rÿh:]rhF]ruhKjÞhd]rhrXdirr…r}r(h4UhKjùubahYhÁubhrXS that can't be fetched from the object's class. Contributed by Konstantine Rybnikovr…r}r(h4XS that can't be fetched from the object's class. Contributed by Konstantine Rybnikovr hKjÞubeubaubhL)r }r (h4XNAny exceptions in an iterable `side_effect` will be raised instead of returnedr hKjphXhBhYh›h5}r (h7]rhD]rh<]rh:]rhF]ruhbNhchhd]rh£)r}r(h4XNAny exceptions in an iterable `side_effect` will be raised instead of returnedrhKj hXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbK*hd]r(hrXAny exceptions in an iterable r…r}r (h4XAny exceptions in an iterable r!hKjubh³)r"}r#(h4X `side_effect`r$h5}r%(h7]r&hD]r'h<]r(h:]r)hF]r*uhKjhd]r+hrX side_effectr,…r-}r.(h4UhKj"ubahYhÁubhrX# will be raised instead of returnedr/…r0}r1(h4X# will be raised instead of returnedr2hKjubeubaubhL)r3}r4(h4XBIn Python 3, `create_autospec` now supports keyword only argumentsr5hKjphXhBhYh›h5}r6(h7]r7hD]r8h<]r9h:]r:hF]r;uhbNhchhd]r<h£)r=}r>(h4j5hKj3hXhBhYh§h5}r?(h7]r@hD]rAh<]rBh:]rChF]rDuhbK,hd]rE(hrX In Python 3, rF…rG}rH(h4X In Python 3, rIhKj=ubh³)rJ}rK(h4X`create_autospec`rLh5}rM(h7]rNhD]rOh<]rPh:]rQhF]rRuhKj=hd]rShrXcreate_autospecrT…rU}rV(h4UhKjJubahYhÁubhrX$ now supports keyword only argumentsrW…rX}rY(h4X$ now supports keyword only argumentsrZhKj=ubeubaubhL)r[}r\(h4XJAdded `patch.stopall` method to stop all active patches created by `start`r]hKjphXhBhYh›h5}r^(h7]r_hD]r`h<]rah:]rbhF]rcuhbNhchhd]rdh£)re}rf(h4j]hKj[hXhBhYh§h5}rg(h7]rhhD]rih<]rjh:]rkhF]rluhbK-hd]rm(hrXAdded rn…ro}rp(h4XAdded rqhKjeubh³)rr}rs(h4X`patch.stopall`rth5}ru(h7]rvhD]rwh<]rxh:]ryhF]rzuhKjehd]r{hrX patch.stopallr|…r}}r~(h4UhKjrubahYhÁubhrX. method to stop all active patches created by r…r€}r(h4X. method to stop all active patches created by r‚hKjeubh³)rƒ}r„(h4X`start`r…h5}r†(h7]r‡hD]rˆh<]r‰h:]rŠhF]r‹uhKjehd]rŒhrXstartr…rŽ}r(h4UhKjƒubahYhÁubeubaubhL)r}r‘(h4XHBUGFIX: calling `MagicMock.reset_mock` wouldn't reset magic method mocksr’hKjphXhBhYh›h5}r“(h7]r”hD]r•h<]r–h:]r—hF]r˜uhbNhchhd]r™h£)rš}r›(h4j’hKjhXhBhYh§h5}rœ(h7]rhD]ržh<]rŸh:]r hF]r¡uhbK.hd]r¢(hrXBUGFIX: calling r£…r¤}r¥(h4XBUGFIX: calling r¦hKjšubh³)r§}r¨(h4X`MagicMock.reset_mock`r©h5}rª(h7]r«hD]r¬h<]r­h:]r®hF]r¯uhKjšhd]r°hrXMagicMock.reset_mockr±…r²}r³(h4UhKj§ubahYhÁubhrX" wouldn't reset magic method mocksr´…rµ}r¶(h4X" wouldn't reset magic method mocksr·hKjšubeubaubhL)r¸}r¹(h4X\BUGFIX: calling `reset_mock` on a `MagicMock` created with autospec could raise an exceptionrºhKjphXhBhYh›h5}r»(h7]r¼hD]r½h<]r¾h:]r¿hF]rÀuhbNhchhd]rÁh£)rÂ}rÃ(h4X\BUGFIX: calling `reset_mock` on a `MagicMock` created with autospec could raise an exceptionrÄhKj¸hXhBhYh§h5}rÅ(h7]rÆhD]rÇh<]rÈh:]rÉhF]rÊuhbK/hd]rË(hrXBUGFIX: calling rÌ…rÍ}rÎ(h4XBUGFIX: calling rÏhKjÂubh³)rÐ}rÑ(h4X `reset_mock`rÒh5}rÓ(h7]rÔhD]rÕh<]rÖh:]r×hF]rØuhKjÂhd]rÙhrX reset_mockrÚ…rÛ}rÜ(h4UhKjÐubahYhÁubhrX on a rÝ…rÞ}rß(h4X on a ràhKjÂubh³)rá}râ(h4X `MagicMock`rãh5}rä(h7]råhD]ræh<]rçh:]rèhF]réuhKjÂhd]rêhrX MagicMockrë…rì}rí(h4UhKjáubahYhÁubhrX/ created with autospec could raise an exceptionrî…rï}rð(h4X/ created with autospec could raise an exceptionrñhKjÂubeubaubhL)rò}ró(h4X†BUGFIX: passing multiple spec arguments to patchers (`spec` , `spec_set` and `autospec`) had unpredictable results, now it is an errorrôhKjphXhBhYh›h5}rõ(h7]röhD]r÷h<]røh:]rùhF]rúuhbNhchhd]rûh£)rü}rý(h4X†BUGFIX: passing multiple spec arguments to patchers (`spec` , `spec_set` and `autospec`) had unpredictable results, now it is an errorrþhKjòhXhBhYh§h5}rÿ(h7]rhD]rh<]rh:]rhF]ruhbK1hd]r(hrX5BUGFIX: passing multiple spec arguments to patchers (r…r}r(h4X5BUGFIX: passing multiple spec arguments to patchers (r hKjüubh³)r }r (h4X`spec`r h5}r (h7]rhD]rh<]rh:]rhF]ruhKjühd]rhrXspecr…r}r(h4UhKj ubahYhÁubhrX , r…r}r(h4X , rhKjüubh³)r}r(h4X `spec_set`rh5}r(h7]rhD]r h<]r!h:]r"hF]r#uhKjühd]r$hrXspec_setr%…r&}r'(h4UhKjubahYhÁubhrX and r(…r)}r*(h4X and r+hKjüubh³)r,}r-(h4X `autospec`r.h5}r/(h7]r0hD]r1h<]r2h:]r3hF]r4uhKjühd]r5hrXautospecr6…r7}r8(h4UhKj,ubahYhÁubhrX/) had unpredictable results, now it is an errorr9…r:}r;(h4X/) had unpredictable results, now it is an errorr<hKjüubeubaubhL)r=}r>(h4XŽBUGFIX: using `spec=True` *and* `create=True` as arguments to patchers could result in using `DEFAULT` as the spec. Now it is an error insteadr?hKjphXhBhYh›h5}r@(h7]rAhD]rBh<]rCh:]rDhF]rEuhbNhchhd]rFh£)rG}rH(h4XŽBUGFIX: using `spec=True` *and* `create=True` as arguments to patchers could result in using `DEFAULT` as the spec. Now it is an error insteadrIhKj=hXhBhYh§h5}rJ(h7]rKhD]rLh<]rMh:]rNhF]rOuhbK3hd]rP(hrXBUGFIX: using rQ…rR}rS(h4XBUGFIX: using rThKjGubh³)rU}rV(h4X `spec=True`rWh5}rX(h7]rYhD]rZh<]r[h:]r\hF]r]uhKjGhd]r^hrX spec=Truer_…r`}ra(h4UhKjUubahYhÁubhrX …rb}rc(h4X hKjGubcdocutils.nodes emphasis rd)re}rf(h4X*and*rgh5}rh(h7]rihD]rjh<]rkh:]rlhF]rmuhKjGhd]rnhrXandro…rp}rq(h4UhKjeubahYUemphasisrrubhrX …rs}rt(h4X hKjGubh³)ru}rv(h4X `create=True`rwh5}rx(h7]ryhD]rzh<]r{h:]r|hF]r}uhKjGhd]r~hrX create=Truer…r€}r(h4UhKjuubahYhÁubhrX0 as arguments to patchers could result in using r‚…rƒ}r„(h4X0 as arguments to patchers could result in using r…hKjGubh³)r†}r‡(h4X `DEFAULT`rˆh5}r‰(h7]rŠhD]r‹h<]rŒh:]rhF]rŽuhKjGhd]rhrXDEFAULTr…r‘}r’(h4UhKj†ubahYhÁubhrX( as the spec. Now it is an error insteadr“…r”}r•(h4X( as the spec. Now it is an error insteadr–hKjGubeubaubhL)r—}r˜(h4XkBUGFIX: using `spec` or `autospec` arguments to patchers, along with `spec_set=True` did not work correctlyr™hKjphXhBhYh›h5}rš(h7]r›hD]rœh<]rh:]ržhF]rŸuhbNhchhd]r h£)r¡}r¢(h4XkBUGFIX: using `spec` or `autospec` arguments to patchers, along with `spec_set=True` did not work correctlyr£hKj—hXhBhYh§h5}r¤(h7]r¥hD]r¦h<]r§h:]r¨hF]r©uhbK5hd]rª(hrXBUGFIX: using r«…r¬}r­(h4XBUGFIX: using r®hKj¡ubh³)r¯}r°(h4X`spec`r±h5}r²(h7]r³hD]r´h<]rµh:]r¶hF]r·uhKj¡hd]r¸hrXspecr¹…rº}r»(h4UhKj¯ubahYhÁubhrX or r¼…r½}r¾(h4X or r¿hKj¡ubh³)rÀ}rÁ(h4X `autospec`rÂh5}rÃ(h7]rÄhD]rÅh<]rÆh:]rÇhF]rÈuhKj¡hd]rÉhrXautospecrÊ…rË}rÌ(h4UhKjÀubahYhÁubhrX# arguments to patchers, along with rÍ…rÎ}rÏ(h4X# arguments to patchers, along with rÐhKj¡ubh³)rÑ}rÒ(h4X`spec_set=True`rÓh5}rÔ(h7]rÕhD]rÖh<]r×h:]rØhF]rÙuhKj¡hd]rÚhrX spec_set=TruerÛ…rÜ}rÝ(h4UhKjÑubahYhÁubhrX did not work correctlyrÞ…rß}rà(h4X did not work correctlyráhKj¡ubeubaubhL)râ}rã(h4XJBUGFIX: using an object that evaluates to False as a spec could be ignoredrähKjphXhBhYh›h5}rå(h7]ræhD]rçh<]rèh:]réhF]rêuhbNhchhd]rëh£)rì}rí(h4jähKjâhXhBhYh§h5}rî(h7]rïhD]rðh<]rñh:]ròhF]róuhbK7hd]rôhrXJBUGFIX: using an object that evaluates to False as a spec could be ignoredrõ…rö}r÷(h4jähKjìubaubaubhL)rø}rù(h4X–BUGFIX: a list as the `spec` argument to a patcher would always result in a non-callable mock. Now if `__call__` is in the spec the mock is callable rúhKjphXhBhYh›h5}rû(h7]rühD]rýh<]rþh:]rÿhF]ruhbNhchhd]rh£)r}r(h4X”BUGFIX: a list as the `spec` argument to a patcher would always result in a non-callable mock. Now if `__call__` is in the spec the mock is callablerhKjøhXhBhYh§h5}r(h7]rhD]rh<]rh:]r hF]r uhbK8hd]r (hrXBUGFIX: a list as the r …r }r(h4XBUGFIX: a list as the rhKjubh³)r}r(h4X`spec`rh5}r(h7]rhD]rh<]rh:]rhF]ruhKjhd]rhrXspecr…r}r(h4UhKjubahYhÁubhrXJ argument to a patcher would always result in a non-callable mock. Now if r…r}r(h4XJ argument to a patcher would always result in a non-callable mock. Now if r hKjubh³)r!}r"(h4X `__call__`r#h5}r$(h7]r%hD]r&h<]r'h:]r(hF]r)uhKjhd]r*hrX__call__r+…r,}r-(h4UhKj!ubahYhÁubhrX$ is in the spec the mock is callabler.…r/}r0(h4X$ is in the spec the mock is callabler1hKjubeubaubeubeubhS)r2}r3(h4UhKhVhXhBhYhZh5}r4(h7]r5hD]r6h<]r7h:]r8Uversion-1-0-0-beta-1r9ahF]r:hauhbK=hchhd]r;(hf)r<}r=(h4X2012/07/13 Version 1.0.0 beta 1r>hKj2hXhBhYhjh5}r?(h7]r@hD]rAh<]rBh:]rChF]rDuhbK=hchhd]rEhrX2012/07/13 Version 1.0.0 beta 1rF…rG}rH(h4j>hKj<ubaubhP)rI}rJ(h4UhKj2hXhBhYhh5}rK(h‘X*h:]rLh<]rMh7]rNhD]rOhF]rPuhbK?hchhd]rQ(hL)rR}rS(h4XJAdded `patch.stopall` method to stop all active patches created by `start`rThKjIhXhBhYh›h5}rU(h7]rVhD]rWh<]rXh:]rYhF]rZuhbNhchhd]r[h£)r\}r](h4jThKjRhXhBhYh§h5}r^(h7]r_hD]r`h<]rah:]rbhF]rcuhbK?hd]rd(hrXAdded re…rf}rg(h4XAdded rhhKj\ubh³)ri}rj(h4X`patch.stopall`rkh5}rl(h7]rmhD]rnh<]roh:]rphF]rquhKj\hd]rrhrX patch.stopallrs…rt}ru(h4UhKjiubahYhÁubhrX. method to stop all active patches created by rv…rw}rx(h4X. method to stop all active patches created by ryhKj\ubh³)rz}r{(h4X`start`r|h5}r}(h7]r~hD]rh<]r€h:]rhF]r‚uhKj\hd]rƒhrXstartr„…r…}r†(h4UhKjzubahYhÁubeubaubhL)r‡}rˆ(h4XHBUGFIX: calling `MagicMock.reset_mock` wouldn't reset magic method mocksr‰hKjIhXhBhYh›h5}rŠ(h7]r‹hD]rŒh<]rh:]rŽhF]ruhbNhchhd]rh£)r‘}r’(h4j‰hKj‡hXhBhYh§h5}r“(h7]r”hD]r•h<]r–h:]r—hF]r˜uhbK@hd]r™(hrXBUGFIX: calling rš…r›}rœ(h4XBUGFIX: calling rhKj‘ubh³)rž}rŸ(h4X`MagicMock.reset_mock`r h5}r¡(h7]r¢hD]r£h<]r¤h:]r¥hF]r¦uhKj‘hd]r§hrXMagicMock.reset_mockr¨…r©}rª(h4UhKjžubahYhÁubhrX" wouldn't reset magic method mocksr«…r¬}r­(h4X" wouldn't reset magic method mocksr®hKj‘ubeubaubhL)r¯}r°(h4X^BUGFIX: calling `reset_mock` on a `MagicMock` created with autospec could raise an exception r±hKjIhXhBhYh›h5}r²(h7]r³hD]r´h<]rµh:]r¶hF]r·uhbNhchhd]r¸h£)r¹}rº(h4X\BUGFIX: calling `reset_mock` on a `MagicMock` created with autospec could raise an exceptionr»hKj¯hXhBhYh§h5}r¼(h7]r½hD]r¾h<]r¿h:]rÀhF]rÁuhbKAhd]rÂ(hrXBUGFIX: calling rÃ…rÄ}rÅ(h4XBUGFIX: calling rÆhKj¹ubh³)rÇ}rÈ(h4X `reset_mock`rÉh5}rÊ(h7]rËhD]rÌh<]rÍh:]rÎhF]rÏuhKj¹hd]rÐhrX reset_mockrÑ…rÒ}rÓ(h4UhKjÇubahYhÁubhrX on a rÔ…rÕ}rÖ(h4X on a r×hKj¹ubh³)rØ}rÙ(h4X `MagicMock`rÚh5}rÛ(h7]rÜhD]rÝh<]rÞh:]rßhF]ràuhKj¹hd]ráhrX MagicMockrâ…rã}rä(h4UhKjØubahYhÁubhrX/ created with autospec could raise an exceptionrå…ræ}rç(h4X/ created with autospec could raise an exceptionrèhKj¹ubeubaubeubeubhS)ré}rê(h4UhKhVhXhBhYhZh5}rë(h7]rìhD]ríh<]rîh:]rïUversion-1-0-0-alpha-2rðahF]rñh+auhbKFhchhd]rò(hf)ró}rô(h4X 2012/05/04 Version 1.0.0 alpha 2rõhKjéhXhBhYhjh5}rö(h7]r÷hD]røh<]rùh:]rúhF]rûuhbKFhchhd]rührX 2012/05/04 Version 1.0.0 alpha 2rý…rþ}rÿ(h4jõhKjóubaubhP)r}r(h4UhKjéhXhBhYhh5}r(h‘X*h:]rh<]rh7]rhD]rhF]ruhbKHhchhd]r(hL)r }r (h4X7`PropertyMock` attributes are now standard `MagicMocks`r hKjhXhBhYh›h5}r (h7]r hD]rh<]rh:]rhF]ruhbNhchhd]rh£)r}r(h4j hKj hXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbKHhd]r(h³)r}r(h4X`PropertyMock`rh5}r(h7]r hD]r!h<]r"h:]r#hF]r$uhKjhd]r%hrX PropertyMockr&…r'}r((h4UhKjubahYhÁubhrX attributes are now standard r)…r*}r+(h4X attributes are now standard r,hKjubh³)r-}r.(h4X `MagicMocks`r/h5}r0(h7]r1hD]r2h<]r3h:]r4hF]r5uhKjhd]r6hrX MagicMocksr7…r8}r9(h4UhKj-ubahYhÁubeubaubhL)r:}r;(h4X–`create_autospec` works with attributes present in results of `dir` that can't be fetched from the object's class. Contributed by Konstantine Rybnikovr<hKjhXhBhYh›h5}r=(h7]r>hD]r?h<]r@h:]rAhF]rBuhbNhchhd]rCh£)rD}rE(h4X–`create_autospec` works with attributes present in results of `dir` that can't be fetched from the object's class. Contributed by Konstantine RybnikovrFhKj:hXhBhYh§h5}rG(h7]rHhD]rIh<]rJh:]rKhF]rLuhbKIhd]rM(h³)rN}rO(h4X`create_autospec`rPh5}rQ(h7]rRhD]rSh<]rTh:]rUhF]rVuhKjDhd]rWhrXcreate_autospecrX…rY}rZ(h4UhKjNubahYhÁubhrX- works with attributes present in results of r[…r\}r](h4X- works with attributes present in results of r^hKjDubh³)r_}r`(h4X`dir`rah5}rb(h7]rchD]rdh<]reh:]rfhF]rguhKjDhd]rhhrXdirri…rj}rk(h4UhKj_ubahYhÁubhrXS that can't be fetched from the object's class. Contributed by Konstantine Rybnikovrl…rm}rn(h4XS that can't be fetched from the object's class. Contributed by Konstantine RybnikovrohKjDubeubaubhL)rp}rq(h4XNAny exceptions in an iterable `side_effect` will be raised instead of returnedrrhKjhXhBhYh›h5}rs(h7]rthD]ruh<]rvh:]rwhF]rxuhbNhchhd]ryh£)rz}r{(h4XNAny exceptions in an iterable `side_effect` will be raised instead of returnedr|hKjphXhBhYh§h5}r}(h7]r~hD]rh<]r€h:]rhF]r‚uhbKKhd]rƒ(hrXAny exceptions in an iterable r„…r…}r†(h4XAny exceptions in an iterable r‡hKjzubh³)rˆ}r‰(h4X `side_effect`rŠh5}r‹(h7]rŒhD]rh<]rŽh:]rhF]ruhKjzhd]r‘hrX side_effectr’…r“}r”(h4UhKjˆubahYhÁubhrX# will be raised instead of returnedr•…r–}r—(h4X# will be raised instead of returnedr˜hKjzubeubaubhL)r™}rš(h4XDIn Python 3, `create_autospec` now supports keyword only arguments r›hKjhXhBhYh›h5}rœ(h7]rhD]ržh<]rŸh:]r hF]r¡uhbNhchhd]r¢h£)r£}r¤(h4XBIn Python 3, `create_autospec` now supports keyword only argumentsr¥hKj™hXhBhYh§h5}r¦(h7]r§hD]r¨h<]r©h:]rªhF]r«uhbKMhd]r¬(hrX In Python 3, r­…r®}r¯(h4X In Python 3, r°hKj£ubh³)r±}r²(h4X`create_autospec`r³h5}r´(h7]rµhD]r¶h<]r·h:]r¸hF]r¹uhKj£hd]rºhrXcreate_autospecr»…r¼}r½(h4UhKj±ubahYhÁubhrX$ now supports keyword only argumentsr¾…r¿}rÀ(h4X$ now supports keyword only argumentsrÁhKj£ubeubaubeubeubhS)rÂ}rÃ(h4UhKhVhXhBhYhZh5}rÄ(h7]rÅhD]rÆh<]rÇh:]rÈUversion-1-0-0-alpha-1rÉahF]rÊhauhbKQhchhd]rË(hf)rÌ}rÍ(h4X 2012/03/25 Version 1.0.0 alpha 1rÎhKjÂhXhBhYhjh5}rÏ(h7]rÐhD]rÑh<]rÒh:]rÓhF]rÔuhbKQhchhd]rÕhrX 2012/03/25 Version 1.0.0 alpha 1rÖ…r×}rØ(h4jÎhKjÌubaubh£)rÙ}rÚ(h4XThe standard library version!rÛhKjÂhXhBhYh§h5}rÜ(h7]rÝhD]rÞh<]rßh:]ràhF]ráuhbKShchhd]râhrXThe standard library version!rã…rä}rå(h4jÛhKjÙubaubhP)ræ}rç(h4UhKjÂhXhBhYhh5}rè(h‘X*h:]réh<]rêh7]rëhD]rìhF]ríuhbKUhchhd]rî(hL)rï}rð(h4XL`mocksignature`, along with the `mocksignature` argument to `patch`, removedrñhKjæhXhBhYh›h5}rò(h7]róhD]rôh<]rõh:]röhF]r÷uhbNhchhd]røh£)rù}rú(h4jñhKjïhXhBhYh§h5}rû(h7]rühD]rýh<]rþh:]rÿhF]ruhbKUhd]r(h³)r}r(h4X`mocksignature`rh5}r(h7]rhD]rh<]rh:]r hF]r uhKjùhd]r hrX mocksignaturer …r }r(h4UhKjubahYhÁubhrX, along with the r…r}r(h4X, along with the rhKjùubh³)r}r(h4X`mocksignature`rh5}r(h7]rhD]rh<]rh:]rhF]ruhKjùhd]rhrX mocksignaturer…r}r(h4UhKjubahYhÁubhrX argument to r …r!}r"(h4X argument to r#hKjùubh³)r$}r%(h4X`patch`r&h5}r'(h7]r(hD]r)h<]r*h:]r+hF]r,uhKjùhd]r-hrXpatchr.…r/}r0(h4UhKj$ubahYhÁubhrX , removedr1…r2}r3(h4X , removedr4hKjùubeubaubhL)r5}r6(h4X]Support for deleting attributes (accessing deleted attributes will raise an `AttributeError`)r7hKjæhXhBhYh›h5}r8(h7]r9hD]r:h<]r;h:]r<hF]r=uhbNhchhd]r>h£)r?}r@(h4X]Support for deleting attributes (accessing deleted attributes will raise an `AttributeError`)rAhKj5hXhBhYh§h5}rB(h7]rChD]rDh<]rEh:]rFhF]rGuhbKVhd]rH(hrXLSupport for deleting attributes (accessing deleted attributes will raise an rI…rJ}rK(h4XLSupport for deleting attributes (accessing deleted attributes will raise an rLhKj?ubh³)rM}rN(h4X`AttributeError`rOh5}rP(h7]rQhD]rRh<]rSh:]rThF]rUuhKj?hd]rVhrXAttributeErrorrW…rX}rY(h4UhKjMubahYhÁubhrX)…rZ}r[(h4X)hKj?ubeubaubhL)r\}r](h4XDAdded the `mock_open` helper function for mocking the builtin `open`r^hKjæhXhBhYh›h5}r_(h7]r`hD]rah<]rbh:]rchF]rduhbNhchhd]reh£)rf}rg(h4j^hKj\hXhBhYh§h5}rh(h7]rihD]rjh<]rkh:]rlhF]rmuhbKXhd]rn(hrX Added the ro…rp}rq(h4X Added the rrhKjfubh³)rs}rt(h4X `mock_open`ruh5}rv(h7]rwhD]rxh<]ryh:]rzhF]r{uhKjfhd]r|hrX mock_openr}…r~}r(h4UhKjsubahYhÁubhrX) helper function for mocking the builtin r€…r}r‚(h4X) helper function for mocking the builtin rƒhKjfubh³)r„}r…(h4X`open`r†h5}r‡(h7]rˆhD]r‰h<]rŠh:]r‹hF]rŒuhKjfhd]rhrXopenrŽ…r}r(h4UhKj„ubahYhÁubeubaubhL)r‘}r’(h4X\`__class__` is assignable, so a mock can pass an `isinstance` check without requiring a specr“hKjæhXhBhYh›h5}r”(h7]r•hD]r–h<]r—h:]r˜hF]r™uhbNhchhd]ršh£)r›}rœ(h4X\`__class__` is assignable, so a mock can pass an `isinstance` check without requiring a specrhKj‘hXhBhYh§h5}rž(h7]rŸhD]r h<]r¡h:]r¢hF]r£uhbKYhd]r¤(h³)r¥}r¦(h4X `__class__`r§h5}r¨(h7]r©hD]rªh<]r«h:]r¬hF]r­uhKj›hd]r®hrX __class__r¯…r°}r±(h4UhKj¥ubahYhÁubhrX& is assignable, so a mock can pass an r²…r³}r´(h4X& is assignable, so a mock can pass an rµhKj›ubh³)r¶}r·(h4X `isinstance`r¸h5}r¹(h7]rºhD]r»h<]r¼h:]r½hF]r¾uhKj›hd]r¿hrX isinstancerÀ…rÁ}rÂ(h4UhKj¶ubahYhÁubhrX check without requiring a specrÃ…rÄ}rÅ(h4X check without requiring a specrÆhKj›ubeubaubhL)rÇ}rÈ(h4X2Addition of `PropertyMock`, for mocking propertiesrÉhKjæhXhBhYh›h5}rÊ(h7]rËhD]rÌh<]rÍh:]rÎhF]rÏuhbNhchhd]rÐh£)rÑ}rÒ(h4jÉhKjÇhXhBhYh§h5}rÓ(h7]rÔhD]rÕh<]rÖh:]r×hF]rØuhbK[hd]rÙ(hrX Addition of rÚ…rÛ}rÜ(h4X Addition of rÝhKjÑubh³)rÞ}rß(h4X`PropertyMock`ràh5}rá(h7]râhD]rãh<]räh:]råhF]ræuhKjÑhd]rçhrX PropertyMockrè…ré}rê(h4UhKjÞubahYhÁubhrX, for mocking propertiesrë…rì}rí(h4X, for mocking propertiesrîhKjÑubeubaubhL)rï}rð(h4X`MagicMocks` made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return `NotImplemented`rñhKjæhXhBhYh›h5}rò(h7]róhD]rôh<]rõh:]röhF]r÷uhbNhchhd]røh£)rù}rú(h4X`MagicMocks` made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return `NotImplemented`rûhKjïhXhBhYh§h5}rü(h7]rýhD]rþh<]rÿh:]rhF]ruhbK\hd]r(h³)r}r(h4X `MagicMocks`rh5}r(h7]rhD]rh<]r h:]r hF]r uhKjùhd]r hrX MagicMocksr …r}r(h4UhKjubahYhÁubhrXs made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return r…r}r(h4Xs made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return rhKjùubh³)r}r(h4X`NotImplemented`rh5}r(h7]rhD]rh<]rh:]rhF]ruhKjùhd]rhrXNotImplementedr…r}r (h4UhKjubahYhÁubeubaubhL)r!}r"(h4XNPropagate traceback info to support subclassing of `_patch` by other librariesr#hKjæhXhBhYh›h5}r$(h7]r%hD]r&h<]r'h:]r(hF]r)uhbNhchhd]r*h£)r+}r,(h4XNPropagate traceback info to support subclassing of `_patch` by other librariesr-hKj!hXhBhYh§h5}r.(h7]r/hD]r0h<]r1h:]r2hF]r3uhbK^hd]r4(hrX3Propagate traceback info to support subclassing of r5…r6}r7(h4X3Propagate traceback info to support subclassing of r8hKj+ubh³)r9}r:(h4X`_patch`r;h5}r<(h7]r=hD]r>h<]r?h:]r@hF]rAuhKj+hd]rBhrX_patchrC…rD}rE(h4UhKj9ubahYhÁubhrX by other librariesrF…rG}rH(h4X by other librariesrIhKj+ubeubaubhL)rJ}rK(h4X†BUGFIX: passing multiple spec arguments to patchers (`spec` , `spec_set` and `autospec`) had unpredictable results, now it is an errorrLhKjæhXhBhYh›h5}rM(h7]rNhD]rOh<]rPh:]rQhF]rRuhbNhchhd]rSh£)rT}rU(h4X†BUGFIX: passing multiple spec arguments to patchers (`spec` , `spec_set` and `autospec`) had unpredictable results, now it is an errorrVhKjJhXhBhYh§h5}rW(h7]rXhD]rYh<]rZh:]r[hF]r\uhbK`hd]r](hrX5BUGFIX: passing multiple spec arguments to patchers (r^…r_}r`(h4X5BUGFIX: passing multiple spec arguments to patchers (rahKjTubh³)rb}rc(h4X`spec`rdh5}re(h7]rfhD]rgh<]rhh:]rihF]rjuhKjThd]rkhrXspecrl…rm}rn(h4UhKjbubahYhÁubhrX , ro…rp}rq(h4X , rrhKjTubh³)rs}rt(h4X `spec_set`ruh5}rv(h7]rwhD]rxh<]ryh:]rzhF]r{uhKjThd]r|hrXspec_setr}…r~}r(h4UhKjsubahYhÁubhrX and r€…r}r‚(h4X and rƒhKjTubh³)r„}r…(h4X `autospec`r†h5}r‡(h7]rˆhD]r‰h<]rŠh:]r‹hF]rŒuhKjThd]rhrXautospecrŽ…r}r(h4UhKj„ubahYhÁubhrX/) had unpredictable results, now it is an errorr‘…r’}r“(h4X/) had unpredictable results, now it is an errorr”hKjTubeubaubhL)r•}r–(h4XŽBUGFIX: using `spec=True` *and* `create=True` as arguments to patchers could result in using `DEFAULT` as the spec. Now it is an error insteadr—hKjæhXhBhYh›h5}r˜(h7]r™hD]ršh<]r›h:]rœhF]ruhbNhchhd]ržh£)rŸ}r (h4XŽBUGFIX: using `spec=True` *and* `create=True` as arguments to patchers could result in using `DEFAULT` as the spec. Now it is an error insteadr¡hKj•hXhBhYh§h5}r¢(h7]r£hD]r¤h<]r¥h:]r¦hF]r§uhbKbhd]r¨(hrXBUGFIX: using r©…rª}r«(h4XBUGFIX: using r¬hKjŸubh³)r­}r®(h4X `spec=True`r¯h5}r°(h7]r±hD]r²h<]r³h:]r´hF]rµuhKjŸhd]r¶hrX spec=Truer·…r¸}r¹(h4UhKj­ubahYhÁubhrX …rº}r»(h4X hKjŸubjd)r¼}r½(h4X*and*r¾h5}r¿(h7]rÀhD]rÁh<]rÂh:]rÃhF]rÄuhKjŸhd]rÅhrXandrÆ…rÇ}rÈ(h4UhKj¼ubahYjrubhrX …rÉ}rÊ(h4X hKjŸubh³)rË}rÌ(h4X `create=True`rÍh5}rÎ(h7]rÏhD]rÐh<]rÑh:]rÒhF]rÓuhKjŸhd]rÔhrX create=TruerÕ…rÖ}r×(h4UhKjËubahYhÁubhrX0 as arguments to patchers could result in using rØ…rÙ}rÚ(h4X0 as arguments to patchers could result in using rÛhKjŸubh³)rÜ}rÝ(h4X `DEFAULT`rÞh5}rß(h7]ràhD]ráh<]râh:]rãhF]räuhKjŸhd]råhrXDEFAULTræ…rç}rè(h4UhKjÜubahYhÁubhrX( as the spec. Now it is an error insteadré…rê}rë(h4X( as the spec. Now it is an error insteadrìhKjŸubeubaubhL)rí}rî(h4XkBUGFIX: using `spec` or `autospec` arguments to patchers, along with `spec_set=True` did not work correctlyrïhKjæhXhBhYh›h5}rð(h7]rñhD]ròh<]róh:]rôhF]rõuhbNhchhd]röh£)r÷}rø(h4XkBUGFIX: using `spec` or `autospec` arguments to patchers, along with `spec_set=True` did not work correctlyrùhKjíhXhBhYh§h5}rú(h7]rûhD]rüh<]rýh:]rþhF]rÿuhbKdhd]r (hrXBUGFIX: using r …r }r (h4XBUGFIX: using r hKj÷ubh³)r }r (h4X`spec`r h5}r (h7]r hD]r h<]r h:]r hF]r uhKj÷hd]r hrXspecr …r }r (h4UhKj ubahYhÁubhrX or r …r }r (h4X or r hKj÷ubh³)r }r (h4X `autospec`r h5}r (h7]r hD]r h<]r h:]r hF]r uhKj÷hd]r hrXautospecr …r! }r" (h4UhKj ubahYhÁubhrX# arguments to patchers, along with r# …r$ }r% (h4X# arguments to patchers, along with r& hKj÷ubh³)r' }r( (h4X`spec_set=True`r) h5}r* (h7]r+ hD]r, h<]r- h:]r. hF]r/ uhKj÷hd]r0 hrX spec_set=Truer1 …r2 }r3 (h4UhKj' ubahYhÁubhrX did not work correctlyr4 …r5 }r6 (h4X did not work correctlyr7 hKj÷ubeubaubhL)r8 }r9 (h4XJBUGFIX: using an object that evaluates to False as a spec could be ignoredr: hKjæhXhBhYh›h5}r; (h7]r< hD]r= h<]r> h:]r? hF]r@ uhbNhchhd]rA h£)rB }rC (h4j: hKj8 hXhBhYh§h5}rD (h7]rE hD]rF h<]rG h:]rH hF]rI uhbKfhd]rJ hrXJBUGFIX: using an object that evaluates to False as a spec could be ignoredrK …rL }rM (h4j: hKjB ubaubaubhL)rN }rO (h4X–BUGFIX: a list as the `spec` argument to a patcher would always result in a non-callable mock. Now if `__call__` is in the spec the mock is callable rP hKjæhXhBhYh›h5}rQ (h7]rR hD]rS h<]rT h:]rU hF]rV uhbNhchhd]rW h£)rX }rY (h4X”BUGFIX: a list as the `spec` argument to a patcher would always result in a non-callable mock. Now if `__call__` is in the spec the mock is callablerZ hKjN hXhBhYh§h5}r[ (h7]r\ hD]r] h<]r^ h:]r_ hF]r` uhbKghd]ra (hrXBUGFIX: a list as the rb …rc }rd (h4XBUGFIX: a list as the re hKjX ubh³)rf }rg (h4X`spec`rh h5}ri (h7]rj hD]rk h<]rl h:]rm hF]rn uhKjX hd]ro hrXspecrp …rq }rr (h4UhKjf ubahYhÁubhrXJ argument to a patcher would always result in a non-callable mock. Now if rs …rt }ru (h4XJ argument to a patcher would always result in a non-callable mock. Now if rv hKjX ubh³)rw }rx (h4X `__call__`ry h5}rz (h7]r{ hD]r| h<]r} h:]r~ hF]r uhKjX hd]r€ hrX__call__r …r‚ }rƒ (h4UhKjw ubahYhÁubhrX$ is in the spec the mock is callabler„ …r… }r† (h4X$ is in the spec the mock is callabler‡ hKjX ubeubaubeubeubhS)rˆ }r‰ (h4UhKhVhXhBhYhZh5}rŠ (h7]r‹ hD]rŒ h<]r h:]rŽ U version-0-8-0r ahF]r h!auhbKlhchhd]r‘ (hf)r’ }r“ (h4X2012/02/13 Version 0.8.0r” hKjˆ hXhBhYhjh5}r• (h7]r– hD]r— h<]r˜ h:]r™ hF]rš uhbKlhchhd]r› hrX2012/02/13 Version 0.8.0rœ …r }rž (h4j” hKj’ ubaubh£)rŸ }r  (h4X"The only changes since 0.8rc2 are:r¡ hKjˆ hXhBhYh§h5}r¢ (h7]r£ hD]r¤ h<]r¥ h:]r¦ hF]r§ uhbKnhchhd]r¨ hrX"The only changes since 0.8rc2 are:r© …rª }r« (h4j¡ hKjŸ ubaubhP)r¬ }r­ (h4UhKjˆ hXhBhYhh5}r® (h‘X*h:]r¯ h<]r° h7]r± hD]r² hF]r³ uhbKphchhd]r´ (hL)rµ }r¶ (h4X)Improved repr of :data:`sentinel` objectsr· hKj¬ hXhBhYh›h5}r¸ (h7]r¹ hD]rº h<]r» h:]r¼ hF]r½ uhbNhchhd]r¾ h£)r¿ }rÀ (h4j· hKjµ hXhBhYh§h5}rÁ (h7]r hD]rà h<]rÄ h:]rÅ hF]rÆ uhbKphd]rÇ (hrXImproved repr of rÈ …rÉ }rÊ (h4XImproved repr of rË hKj¿ ubcsphinx.addnodes pending_xref rÌ )rÍ }rÎ (h4X:data:`sentinel`rÏ hKj¿ hXhBhYU pending_xrefrÐ h5}rÑ (UreftyperÒ XdatarÓ UrefwarnrÔ ‰U reftargetrÕ XsentinelrÖ U refdomainr× XpyrØ h:]rÙ h<]rÚ U refexplicitrÛ ‰h7]rÜ hD]rÝ hF]rÞ Urefdocrß U changelogrà Upy:classrá NU py:modulerâ Xmockrã uhbKphd]rä cdocutils.nodes literal rå )ræ }rç (h4jÏ h5}rè (h7]ré hD]rê (Uxrefrë jØ Xpy-datarì eh<]rí h:]rî hF]rï uhKjÍ hd]rð hrXsentinelrñ …rò }ró (h4UhKjæ ubahYUliteralrô ubaubhrX objectsrõ …rö }r÷ (h4X objectsrø hKj¿ ubeubaubhL)rù }rú (h4XD:data:`ANY` can be used for comparisons against :data:`call` objectsrû hKj¬ hXhBhYh›h5}rü (h7]rý hD]rþ h<]rÿ h:]r hF]r uhbNhchhd]r h£)r }r (h4jû hKjù hXhBhYh§h5}r (h7]r hD]r h<]r h:]r hF]r uhbKqhd]r (jÌ )r }r (h4X :data:`ANY`r hKj hXhBhYjÐ h5}r (Ureftyper Xdatar jÔ ‰jÕ XANYr U refdomainr Xpyr h:]r h<]r U refexplicitr ‰h7]r hD]r hF]r jß jà já Njâ jã uhbKqhd]r jå )r }r (h4j h5}r (h7]r hD]r (jë j Xpy-datar! eh<]r" h:]r# hF]r$ uhKj hd]r% hrXANYr& …r' }r( (h4UhKj ubahYjô ubaubhrX% can be used for comparisons against r) …r* }r+ (h4X% can be used for comparisons against r, hKj ubjÌ )r- }r. (h4X :data:`call`r/ hKj hXhBhYjÐ h5}r0 (Ureftyper1 Xdatar2 jÔ ‰jÕ Xcallr3 U refdomainr4 Xpyr5 h:]r6 h<]r7 U refexplicitr8 ‰h7]r9 hD]r: hF]r; jß jà já Njâ jã uhbKqhd]r< jå )r= }r> (h4j/ h5}r? (h7]r@ hD]rA (jë j5 Xpy-datarB eh<]rC h:]rD hF]rE uhKj- hd]rF hrXcallrG …rH }rI (h4UhKj= ubahYjô ubaubhrX objectsrJ …rK }rL (h4X objectsrM hKj ubeubaubhL)rN }rO (h4XpThe return value of `MagicMock.__iter__` method can be set to any iterable and isn't required to be an iterator rP hKj¬ hXhBhYh›h5}rQ (h7]rR hD]rS h<]rT h:]rU hF]rV uhbNhchhd]rW h£)rX }rY (h4XoThe return value of `MagicMock.__iter__` method can be set to any iterable and isn't required to be an iteratorrZ hKjN hXhBhYh§h5}r[ (h7]r\ hD]r] h<]r^ h:]r_ hF]r` uhbKrhd]ra (hrXThe return value of rb …rc }rd (h4XThe return value of re hKjX ubh³)rf }rg (h4X`MagicMock.__iter__`rh h5}ri (h7]rj hD]rk h<]rl h:]rm hF]rn uhKjX hd]ro hrXMagicMock.__iter__rp …rq }rr (h4UhKjf ubahYhÁubhrXG method can be set to any iterable and isn't required to be an iteratorrs …rt }ru (h4XG method can be set to any iterable and isn't required to be an iteratorrv hKjX ubeubaubeubh£)rw }rx (h4XFull List of changes since 0.7:ry hKjˆ hXhBhYh§h5}rz (h7]r{ hD]r| h<]r} h:]r~ hF]r uhbKuhchhd]r€ hrXFull List of changes since 0.7:r …r‚ }rƒ (h4jy hKjw ubaubh£)r„ }r… (h4X<mock 0.8.0 is the last version that will support Python 2.4.r† hKjˆ hXhBhYh§h5}r‡ (h7]rˆ hD]r‰ h<]rŠ h:]r‹ hF]rŒ uhbKwhchhd]r hrX<mock 0.8.0 is the last version that will support Python 2.4.rŽ …r }r (h4j† hKj„ ubaubhP)r‘ }r’ (h4UhKjˆ hXhBhYhh5}r“ (h‘X*h:]r” h<]r• h7]r– hD]r— hF]r˜ uhbKyhchhd]r™ (hL)rš }r› (h4XeAddition of :attr:`~Mock.mock_calls` list for *all* calls (including magic methods and chained calls)rœ hKj‘ hXhBhYh›h5}r (h7]rž hD]rŸ h<]r  h:]r¡ hF]r¢ uhbNhchhd]r£ h£)r¤ }r¥ (h4XeAddition of :attr:`~Mock.mock_calls` list for *all* calls (including magic methods and chained calls)r¦ hKjš hXhBhYh§h5}r§ (h7]r¨ hD]r© h<]rª h:]r« hF]r¬ uhbKyhd]r­ (hrX Addition of r® …r¯ }r° (h4X Addition of r± hKj¤ ubjÌ )r² }r³ (h4X:attr:`~Mock.mock_calls`r´ hKj¤ hXhBhYjÐ h5}rµ (Ureftyper¶ Xattrr· jÔ ‰jÕ XMock.mock_callsr¸ U refdomainr¹ Xpyrº h:]r» h<]r¼ U refexplicitr½ ‰h7]r¾ hD]r¿ hF]rÀ jß jà já Njâ jã uhbKyhd]rÁ jå )r }rà (h4j´ h5}rÄ (h7]rÅ hD]rÆ (jë jº Xpy-attrrÇ eh<]rÈ h:]rÉ hF]rÊ uhKj² hd]rË hrX mock_callsrÌ …rÍ }rÎ (h4UhKj ubahYjô ubaubhrX list for rÏ …rÐ }rÑ (h4X list for rÒ hKj¤ ubjd)rÓ }rÔ (h4X*all*rÕ h5}rÖ (h7]r× hD]rØ h<]rÙ h:]rÚ hF]rÛ uhKj¤ hd]rÜ hrXallrÝ …rÞ }rß (h4UhKjÓ ubahYjrubhrX2 calls (including magic methods and chained calls)rà …rá }râ (h4X2 calls (including magic methods and chained calls)rã hKj¤ ubeubaubhL)rä }rå (h4Xl:func:`patch` and :func:`patch.object` now create a :class:`MagicMock` instead of a :class:`Mock` by defaultræ hKj‘ hXhBhYh›h5}rç (h7]rè hD]ré h<]rê h:]rë hF]rì uhbNhchhd]rí h£)rî }rï (h4Xl:func:`patch` and :func:`patch.object` now create a :class:`MagicMock` instead of a :class:`Mock` by defaultrð hKjä hXhBhYh§h5}rñ (h7]rò hD]ró h<]rô h:]rõ hF]rö uhbK{hd]r÷ (jÌ )rø }rù (h4X :func:`patch`rú hKjî hXhBhYjÐ h5}rû (Ureftyperü Xfuncrý jÔ ‰jÕ Xpatchrþ U refdomainrÿ Xpyr h:]r h<]r U refexplicitr ‰h7]r hD]r hF]r jß jà já Njâ jã uhbK{hd]r jå )r }r (h4jú h5}r (h7]r hD]r (jë j Xpy-funcr eh<]r h:]r hF]r uhKjø hd]r hrXpatch()r …r }r (h4UhKj ubahYjô ubaubhrX and r …r }r (h4X and r hKjî ubjÌ )r }r (h4X:func:`patch.object`r hKjî hXhBhYjÐ h5}r (Ureftyper Xfuncr jÔ ‰jÕ X patch.objectr U refdomainr Xpyr! h:]r" h<]r# U refexplicitr$ ‰h7]r% hD]r& hF]r' jß jà já Njâ jã uhbK{hd]r( jå )r) }r* (h4j h5}r+ (h7]r, hD]r- (jë j! Xpy-funcr. eh<]r/ h:]r0 hF]r1 uhKj hd]r2 hrXpatch.object()r3 …r4 }r5 (h4UhKj) ubahYjô ubaubhrX now create a r6 …r7 }r8 (h4X now create a r9 hKjî ubjÌ )r: }r; (h4X:class:`MagicMock`r< hKjî hXhBhYjÐ h5}r= (Ureftyper> Xclassr? jÔ ‰jÕ X MagicMockr@ U refdomainrA XpyrB h:]rC h<]rD U refexplicitrE ‰h7]rF hD]rG hF]rH jß jà já Njâ jã uhbK{hd]rI jå )rJ }rK (h4j< h5}rL (h7]rM hD]rN (jë jB Xpy-classrO eh<]rP h:]rQ hF]rR uhKj: hd]rS hrX MagicMockrT …rU }rV (h4UhKjJ ubahYjô ubaubhrX instead of a rW …rX }rY (h4X instead of a rZ hKjî ubjÌ )r[ }r\ (h4X :class:`Mock`r] hKjî hXhBhYjÐ h5}r^ (Ureftyper_ Xclassr` jÔ ‰jÕ XMockra U refdomainrb Xpyrc h:]rd h<]re U refexplicitrf ‰h7]rg hD]rh hF]ri jß jà já Njâ jã uhbK{hd]rj jå )rk }rl (h4j] h5}rm (h7]rn hD]ro (jë jc Xpy-classrp eh<]rq h:]rr hF]rs uhKj[ hd]rt hrXMockru …rv }rw (h4UhKjk ubahYjô ubaubhrX by defaultrx …ry }rz (h4X by defaultr{ hKjî ubeubaubhL)r| }r} (h4XˆThe patchers (`patch`, `patch.object` and `patch.dict`), plus `Mock` and `MagicMock`, take arbitrary keyword arguments for configurationr~ hKj‘ hXhBhYh›h5}r (h7]r€ hD]r h<]r‚ h:]rƒ hF]r„ uhbNhchhd]r… h£)r† }r‡ (h4XˆThe patchers (`patch`, `patch.object` and `patch.dict`), plus `Mock` and `MagicMock`, take arbitrary keyword arguments for configurationrˆ hKj| hXhBhYh§h5}r‰ (h7]rŠ hD]r‹ h<]rŒ h:]r hF]rŽ uhbK}hd]r (hrXThe patchers (r …r‘ }r’ (h4XThe patchers (r“ hKj† ubh³)r” }r• (h4X`patch`r– h5}r— (h7]r˜ hD]r™ h<]rš h:]r› hF]rœ uhKj† hd]r hrXpatchrž …rŸ }r  (h4UhKj” ubahYhÁubhrX, r¡ …r¢ }r£ (h4X, r¤ hKj† ubh³)r¥ }r¦ (h4X`patch.object`r§ h5}r¨ (h7]r© hD]rª h<]r« h:]r¬ hF]r­ uhKj† hd]r® hrX patch.objectr¯ …r° }r± (h4UhKj¥ ubahYhÁubhrX and r² …r³ }r´ (h4X and rµ hKj† ubh³)r¶ }r· (h4X `patch.dict`r¸ h5}r¹ (h7]rº hD]r» h<]r¼ h:]r½ hF]r¾ uhKj† hd]r¿ hrX patch.dictrÀ …rÁ }r (h4UhKj¶ ubahYhÁubhrX), plus rà …rÄ }rÅ (h4X), plus rÆ hKj† ubh³)rÇ }rÈ (h4X`Mock`rÉ h5}rÊ (h7]rË hD]rÌ h<]rÍ h:]rÎ hF]rÏ uhKj† hd]rÐ hrXMockrÑ …rÒ }rÓ (h4UhKjÇ ubahYhÁubhrX and rÔ …rÕ }rÖ (h4X and r× hKj† ubh³)rØ }rÙ (h4X `MagicMock`rÚ h5}rÛ (h7]rÜ hD]rÝ h<]rÞ h:]rß hF]rà uhKj† hd]rá hrX MagicMockrâ …rã }rä (h4UhKjØ ubahYhÁubhrX4, take arbitrary keyword arguments for configurationrå …ræ }rç (h4X4, take arbitrary keyword arguments for configurationrè hKj† ubeubaubhL)ré }rê (h4XƒNew mock method :meth:`~Mock.configure_mock` for setting attributes and return values / side effects on the mock and its attributesrë hKj‘ hXhBhYh›h5}rì (h7]rí hD]rî h<]rï h:]rð hF]rñ uhbNhchhd]rò h£)ró }rô (h4XƒNew mock method :meth:`~Mock.configure_mock` for setting attributes and return values / side effects on the mock and its attributesrõ hKjé hXhBhYh§h5}rö (h7]r÷ hD]rø h<]rù h:]rú hF]rû uhbKhd]rü (hrXNew mock method rý …rþ }rÿ (h4XNew mock method r hKjó ubjÌ )r }r (h4X:meth:`~Mock.configure_mock`r hKjó hXhBhYjÐ h5}r (Ureftyper Xmethr jÔ ‰jÕ XMock.configure_mockr U refdomainr Xpyr h:]r h<]r U refexplicitr ‰h7]r hD]r hF]r jß jà já Njâ jã uhbKhd]r jå )r }r (h4j h5}r (h7]r hD]r (jë j Xpy-methr eh<]r h:]r hF]r uhKj hd]r hrXconfigure_mock()r …r }r (h4UhKj ubahYjô ubaubhrXW for setting attributes and return values / side effects on the mock and its attributesr …r }r (h4XW for setting attributes and return values / side effects on the mock and its attributesr! hKjó ubeubaubhL)r" }r# (h4XXNew mock assert methods :meth:`~Mock.assert_any_call` and :meth:`~Mock.assert_has_calls`r$ hKj‘ hXhBhYh›h5}r% (h7]r& hD]r' h<]r( h:]r) hF]r* uhbNhchhd]r+ h£)r, }r- (h4XXNew mock assert methods :meth:`~Mock.assert_any_call` and :meth:`~Mock.assert_has_calls`r. hKj" hXhBhYh§h5}r/ (h7]r0 hD]r1 h<]r2 h:]r3 hF]r4 uhbKhd]r5 (hrXNew mock assert methods r6 …r7 }r8 (h4XNew mock assert methods r9 hKj, ubjÌ )r: }r; (h4X:meth:`~Mock.assert_any_call`r< hKj, hXhBhYjÐ h5}r= (Ureftyper> Xmethr? jÔ ‰jÕ XMock.assert_any_callr@ U refdomainrA XpyrB h:]rC h<]rD U refexplicitrE ‰h7]rF hD]rG hF]rH jß jà já Njâ jã uhbKhd]rI jå )rJ }rK (h4j< h5}rL (h7]rM hD]rN (jë jB Xpy-methrO eh<]rP h:]rQ hF]rR uhKj: hd]rS hrXassert_any_call()rT …rU }rV (h4UhKjJ ubahYjô ubaubhrX and rW …rX }rY (h4X and rZ hKj, ubjÌ )r[ }r\ (h4X:meth:`~Mock.assert_has_calls`r] hKj, hXhBhYjÐ h5}r^ (Ureftyper_ Xmethr` jÔ ‰jÕ XMock.assert_has_callsra U refdomainrb Xpyrc h:]rd h<]re U refexplicitrf ‰h7]rg hD]rh hF]ri jß jà já Njâ jã uhbKhd]rj jå )rk }rl (h4j] h5}rm (h7]rn hD]ro (jë jc Xpy-methrp eh<]rq h:]rr hF]rs uhKj[ hd]rt hrXassert_has_calls()ru …rv }rw (h4UhKjk ubahYjô ubaubeubaubhL)rx }ry (h4X˜Implemented :ref:`auto-speccing` (recursive, lazy speccing of mocks with mocked signatures for functions/methods), as the `autospec` argument to `patch`rz hKj‘ hXhBhYh›h5}r{ (h7]r| hD]r} h<]r~ h:]r hF]r€ uhbNhchhd]r h£)r‚ }rƒ (h4X˜Implemented :ref:`auto-speccing` (recursive, lazy speccing of mocks with mocked signatures for functions/methods), as the `autospec` argument to `patch`r„ hKjx hXhBhYh§h5}r… (h7]r† hD]r‡ h<]rˆ h:]r‰ hF]rŠ uhbKƒhd]r‹ (hrX Implemented rŒ …r }rŽ (h4X Implemented r hKj‚ ubjÌ )r }r‘ (h4X:ref:`auto-speccing`r’ hKj‚ hXhBhYjÐ h5}r“ (Ureftyper” Xrefr• jÔ ˆjÕ X auto-speccingr– U refdomainr— Xstdr˜ h:]r™ h<]rš U refexplicitr› ‰h7]rœ hD]r hF]rž jß jà uhbKƒhd]rŸ jd)r  }r¡ (h4j’ h5}r¢ (h7]r£ hD]r¤ (jë j˜ Xstd-refr¥ eh<]r¦ h:]r§ hF]r¨ uhKj hd]r© hrX auto-speccingrª …r« }r¬ (h4UhKj  ubahYjrubaubhrXZ (recursive, lazy speccing of mocks with mocked signatures for functions/methods), as the r­ …r® }r¯ (h4XZ (recursive, lazy speccing of mocks with mocked signatures for functions/methods), as the r° hKj‚ ubh³)r± }r² (h4X `autospec`r³ h5}r´ (h7]rµ hD]r¶ h<]r· h:]r¸ hF]r¹ uhKj‚ hd]rº hrXautospecr» …r¼ }r½ (h4UhKj± ubahYhÁubhrX argument to r¾ …r¿ }rÀ (h4X argument to rÁ hKj‚ ubh³)r }rà (h4X`patch`rÄ h5}rÅ (h7]rÆ hD]rÇ h<]rÈ h:]rÉ hF]rÊ uhKj‚ hd]rË hrXpatchrÌ …rÍ }rÎ (h4UhKj ubahYhÁubeubaubhL)rÏ }rÐ (h4XUAdded the :func:`create_autospec` function for manually creating 'auto-specced' mocksrÑ hKj‘ hXhBhYh›h5}rÒ (h7]rÓ hD]rÔ h<]rÕ h:]rÖ hF]r× uhbNhchhd]rØ h£)rÙ }rÚ (h4XUAdded the :func:`create_autospec` function for manually creating 'auto-specced' mocksrÛ hKjÏ hXhBhYh§h5}rÜ (h7]rÝ hD]rÞ h<]rß h:]rà hF]rá uhbK†hd]râ (hrX Added the rã …rä }rå (h4X Added the ræ hKjÙ ubjÌ )rç }rè (h4X:func:`create_autospec`ré hKjÙ hXhBhYjÐ h5}rê (Ureftyperë Xfuncrì jÔ ‰jÕ Xcreate_autospecrí U refdomainrî Xpyrï h:]rð h<]rñ U refexplicitrò ‰h7]ró hD]rô hF]rõ jß jà já Njâ jã uhbK†hd]rö jå )r÷ }rø (h4jé h5}rù (h7]rú hD]rû (jë jï Xpy-funcrü eh<]rý h:]rþ hF]rÿ uhKjç hd]r hrXcreate_autospec()r …r }r (h4UhKj÷ ubahYjô ubaubhrX4 function for manually creating 'auto-specced' mocksr …r }r (h4X4 function for manually creating 'auto-specced' mocksr hKjÙ ubeubaubhL)r }r (h4X[:func:`patch.multiple` for doing multiple patches in a single call, using keyword argumentsr hKj‘ hXhBhYh›h5}r (h7]r hD]r h<]r h:]r hF]r uhbNhchhd]r h£)r }r (h4X[:func:`patch.multiple` for doing multiple patches in a single call, using keyword argumentsr hKj hXhBhYh§h5}r (h7]r hD]r h<]r h:]r hF]r uhbKˆhd]r (jÌ )r }r (h4X:func:`patch.multiple`r hKj hXhBhYjÐ h5}r (Ureftyper Xfuncr! jÔ ‰jÕ Xpatch.multipler" U refdomainr# Xpyr$ h:]r% h<]r& U refexplicitr' ‰h7]r( hD]r) hF]r* jß jà já Njâ jã uhbKˆhd]r+ jå )r, }r- (h4j h5}r. (h7]r/ hD]r0 (jë j$ Xpy-funcr1 eh<]r2 h:]r3 hF]r4 uhKj hd]r5 hrXpatch.multiple()r6 …r7 }r8 (h4UhKj, ubahYjô ubaubhrXE for doing multiple patches in a single call, using keyword argumentsr9 …r: }r; (h4XE for doing multiple patches in a single call, using keyword argumentsr< hKj ubeubaubhL)r= }r> (h4XxSetting :attr:`~Mock.side_effect` to an iterable will cause calls to the mock to return the next value from the iterabler? hKj‘ hXhBhYh›h5}r@ (h7]rA hD]rB h<]rC h:]rD hF]rE uhbNhchhd]rF h£)rG }rH (h4XxSetting :attr:`~Mock.side_effect` to an iterable will cause calls to the mock to return the next value from the iterablerI hKj= hXhBhYh§h5}rJ (h7]rK hD]rL h<]rM h:]rN hF]rO uhbKŠhd]rP (hrXSetting rQ …rR }rS (h4XSetting rT hKjG ubjÌ )rU }rV (h4X:attr:`~Mock.side_effect`rW hKjG hXhBhYjÐ h5}rX (UreftyperY XattrrZ jÔ ‰jÕ XMock.side_effectr[ U refdomainr\ Xpyr] h:]r^ h<]r_ U refexplicitr` ‰h7]ra hD]rb hF]rc jß jà já Njâ jã uhbKŠhd]rd jå )re }rf (h4jW h5}rg (h7]rh hD]ri (jë j] Xpy-attrrj eh<]rk h:]rl hF]rm uhKjU hd]rn hrX side_effectro …rp }rq (h4UhKje ubahYjô ubaubhrXW to an iterable will cause calls to the mock to return the next value from the iterablerr …rs }rt (h4XW to an iterable will cause calls to the mock to return the next value from the iterableru hKjG ubeubaubhL)rv }rw (h4X½New `new_callable` argument to `patch` and `patch.object` allowing you to pass in a class or callable object (instead of `MagicMock`) that will be called to replace the object being patchedrx hKj‘ hXhBhYh›h5}ry (h7]rz hD]r{ h<]r| h:]r} hF]r~ uhbNhchhd]r h£)r€ }r (h4X½New `new_callable` argument to `patch` and `patch.object` allowing you to pass in a class or callable object (instead of `MagicMock`) that will be called to replace the object being patchedr‚ hKjv hXhBhYh§h5}rƒ (h7]r„ hD]r… h<]r† h:]r‡ hF]rˆ uhbKŒhd]r‰ (hrXNew rŠ …r‹ }rŒ (h4XNew r hKj€ ubh³)rŽ }r (h4X`new_callable`r h5}r‘ (h7]r’ hD]r“ h<]r” h:]r• hF]r– uhKj€ hd]r— hrX new_callabler˜ …r™ }rš (h4UhKjŽ ubahYhÁubhrX argument to r› …rœ }r (h4X argument to rž hKj€ ubh³)rŸ }r  (h4X`patch`r¡ h5}r¢ (h7]r£ hD]r¤ h<]r¥ h:]r¦ hF]r§ uhKj€ hd]r¨ hrXpatchr© …rª }r« (h4UhKjŸ ubahYhÁubhrX and r¬ …r­ }r® (h4X and r¯ hKj€ ubh³)r° }r± (h4X`patch.object`r² h5}r³ (h7]r´ hD]rµ h<]r¶ h:]r· hF]r¸ uhKj€ hd]r¹ hrX patch.objectrº …r» }r¼ (h4UhKj° ubahYhÁubhrX@ allowing you to pass in a class or callable object (instead of r½ …r¾ }r¿ (h4X@ allowing you to pass in a class or callable object (instead of rÀ hKj€ ubh³)rÁ }r (h4X `MagicMock`rà h5}rÄ (h7]rÅ hD]rÆ h<]rÇ h:]rÈ hF]rÉ uhKj€ hd]rÊ hrX MagicMockrË …rÌ }rÍ (h4UhKjÁ ubahYhÁubhrX9) that will be called to replace the object being patchedrÎ …rÏ }rÐ (h4X9) that will be called to replace the object being patchedrÑ hKj€ ubeubaubhL)rÒ }rÓ (h4XiAddition of :class:`NonCallableMock` and :class:`NonCallableMagicMock`, mocks without a `__call__` methodrÔ hKj‘ hXhBhYh›h5}rÕ (h7]rÖ hD]r× h<]rØ h:]rÙ hF]rÚ uhbNhchhd]rÛ h£)rÜ }rÝ (h4XiAddition of :class:`NonCallableMock` and :class:`NonCallableMagicMock`, mocks without a `__call__` methodrÞ hKjÒ hXhBhYh§h5}rß (h7]rà hD]rá h<]râ h:]rã hF]rä uhbKhd]rå (hrX Addition of ræ …rç }rè (h4X Addition of ré hKjÜ ubjÌ )rê }rë (h4X:class:`NonCallableMock`rì hKjÜ hXhBhYjÐ h5}rí (Ureftyperî Xclassrï jÔ ‰jÕ XNonCallableMockrð U refdomainrñ Xpyrò h:]ró h<]rô U refexplicitrõ ‰h7]rö hD]r÷ hF]rø jß jà já Njâ jã uhbKhd]rù jå )rú }rû (h4jì h5}rü (h7]rý hD]rþ (jë jò Xpy-classrÿ eh<]rh:]rhF]ruhKjê hd]rhrXNonCallableMockr…r}r(h4UhKjú ubahYjô ubaubhrX and r…r}r (h4X and r hKjÜ ubjÌ )r }r (h4X:class:`NonCallableMagicMock`r hKjÜ hXhBhYjÐ h5}r(UreftyperXclassrjÔ ‰jÕ XNonCallableMagicMockrU refdomainrXpyrh:]rh<]rU refexplicitr‰h7]rhD]rhF]rjß jà já Njâ jã uhbKhd]rjå )r}r(h4j h5}r(h7]rhD]r(jë jXpy-classr eh<]r!h:]r"hF]r#uhKj hd]r$hrXNonCallableMagicMockr%…r&}r'(h4UhKjubahYjô ubaubhrX, mocks without a r(…r)}r*(h4X, mocks without a r+hKjÜ ubh³)r,}r-(h4X `__call__`r.h5}r/(h7]r0hD]r1h<]r2h:]r3hF]r4uhKjÜ hd]r5hrX__call__r6…r7}r8(h4UhKj,ubahYhÁubhrX methodr9…r:}r;(h4X methodr<hKjÜ ubeubaubhL)r=}r>(h4XbAddition of :meth:`~Mock.mock_add_spec` method for adding (or changing) a spec on an existing mockr?hKj‘ hXhBhYh›h5}r@(h7]rAhD]rBh<]rCh:]rDhF]rEuhbNhchhd]rFh£)rG}rH(h4XbAddition of :meth:`~Mock.mock_add_spec` method for adding (or changing) a spec on an existing mockrIhKj=hXhBhYh§h5}rJ(h7]rKhD]rLh<]rMh:]rNhF]rOuhbK‘hd]rP(hrX Addition of rQ…rR}rS(h4X Addition of rThKjGubjÌ )rU}rV(h4X:meth:`~Mock.mock_add_spec`rWhKjGhXhBhYjÐ h5}rX(UreftyperYXmethrZjÔ ‰jÕ XMock.mock_add_specr[U refdomainr\Xpyr]h:]r^h<]r_U refexplicitr`‰h7]rahD]rbhF]rcjß jà já Njâ jã uhbK‘hd]rdjå )re}rf(h4jWh5}rg(h7]rhhD]ri(jë j]Xpy-methrjeh<]rkh:]rlhF]rmuhKjUhd]rnhrXmock_add_spec()ro…rp}rq(h4UhKjeubahYjô ubaubhrX; method for adding (or changing) a spec on an existing mockrr…rs}rt(h4X; method for adding (or changing) a spec on an existing mockruhKjGubeubaubhL)rv}rw(h4XÌProtocol methods on :class:`MagicMock` are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a `MagicMock` instead of a `Mock` as it was previouslyrxhKj‘ hXhBhYh›h5}ry(h7]rzhD]r{h<]r|h:]r}hF]r~uhbNhchhd]rh£)r€}r(h4XÌProtocol methods on :class:`MagicMock` are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a `MagicMock` instead of a `Mock` as it was previouslyr‚hKjvhXhBhYh§h5}rƒ(h7]r„hD]r…h<]r†h:]r‡hF]rˆuhbK“hd]r‰(hrXProtocol methods on rŠ…r‹}rŒ(h4XProtocol methods on rhKj€ubjÌ )rŽ}r(h4X:class:`MagicMock`rhKj€hXhBhYjÐ h5}r‘(Ureftyper’Xclassr“jÔ ‰jÕ X MagicMockr”U refdomainr•Xpyr–h:]r—h<]r˜U refexplicitr™‰h7]ršhD]r›hF]rœjß jà já Njâ jã uhbK“hd]rjå )rž}rŸ(h4jh5}r (h7]r¡hD]r¢(jë j–Xpy-classr£eh<]r¤h:]r¥hF]r¦uhKjŽhd]r§hrX MagicMockr¨…r©}rª(h4UhKjžubahYjô ubaubhrXr are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a r«…r¬}r­(h4Xr are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a r®hKj€ubh³)r¯}r°(h4X `MagicMock`r±h5}r²(h7]r³hD]r´h<]rµh:]r¶hF]r·uhKj€hd]r¸hrX MagicMockr¹…rº}r»(h4UhKj¯ubahYhÁubhrX instead of a r¼…r½}r¾(h4X instead of a r¿hKj€ubh³)rÀ}rÁ(h4X`Mock`rÂh5}rÃ(h7]rÄhD]rÅh<]rÆh:]rÇhF]rÈuhKj€hd]rÉhrXMockrÊ…rË}rÌ(h4UhKjÀubahYhÁubhrX as it was previouslyrÍ…rÎ}rÏ(h4X as it was previouslyrÐhKj€ubeubaubhL)rÑ}rÒ(h4X,Addition of :meth:`~Mock.attach_mock` methodrÓhKj‘ hXhBhYh›h5}rÔ(h7]rÕhD]rÖh<]r×h:]rØhF]rÙuhbNhchhd]rÚh£)rÛ}rÜ(h4jÓhKjÑhXhBhYh§h5}rÝ(h7]rÞhD]rßh<]ràh:]ráhF]râuhbK–hd]rã(hrX Addition of rä…rå}ræ(h4X Addition of rçhKjÛubjÌ )rè}ré(h4X:meth:`~Mock.attach_mock`rêhKjÛhXhBhYjÐ h5}rë(UreftyperìXmethríjÔ ‰jÕ XMock.attach_mockrîU refdomainrïXpyrðh:]rñh<]ròU refexplicitró‰h7]rôhD]rõhF]röjß jà já Njâ jã uhbK–hd]r÷jå )rø}rù(h4jêh5}rú(h7]rûhD]rü(jë jðXpy-methrýeh<]rþh:]rÿhF]ruhKjèhd]rhrX attach_mock()r…r}r(h4UhKjøubahYjô ubaubhrX methodr…r}r(h4X methodrhKjÛubeubaubhL)r }r (h4XRAdded :data:`ANY` for ignoring arguments in :meth:`~Mock.assert_called_with` callsr hKj‘ hXhBhYh›h5}r (h7]r hD]rh<]rh:]rhF]ruhbNhchhd]rh£)r}r(h4XRAdded :data:`ANY` for ignoring arguments in :meth:`~Mock.assert_called_with` callsrhKj hXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbK—hd]r(hrXAdded r…r}r(h4XAdded r hKjubjÌ )r!}r"(h4X :data:`ANY`r#hKjhXhBhYjÐ h5}r$(Ureftyper%Xdatar&jÔ ‰jÕ XANYr'U refdomainr(Xpyr)h:]r*h<]r+U refexplicitr,‰h7]r-hD]r.hF]r/jß jà já Njâ jã uhbK—hd]r0jå )r1}r2(h4j#h5}r3(h7]r4hD]r5(jë j)Xpy-datar6eh<]r7h:]r8hF]r9uhKj!hd]r:hrXANYr;…r<}r=(h4UhKj1ubahYjô ubaubhrX for ignoring arguments in r>…r?}r@(h4X for ignoring arguments in rAhKjubjÌ )rB}rC(h4X :meth:`~Mock.assert_called_with`rDhKjhXhBhYjÐ h5}rE(UreftyperFXmethrGjÔ ‰jÕ XMock.assert_called_withrHU refdomainrIXpyrJh:]rKh<]rLU refexplicitrM‰h7]rNhD]rOhF]rPjß jà já Njâ jã uhbK—hd]rQjå )rR}rS(h4jDh5}rT(h7]rUhD]rV(jë jJXpy-methrWeh<]rXh:]rYhF]rZuhKjBhd]r[hrXassert_called_with()r\…r]}r^(h4UhKjRubahYjô ubaubhrX callsr_…r`}ra(h4X callsrbhKjubeubaubhL)rc}rd(h4X&Addition of :data:`call` helper objectrehKj‘ hXhBhYh›h5}rf(h7]rghD]rhh<]rih:]rjhF]rkuhbNhchhd]rlh£)rm}rn(h4jehKjchXhBhYh§h5}ro(h7]rphD]rqh<]rrh:]rshF]rtuhbK™hd]ru(hrX Addition of rv…rw}rx(h4X Addition of ryhKjmubjÌ )rz}r{(h4X :data:`call`r|hKjmhXhBhYjÐ h5}r}(Ureftyper~XdatarjÔ ‰jÕ Xcallr€U refdomainrXpyr‚h:]rƒh<]r„U refexplicitr…‰h7]r†hD]r‡hF]rˆjß jà já Njâ jã uhbK™hd]r‰jå )rŠ}r‹(h4j|h5}rŒ(h7]rhD]rŽ(jë j‚Xpy-datareh<]rh:]r‘hF]r’uhKjzhd]r“hrXcallr”…r•}r–(h4UhKjŠubahYjô ubaubhrX helper objectr—…r˜}r™(h4X helper objectršhKjmubeubaubhL)r›}rœ(h4XImproved repr for mocksrhKj‘ hXhBhYh›h5}rž(h7]rŸhD]r h<]r¡h:]r¢hF]r£uhbNhchhd]r¤h£)r¥}r¦(h4jhKj›hXhBhYh§h5}r§(h7]r¨hD]r©h<]rªh:]r«hF]r¬uhbKšhd]r­hrXImproved repr for mocksr®…r¯}r°(h4jhKj¥ubaubaubhL)r±}r²(h4XŠImproved repr for :attr:`Mock.call_args` and entries in :attr:`Mock.call_args_list`, :attr:`Mock.method_calls` and :attr:`Mock.mock_calls`r³hKj‘ hXhBhYh›h5}r´(h7]rµhD]r¶h<]r·h:]r¸hF]r¹uhbNhchhd]rºh£)r»}r¼(h4XŠImproved repr for :attr:`Mock.call_args` and entries in :attr:`Mock.call_args_list`, :attr:`Mock.method_calls` and :attr:`Mock.mock_calls`r½hKj±hXhBhYh§h5}r¾(h7]r¿hD]rÀh<]rÁh:]rÂhF]rÃuhbK›hd]rÄ(hrXImproved repr for rÅ…rÆ}rÇ(h4XImproved repr for rÈhKj»ubjÌ )rÉ}rÊ(h4X:attr:`Mock.call_args`rËhKj»hXhBhYjÐ h5}rÌ(UreftyperÍXattrrÎjÔ ‰jÕ XMock.call_argsrÏU refdomainrÐXpyrÑh:]rÒh<]rÓU refexplicitrÔ‰h7]rÕhD]rÖhF]r×jß jà já Njâ jã uhbK›hd]rØjå )rÙ}rÚ(h4jËh5}rÛ(h7]rÜhD]rÝ(jë jÑXpy-attrrÞeh<]rßh:]ràhF]ráuhKjÉhd]râhrXMock.call_argsrã…rä}rå(h4UhKjÙubahYjô ubaubhrX and entries in ræ…rç}rè(h4X and entries in réhKj»ubjÌ )rê}rë(h4X:attr:`Mock.call_args_list`rìhKj»hXhBhYjÐ h5}rí(UreftyperîXattrrïjÔ ‰jÕ XMock.call_args_listrðU refdomainrñXpyròh:]róh<]rôU refexplicitrõ‰h7]röhD]r÷hF]røjß jà já Njâ jã uhbK›hd]rùjå )rú}rû(h4jìh5}rü(h7]rýhD]rþ(jë jòXpy-attrrÿeh<]rh:]rhF]ruhKjêhd]rhrXMock.call_args_listr…r}r(h4UhKjúubahYjô ubaubhrX, r…r}r (h4X, r hKj»ubjÌ )r }r (h4X:attr:`Mock.method_calls`r hKj»hXhBhYjÐ h5}r(UreftyperXattrrjÔ ‰jÕ XMock.method_callsrU refdomainrXpyrh:]rh<]rU refexplicitr‰h7]rhD]rhF]rjß jà já Njâ jã uhbK›hd]rjå )r}r(h4j h5}r(h7]rhD]r(jë jXpy-attrr eh<]r!h:]r"hF]r#uhKj hd]r$hrXMock.method_callsr%…r&}r'(h4UhKjubahYjô ubaubhrX and r(…r)}r*(h4X and r+hKj»ubjÌ )r,}r-(h4X:attr:`Mock.mock_calls`r.hKj»hXhBhYjÐ h5}r/(Ureftyper0Xattrr1jÔ ‰jÕ XMock.mock_callsr2U refdomainr3Xpyr4h:]r5h<]r6U refexplicitr7‰h7]r8hD]r9hF]r:jß jà já Njâ jã uhbK›hd]r;jå )r<}r=(h4j.h5}r>(h7]r?hD]r@(jë j4Xpy-attrrAeh<]rBh:]rChF]rDuhKj,hd]rEhrXMock.mock_callsrF…rG}rH(h4UhKj<ubahYjô ubaubeubaubhL)rI}rJ(h4X*Improved repr for :data:`sentinel` objectsrKhKj‘ hXhBhYh›h5}rL(h7]rMhD]rNh<]rOh:]rPhF]rQuhbNhchhd]rRh£)rS}rT(h4jKhKjIhXhBhYh§h5}rU(h7]rVhD]rWh<]rXh:]rYhF]rZuhbKžhd]r[(hrXImproved repr for r\…r]}r^(h4XImproved repr for r_hKjSubjÌ )r`}ra(h4X:data:`sentinel`rbhKjShXhBhYjÐ h5}rc(UreftyperdXdatarejÔ ‰jÕ XsentinelrfU refdomainrgXpyrhh:]rih<]rjU refexplicitrk‰h7]rlhD]rmhF]rnjß jà já Njâ jã uhbKžhd]rojå )rp}rq(h4jbh5}rr(h7]rshD]rt(jë jhXpy-datarueh<]rvh:]rwhF]rxuhKj`hd]ryhrXsentinelrz…r{}r|(h4UhKjpubahYjô ubaubhrX objectsr}…r~}r(h4X objectsr€hKjSubeubaubhL)r}r‚(h4X9`patch` lookup is done at use time not at decoration timerƒhKj‘ hXhBhYh›h5}r„(h7]r…hD]r†h<]r‡h:]rˆhF]r‰uhbNhchhd]rŠh£)r‹}rŒ(h4jƒhKjhXhBhYh§h5}r(h7]rŽhD]rh<]rh:]r‘hF]r’uhbKŸhd]r“(h³)r”}r•(h4X`patch`r–h5}r—(h7]r˜hD]r™h<]ršh:]r›hF]rœuhKj‹hd]rhrXpatchrž…rŸ}r (h4UhKj”ubahYhÁubhrX2 lookup is done at use time not at decoration timer¡…r¢}r£(h4X2 lookup is done at use time not at decoration timer¤hKj‹ubeubaubhL)r¥}r¦(h4XÄIn Python 2.6 or more recent, `dir` on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes.r§hKj‘ hXhBhYh›h5}r¨(h7]r©hD]rªh<]r«h:]r¬hF]r­uhbNhchhd]r®h£)r¯}r°(h4XÄIn Python 2.6 or more recent, `dir` on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes.r±hKj¥hXhBhYh§h5}r²(h7]r³hD]r´h<]rµh:]r¶hF]r·uhbK hd]r¸(hrXIn Python 2.6 or more recent, r¹…rº}r»(h4XIn Python 2.6 or more recent, r¼hKj¯ubh³)r½}r¾(h4X`dir`r¿h5}rÀ(h7]rÁhD]rÂh<]rÃh:]rÄhF]rÅuhKj¯hd]rÆhrXdirrÇ…rÈ}rÉ(h4UhKj½ubahYhÁubhrX¡ on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes.rÊ…rË}rÌ(h4X¡ on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes.rÍhKj¯ubeubaubhL)rÎ}rÏ(h4XsModule level :data:`FILTER_DIR` added to control whether `dir(mock)` filters private attributes. `True` by default.rÐhKj‘ hXhBhYh›h5}rÑ(h7]rÒhD]rÓh<]rÔh:]rÕhF]rÖuhbNhchhd]r×h£)rØ}rÙ(h4XsModule level :data:`FILTER_DIR` added to control whether `dir(mock)` filters private attributes. `True` by default.rÚhKjÎhXhBhYh§h5}rÛ(h7]rÜhD]rÝh<]rÞh:]rßhF]ràuhbK£hd]rá(hrX Module level râ…rã}rä(h4X Module level råhKjØubjÌ )ræ}rç(h4X:data:`FILTER_DIR`rèhKjØhXhBhYjÐ h5}ré(UreftyperêXdatarëjÔ ‰jÕ X FILTER_DIRrìU refdomainríXpyrîh:]rïh<]rðU refexplicitrñ‰h7]ròhD]róhF]rôjß jà já Njâ jã uhbK£hd]rõjå )rö}r÷(h4jèh5}rø(h7]rùhD]rú(jë jîXpy-datarûeh<]rüh:]rýhF]rþuhKjæhd]rÿhrX FILTER_DIRr…r}r(h4UhKjöubahYjô ubaubhrX added to control whether r…r}r(h4X added to control whether rhKjØubh³)r}r(h4X `dir(mock)`r h5}r (h7]r hD]r h<]r h:]rhF]ruhKjØhd]rhrX dir(mock)r…r}r(h4UhKjubahYhÁubhrX filters private attributes. r…r}r(h4X filters private attributes. rhKjØubh³)r}r(h4X`True`rh5}r(h7]rhD]rh<]rh:]rhF]r uhKjØhd]r!hrXTruer"…r#}r$(h4UhKjubahYhÁubhrX by default.r%…r&}r'(h4X by default.r(hKjØubeubaubhL)r)}r*(h4Xe`patch.TEST_PREFIX` for controlling how patchers recognise test methods when used to decorate a classr+hKj‘ hXhBhYh›h5}r,(h7]r-hD]r.h<]r/h:]r0hF]r1uhbNhchhd]r2h£)r3}r4(h4Xe`patch.TEST_PREFIX` for controlling how patchers recognise test methods when used to decorate a classr5hKj)hXhBhYh§h5}r6(h7]r7hD]r8h<]r9h:]r:hF]r;uhbK¥hd]r<(h³)r=}r>(h4X`patch.TEST_PREFIX`r?h5}r@(h7]rAhD]rBh<]rCh:]rDhF]rEuhKj3hd]rFhrXpatch.TEST_PREFIXrG…rH}rI(h4UhKj=ubahYhÁubhrXR for controlling how patchers recognise test methods when used to decorate a classrJ…rK}rL(h4XR for controlling how patchers recognise test methods when used to decorate a classrMhKj3ubeubaubhL)rN}rO(h4XJSupport for using Java exceptions as a :attr:`~Mock.side_effect` on JythonrPhKj‘ hXhBhYh›h5}rQ(h7]rRhD]rSh<]rTh:]rUhF]rVuhbNhchhd]rWh£)rX}rY(h4jPhKjNhXhBhYh§h5}rZ(h7]r[hD]r\h<]r]h:]r^hF]r_uhbK§hd]r`(hrX'Support for using Java exceptions as a ra…rb}rc(h4X'Support for using Java exceptions as a rdhKjXubjÌ )re}rf(h4X:attr:`~Mock.side_effect`rghKjXhXhBhYjÐ h5}rh(UreftyperiXattrrjjÔ ‰jÕ XMock.side_effectrkU refdomainrlXpyrmh:]rnh<]roU refexplicitrp‰h7]rqhD]rrhF]rsjß jà já Njâ jã uhbK§hd]rtjå )ru}rv(h4jgh5}rw(h7]rxhD]ry(jë jmXpy-attrrzeh<]r{h:]r|hF]r}uhKjehd]r~hrX side_effectr…r€}r(h4UhKjuubahYjô ubaubhrX on Jythonr‚…rƒ}r„(h4X on Jythonr…hKjXubeubaubhL)r†}r‡(h4XÈ`Mock` call lists (`call_args_list`, `method_calls` & `mock_calls`) are now custom list objects that allow membership tests for "sub lists" and have a nicer representation if you `str` or `print` themrˆhKj‘ hXhBhYh›h5}r‰(h7]rŠhD]r‹h<]rŒh:]rhF]rŽuhbNhchhd]rh£)r}r‘(h4XÈ`Mock` call lists (`call_args_list`, `method_calls` & `mock_calls`) are now custom list objects that allow membership tests for "sub lists" and have a nicer representation if you `str` or `print` themr’hKj†hXhBhYh§h5}r“(h7]r”hD]r•h<]r–h:]r—hF]r˜uhbK¨hd]r™(h³)rš}r›(h4X`Mock`rœh5}r(h7]ržhD]rŸh<]r h:]r¡hF]r¢uhKjhd]r£hrXMockr¤…r¥}r¦(h4UhKjšubahYhÁubhrX call lists (r§…r¨}r©(h4X call lists (rªhKjubh³)r«}r¬(h4X`call_args_list`r­h5}r®(h7]r¯hD]r°h<]r±h:]r²hF]r³uhKjhd]r´hrXcall_args_listrµ…r¶}r·(h4UhKj«ubahYhÁubhrX, r¸…r¹}rº(h4X, r»hKjubh³)r¼}r½(h4X`method_calls`r¾h5}r¿(h7]rÀhD]rÁh<]rÂh:]rÃhF]rÄuhKjhd]rÅhrX method_callsrÆ…rÇ}rÈ(h4UhKj¼ubahYhÁubhrX & rÉ…rÊ}rË(h4X & rÌhKjubh³)rÍ}rÎ(h4X `mock_calls`rÏh5}rÐ(h7]rÑhD]rÒh<]rÓh:]rÔhF]rÕuhKjhd]rÖhrX mock_callsr×…rØ}rÙ(h4UhKjÍubahYhÁubhrXq) are now custom list objects that allow membership tests for "sub lists" and have a nicer representation if you rÚ…rÛ}rÜ(h4Xq) are now custom list objects that allow membership tests for "sub lists" and have a nicer representation if you rÝhKjubh³)rÞ}rß(h4X`str`ràh5}rá(h7]râhD]rãh<]räh:]råhF]ræuhKjhd]rçhrXstrrè…ré}rê(h4UhKjÞubahYhÁubhrX or rë…rì}rí(h4X or rîhKjubh³)rï}rð(h4X`print`rñh5}rò(h7]róhD]rôh<]rõh:]röhF]r÷uhKjhd]røhrXprintrù…rú}rû(h4UhKjïubahYhÁubhrX themrü…rý}rþ(h4X themrÿhKjubeubaubhL)r}r(h4X­Mocks attached as attributes or return values to other mocks have calls recorded in `method_calls` and `mock_calls` of the parent (unless a name is already set on the child)rhKj‘ hXhBhYh›h5}r(h7]rhD]rh<]rh:]rhF]ruhbNhchhd]r h£)r }r (h4X­Mocks attached as attributes or return values to other mocks have calls recorded in `method_calls` and `mock_calls` of the parent (unless a name is already set on the child)r hKjhXhBhYh§h5}r (h7]rhD]rh<]rh:]rhF]ruhbK«hd]r(hrXTMocks attached as attributes or return values to other mocks have calls recorded in r…r}r(h4XTMocks attached as attributes or return values to other mocks have calls recorded in rhKj ubh³)r}r(h4X`method_calls`rh5}r(h7]rhD]rh<]rh:]rhF]r uhKj hd]r!hrX method_callsr"…r#}r$(h4UhKjubahYhÁubhrX and r%…r&}r'(h4X and r(hKj ubh³)r)}r*(h4X `mock_calls`r+h5}r,(h7]r-hD]r.h<]r/h:]r0hF]r1uhKj hd]r2hrX mock_callsr3…r4}r5(h4UhKj)ubahYhÁubhrX: of the parent (unless a name is already set on the child)r6…r7}r8(h4X: of the parent (unless a name is already set on the child)r9hKj ubeubaubhL)r:}r;(h4XPImproved failure messages for `assert_called_with` and `assert_called_once_with`r<hKj‘ hXhBhYh›h5}r=(h7]r>hD]r?h<]r@h:]rAhF]rBuhbNhchhd]rCh£)rD}rE(h4XPImproved failure messages for `assert_called_with` and `assert_called_once_with`rFhKj:hXhBhYh§h5}rG(h7]rHhD]rIh<]rJh:]rKhF]rLuhbK®hd]rM(hrXImproved failure messages for rN…rO}rP(h4XImproved failure messages for rQhKjDubh³)rR}rS(h4X`assert_called_with`rTh5}rU(h7]rVhD]rWh<]rXh:]rYhF]rZuhKjDhd]r[hrXassert_called_withr\…r]}r^(h4UhKjRubahYhÁubhrX and r_…r`}ra(h4X and rbhKjDubh³)rc}rd(h4X`assert_called_once_with`reh5}rf(h7]rghD]rhh<]rih:]rjhF]rkuhKjDhd]rlhrXassert_called_once_withrm…rn}ro(h4UhKjcubahYhÁubeubaubhL)rp}rq(h4X|The return value of the :class:`MagicMock` `__iter__` method can be set to any iterable and isn't required to be an iteratorrrhKj‘ hXhBhYh›h5}rs(h7]rthD]ruh<]rvh:]rwhF]rxuhbNhchhd]ryh£)rz}r{(h4X|The return value of the :class:`MagicMock` `__iter__` method can be set to any iterable and isn't required to be an iteratorr|hKjphXhBhYh§h5}r}(h7]r~hD]rh<]r€h:]rhF]r‚uhbK°hd]rƒ(hrXThe return value of the r„…r…}r†(h4XThe return value of the r‡hKjzubjÌ )rˆ}r‰(h4X:class:`MagicMock`rŠhKjzhXhBhYjÐ h5}r‹(UreftyperŒXclassrjÔ ‰jÕ X MagicMockrŽU refdomainrXpyrh:]r‘h<]r’U refexplicitr“‰h7]r”hD]r•hF]r–jß jà já Njâ jã uhbK°hd]r—jå )r˜}r™(h4jŠh5}rš(h7]r›hD]rœ(jë jXpy-classreh<]ržh:]rŸhF]r uhKjˆhd]r¡hrX MagicMockr¢…r£}r¤(h4UhKj˜ubahYjô ubaubhrX …r¥}r¦(h4X hKjzubh³)r§}r¨(h4X `__iter__`r©h5}rª(h7]r«hD]r¬h<]r­h:]r®hF]r¯uhKjzhd]r°hrX__iter__r±…r²}r³(h4UhKj§ubahYhÁubhrXG method can be set to any iterable and isn't required to be an iteratorr´…rµ}r¶(h4XG method can be set to any iterable and isn't required to be an iteratorr·hKjzubeubaubhL)r¸}r¹(h4X[Added the Mock API (`assert_called_with` etc) to functions created by :func:`mocksignature`rºhKj‘ hXhBhYh›h5}r»(h7]r¼hD]r½h<]r¾h:]r¿hF]rÀuhbNhchhd]rÁh£)rÂ}rÃ(h4X[Added the Mock API (`assert_called_with` etc) to functions created by :func:`mocksignature`rÄhKj¸hXhBhYh§h5}rÅ(h7]rÆhD]rÇh<]rÈh:]rÉhF]rÊuhbK²hd]rË(hrXAdded the Mock API (rÌ…rÍ}rÎ(h4XAdded the Mock API (rÏhKjÂubh³)rÐ}rÑ(h4X`assert_called_with`rÒh5}rÓ(h7]rÔhD]rÕh<]rÖh:]r×hF]rØuhKjÂhd]rÙhrXassert_called_withrÚ…rÛ}rÜ(h4UhKjÐubahYhÁubhrX etc) to functions created by rÝ…rÞ}rß(h4X etc) to functions created by ràhKjÂubjÌ )rá}râ(h4X:func:`mocksignature`rãhKjÂhXhBhYjÐ h5}rä(UreftyperåXfuncræjÔ ‰jÕ X mocksignaturerçU refdomainrèXpyréh:]rêh<]rëU refexplicitrì‰h7]ríhD]rîhF]rïjß jà já Njâ jã uhbK²hd]rðjå )rñ}rò(h4jãh5}ró(h7]rôhD]rõ(jë jéXpy-funcröeh<]r÷h:]røhF]rùuhKjáhd]rúhrXmocksignature()rû…rü}rý(h4UhKjñubahYjô ubaubeubaubhL)rþ}rÿ(h4X`Tuples as well as lists can be used to specify allowed methods for `spec` & `spec_set` argumentsrhKj‘ hXhBhYh›h5}r(h7]rhD]rh<]rh:]rhF]ruhbNhchhd]rh£)r}r (h4X`Tuples as well as lists can be used to specify allowed methods for `spec` & `spec_set` argumentsr hKjþhXhBhYh§h5}r (h7]r hD]r h<]rh:]rhF]ruhbK´hd]r(hrXCTuples as well as lists can be used to specify allowed methods for r…r}r(h4XCTuples as well as lists can be used to specify allowed methods for rhKjubh³)r}r(h4X`spec`rh5}r(h7]rhD]rh<]rh:]rhF]ruhKjhd]rhrXspecr …r!}r"(h4UhKjubahYhÁubhrX & r#…r$}r%(h4X & r&hKjubh³)r'}r((h4X `spec_set`r)h5}r*(h7]r+hD]r,h<]r-h:]r.hF]r/uhKjhd]r0hrXspec_setr1…r2}r3(h4UhKj'ubahYhÁubhrX argumentsr4…r5}r6(h4X argumentsr7hKjubeubaubhL)r8}r9(h4XRCalling `stop` on an unstarted patcher fails with a more meaningful error messager:hKj‘ hXhBhYh›h5}r;(h7]r<hD]r=h<]r>h:]r?hF]r@uhbNhchhd]rAh£)rB}rC(h4XRCalling `stop` on an unstarted patcher fails with a more meaningful error messagerDhKj8hXhBhYh§h5}rE(h7]rFhD]rGh<]rHh:]rIhF]rJuhbK¶hd]rK(hrXCalling rL…rM}rN(h4XCalling rOhKjBubh³)rP}rQ(h4X`stop`rRh5}rS(h7]rThD]rUh<]rVh:]rWhF]rXuhKjBhd]rYhrXstoprZ…r[}r\(h4UhKjPubahYhÁubhrXD on an unstarted patcher fails with a more meaningful error messager]…r^}r_(h4XD on an unstarted patcher fails with a more meaningful error messager`hKjBubeubaubhL)ra}rb(h4XMRenamed the internal classes `Sentinel` and `SentinelObject` to prevent abuserchKj‘ hXhBhYh›h5}rd(h7]rehD]rfh<]rgh:]rhhF]riuhbNhchhd]rjh£)rk}rl(h4jchKjahXhBhYh§h5}rm(h7]rnhD]roh<]rph:]rqhF]rruhbK¸hd]rs(hrXRenamed the internal classes rt…ru}rv(h4XRenamed the internal classes rwhKjkubh³)rx}ry(h4X `Sentinel`rzh5}r{(h7]r|hD]r}h<]r~h:]rhF]r€uhKjkhd]rhrXSentinelr‚…rƒ}r„(h4UhKjxubahYhÁubhrX and r……r†}r‡(h4X and rˆhKjkubh³)r‰}rŠ(h4X`SentinelObject`r‹h5}rŒ(h7]rhD]rŽh<]rh:]rhF]r‘uhKjkhd]r’hrXSentinelObjectr“…r”}r•(h4UhKj‰ubahYhÁubhrX to prevent abuser–…r—}r˜(h4X to prevent abuser™hKjkubeubaubhL)rš}r›(h4X]BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in placerœhKj‘ hXhBhYh›h5}r(h7]ržhD]rŸh<]r h:]r¡hF]r¢uhbNhchhd]r£h£)r¤}r¥(h4X]BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in placer¦hKjšhXhBhYh§h5}r§(h7]r¨hD]r©h<]rªh:]r«hF]r¬uhbK¹hd]r­hrX]BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in placer®…r¯}r°(h4j¦hKj¤ubaubaubhL)r±}r²(h4X\BUGFIX: `__truediv__` and `__rtruediv__` not available as magic methods on mocks in Python 3r³hKj‘ hXhBhYh›h5}r´(h7]rµhD]r¶h<]r·h:]r¸hF]r¹uhbNhchhd]rºh£)r»}r¼(h4X\BUGFIX: `__truediv__` and `__rtruediv__` not available as magic methods on mocks in Python 3r½hKj±hXhBhYh§h5}r¾(h7]r¿hD]rÀh<]rÁh:]rÂhF]rÃuhbK»hd]rÄ(hrXBUGFIX: rÅ…rÆ}rÇ(h4XBUGFIX: rÈhKj»ubh³)rÉ}rÊ(h4X `__truediv__`rËh5}rÌ(h7]rÍhD]rÎh<]rÏh:]rÐhF]rÑuhKj»hd]rÒhrX __truediv__rÓ…rÔ}rÕ(h4UhKjÉubahYhÁubhrX and rÖ…r×}rØ(h4X and rÙhKj»ubh³)rÚ}rÛ(h4X`__rtruediv__`rÜh5}rÝ(h7]rÞhD]rßh<]ràh:]ráhF]râuhKj»hd]rãhrX __rtruediv__rä…rå}ræ(h4UhKjÚubahYhÁubhrX4 not available as magic methods on mocks in Python 3rç…rè}ré(h4X4 not available as magic methods on mocks in Python 3rêhKj»ubeubaubhL)rë}rì(h4XfBUGFIX: `assert_called_with` / `assert_called_once_with` can be used with `self` as a keyword argumentríhKj‘ hXhBhYh›h5}rî(h7]rïhD]rðh<]rñh:]ròhF]róuhbNhchhd]rôh£)rõ}rö(h4XfBUGFIX: `assert_called_with` / `assert_called_once_with` can be used with `self` as a keyword argumentr÷hKjëhXhBhYh§h5}rø(h7]rùhD]rúh<]rûh:]rühF]rýuhbK½hd]rþ(hrXBUGFIX: rÿ…r}r(h4XBUGFIX: rhKjõubh³)r}r(h4X`assert_called_with`rh5}r(h7]rhD]rh<]r h:]r hF]r uhKjõhd]r hrXassert_called_withr …r}r(h4UhKjubahYhÁubhrX / r…r}r(h4X / rhKjõubh³)r}r(h4X`assert_called_once_with`rh5}r(h7]rhD]rh<]rh:]rhF]ruhKjõhd]rhrXassert_called_once_withr…r}r (h4UhKjubahYhÁubhrX can be used with r!…r"}r#(h4X can be used with r$hKjõubh³)r%}r&(h4X`self`r'h5}r((h7]r)hD]r*h<]r+h:]r,hF]r-uhKjõhd]r.hrXselfr/…r0}r1(h4UhKj%ubahYhÁubhrX as a keyword argumentr2…r3}r4(h4X as a keyword argumentr5hKjõubeubaubhL)r6}r7(h4X¥BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance")r8hKj‘ hXhBhYh›h5}r9(h7]r:hD]r;h<]r<h:]r=hF]r>uhbNhchhd]r?h£)r@}rA(h4X¥BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance")rBhKj6hXhBhYh§h5}rC(h7]rDhD]rEh<]rFh:]rGhF]rHuhbK¿hd]rIhrX¥BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance")rJ…rK}rL(h4jBhKj@ubaubaubhL)rM}rN(h4XCBUGFIX: remove the `__unittest` marker causing traceback truncationrOhKj‘ hXhBhYh›h5}rP(h7]rQhD]rRh<]rSh:]rThF]rUuhbNhchhd]rVh£)rW}rX(h4jOhKjMhXhBhYh§h5}rY(h7]rZhD]r[h<]r\h:]r]hF]r^uhbKÂhd]r_(hrXBUGFIX: remove the r`…ra}rb(h4XBUGFIX: remove the rchKjWubh³)rd}re(h4X `__unittest`rfh5}rg(h7]rhhD]rih<]rjh:]rkhF]rluhKjWhd]rmhrX __unittestrn…ro}rp(h4UhKjdubahYhÁubhrX$ marker causing traceback truncationrq…rr}rs(h4X$ marker causing traceback truncationrthKjWubeubaubhL)ru}rv(h4X$Removal of deprecated `patch_object`rwhKj‘ hXhBhYh›h5}rx(h7]ryhD]rzh<]r{h:]r|hF]r}uhbNhchhd]r~h£)r}r€(h4jwhKjuhXhBhYh§h5}r(h7]r‚hD]rƒh<]r„h:]r…hF]r†uhbKÃhd]r‡(hrXRemoval of deprecated rˆ…r‰}rŠ(h4XRemoval of deprecated r‹hKjubh³)rŒ}r(h4X`patch_object`rŽh5}r(h7]rhD]r‘h<]r’h:]r“hF]r”uhKjhd]r•hrX patch_objectr–…r—}r˜(h4UhKjŒubahYhÁubeubaubhL)r™}rš(h4XPrivate attributes `_name`, `_methods`, '_children', `_wraps` and `_parent` (etc) renamed to reduce likelihood of clash with user attributes.r›hKj‘ hXhBhYh›h5}rœ(h7]rhD]ržh<]rŸh:]r hF]r¡uhbNhchhd]r¢h£)r£}r¤(h4XPrivate attributes `_name`, `_methods`, '_children', `_wraps` and `_parent` (etc) renamed to reduce likelihood of clash with user attributes.r¥hKj™hXhBhYh§h5}r¦(h7]r§hD]r¨h<]r©h:]rªhF]r«uhbKÄhd]r¬(hrXPrivate attributes r­…r®}r¯(h4XPrivate attributes r°hKj£ubh³)r±}r²(h4X`_name`r³h5}r´(h7]rµhD]r¶h<]r·h:]r¸hF]r¹uhKj£hd]rºhrX_namer»…r¼}r½(h4UhKj±ubahYhÁubhrX, r¾…r¿}rÀ(h4X, rÁhKj£ubh³)rÂ}rÃ(h4X `_methods`rÄh5}rÅ(h7]rÆhD]rÇh<]rÈh:]rÉhF]rÊuhKj£hd]rËhrX_methodsrÌ…rÍ}rÎ(h4UhKjÂubahYhÁubhrX, '_children', rÏ…rÐ}rÑ(h4X, '_children', rÒhKj£ubh³)rÓ}rÔ(h4X`_wraps`rÕh5}rÖ(h7]r×hD]rØh<]rÙh:]rÚhF]rÛuhKj£hd]rÜhrX_wrapsrÝ…rÞ}rß(h4UhKjÓubahYhÁubhrX and rà…rá}râ(h4X and rãhKj£ubh³)rä}rå(h4X `_parent`ræh5}rç(h7]rèhD]réh<]rêh:]rëhF]rìuhKj£hd]ríhrX_parentrî…rï}rð(h4UhKjäubahYhÁubhrXB (etc) renamed to reduce likelihood of clash with user attributes.rñ…rò}ró(h4XB (etc) renamed to reduce likelihood of clash with user attributes.rôhKj£ubeubaubhL)rõ}rö(h4X(Added license file to the distribution r÷hKj‘ hXhBhYh›h5}rø(h7]rùhD]rúh<]rûh:]rühF]rýuhbNhchhd]rþh£)rÿ}r(h4X&Added license file to the distributionrhKjõhXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbKÆhd]rhrX&Added license file to the distributionr …r }r (h4jhKjÿubaubaubeubeubhS)r }r (h4UhKhVhXhBhYhZh5}r(h7]rhD]rh<]rh:]rU!version-0-8-0-release-candidate-2rahF]rhauhbKÊhchhd]r(hf)r}r(h4X,2012/01/10 Version 0.8.0 release candidate 2rhKj hXhBhYhjh5}r(h7]rhD]rh<]rh:]rhF]ruhbKÊhchhd]rhrX,2012/01/10 Version 0.8.0 release candidate 2r …r!}r"(h4jhKjubaubhP)r#}r$(h4UhKj hXhBhYhh5}r%(h‘X*h:]r&h<]r'h7]r(hD]r)hF]r*uhbKÌhchhd]r+(hL)r,}r-(h4XˆRemoved the `configure` keyword argument to `create_autospec` and allow arbitrary keyword arguments (for the `Mock` constructor) insteadr.hKj#hXhBhYh›h5}r/(h7]r0hD]r1h<]r2h:]r3hF]r4uhbNhchhd]r5h£)r6}r7(h4XˆRemoved the `configure` keyword argument to `create_autospec` and allow arbitrary keyword arguments (for the `Mock` constructor) insteadr8hKj,hXhBhYh§h5}r9(h7]r:hD]r;h<]r<h:]r=hF]r>uhbKÌhd]r?(hrX Removed the r@…rA}rB(h4X Removed the rChKj6ubh³)rD}rE(h4X `configure`rFh5}rG(h7]rHhD]rIh<]rJh:]rKhF]rLuhKj6hd]rMhrX configurerN…rO}rP(h4UhKjDubahYhÁubhrX keyword argument to rQ…rR}rS(h4X keyword argument to rThKj6ubh³)rU}rV(h4X`create_autospec`rWh5}rX(h7]rYhD]rZh<]r[h:]r\hF]r]uhKj6hd]r^hrXcreate_autospecr_…r`}ra(h4UhKjUubahYhÁubhrX0 and allow arbitrary keyword arguments (for the rb…rc}rd(h4X0 and allow arbitrary keyword arguments (for the rehKj6ubh³)rf}rg(h4X`Mock`rhh5}ri(h7]rjhD]rkh<]rlh:]rmhF]rnuhKj6hd]rohrXMockrp…rq}rr(h4UhKjfubahYhÁubhrX constructor) insteadrs…rt}ru(h4X constructor) insteadrvhKj6ubeubaubhL)rw}rx(h4XBFixed `ANY` equality with some types in `assert_called_with` callsryhKj#hXhBhYh›h5}rz(h7]r{hD]r|h<]r}h:]r~hF]ruhbNhchhd]r€h£)r}r‚(h4jyhKjwhXhBhYh§h5}rƒ(h7]r„hD]r…h<]r†h:]r‡hF]rˆuhbKÎhd]r‰(hrXFixed rŠ…r‹}rŒ(h4XFixed rhKjubh³)rŽ}r(h4X`ANY`rh5}r‘(h7]r’hD]r“h<]r”h:]r•hF]r–uhKjhd]r—hrXANYr˜…r™}rš(h4UhKjŽubahYhÁubhrX equality with some types in r›…rœ}r(h4X equality with some types in ržhKjubh³)rŸ}r (h4X`assert_called_with`r¡h5}r¢(h7]r£hD]r¤h<]r¥h:]r¦hF]r§uhKjhd]r¨hrXassert_called_withr©…rª}r«(h4UhKjŸubahYhÁubhrX callsr¬…r­}r®(h4X callsr¯hKjubeubaubhL)r°}r±(h4XhSwitched to a standard Sphinx theme (compatible with `readthedocs.org `_) r²hKj#hXhBhYh›h5}r³(h7]r´hD]rµh<]r¶h:]r·hF]r¸uhbNhchhd]r¹h£)rº}r»(h4XfSwitched to a standard Sphinx theme (compatible with `readthedocs.org `_)r¼hKj°hXhBhYh§h5}r½(h7]r¾hD]r¿h<]rÀh:]rÁhF]rÂuhbKÏhd]rÃ(hrX5Switched to a standard Sphinx theme (compatible with rÄ…rÅ}rÆ(h4X5Switched to a standard Sphinx theme (compatible with rÇhKjºubj=)rÈ}rÉ(h4X0`readthedocs.org `_rÊh5}rË(UnamerÌXreadthedocs.orgrÍjDXhttp://mock.readthedocs.orgrÎh:]rÏh<]rÐh7]rÑhD]rÒhF]rÓuhKjºhd]rÔhrXreadthedocs.orgrÕ…rÖ}r×(h4UhKjÈubahYjOubjP)rØ}rÙ(h4X rÚjTKhKjºhYjUh5}rÛ(UrefurirÜjÎh:]rÝUreadthedocs-orgrÞah<]rßh7]ràhD]ráhF]râhauhd]rãubhrX)…rä}rå(h4X)hKjºubeubaubeubeubhS)ræ}rç(h4UhKhVhXhBhYhZh5}rè(h7]réhD]rêh<]rëh:]rìU!version-0-8-0-release-candidate-1ríahF]rîh$auhbKÔhchhd]rï(hf)rð}rñ(h4X,2011/12/29 Version 0.8.0 release candidate 1ròhKjæhXhBhYhjh5}ró(h7]rôhD]rõh<]röh:]r÷hF]røuhbKÔhchhd]rùhrX,2011/12/29 Version 0.8.0 release candidate 1rú…rû}rü(h4jòhKjðubaubhP)rý}rþ(h4UhKjæhXhBhYhh5}rÿ(h‘X*h:]rh<]rh7]rhD]rhF]ruhbKÖhchhd]r(hL)r}r(h4Xt`create_autospec` on the return value of a mocked class will use `__call__` for the signature rather than `__init__`rhKjýhXhBhYh›h5}r (h7]r hD]r h<]r h:]r hF]ruhbNhchhd]rh£)r}r(h4Xt`create_autospec` on the return value of a mocked class will use `__call__` for the signature rather than `__init__`rhKjhXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbKÖhd]r(h³)r}r(h4X`create_autospec`rh5}r(h7]rhD]rh<]r h:]r!hF]r"uhKjhd]r#hrXcreate_autospecr$…r%}r&(h4UhKjubahYhÁubhrX0 on the return value of a mocked class will use r'…r(}r)(h4X0 on the return value of a mocked class will use r*hKjubh³)r+}r,(h4X `__call__`r-h5}r.(h7]r/hD]r0h<]r1h:]r2hF]r3uhKjhd]r4hrX__call__r5…r6}r7(h4UhKj+ubahYhÁubhrX for the signature rather than r8…r9}r:(h4X for the signature rather than r;hKjubh³)r<}r=(h4X `__init__`r>h5}r?(h7]r@hD]rAh<]rBh:]rChF]rDuhKjhd]rEhrX__init__rF…rG}rH(h4UhKj<ubahYhÁubeubaubhL)rI}rJ(h4X<Performance improvement instantiating `Mock` and `MagicMock`rKhKjýhXhBhYh›h5}rL(h7]rMhD]rNh<]rOh:]rPhF]rQuhbNhchhd]rRh£)rS}rT(h4jKhKjIhXhBhYh§h5}rU(h7]rVhD]rWh<]rXh:]rYhF]rZuhbKØhd]r[(hrX&Performance improvement instantiating r\…r]}r^(h4X&Performance improvement instantiating r_hKjSubh³)r`}ra(h4X`Mock`rbh5}rc(h7]rdhD]reh<]rfh:]rghF]rhuhKjShd]rihrXMockrj…rk}rl(h4UhKj`ubahYhÁubhrX and rm…rn}ro(h4X and rphKjSubh³)rq}rr(h4X `MagicMock`rsh5}rt(h7]ruhD]rvh<]rwh:]rxhF]ryuhKjShd]rzhrX MagicMockr{…r|}r}(h4UhKjqubahYhÁubeubaubhL)r~}r(h4XiMocks used as magic methods have the same type as their parent instead of being hardcoded to `MagicMock` r€hKjýhXhBhYh›h5}r(h7]r‚hD]rƒh<]r„h:]r…hF]r†uhbNhchhd]r‡h£)rˆ}r‰(h4XhMocks used as magic methods have the same type as their parent instead of being hardcoded to `MagicMock`rŠhKj~hXhBhYh§h5}r‹(h7]rŒhD]rh<]rŽh:]rhF]ruhbKÙhd]r‘(hrX]Mocks used as magic methods have the same type as their parent instead of being hardcoded to r’…r“}r”(h4X]Mocks used as magic methods have the same type as their parent instead of being hardcoded to r•hKjˆubh³)r–}r—(h4X `MagicMock`r˜h5}r™(h7]ršhD]r›h<]rœh:]rhF]ržuhKjˆhd]rŸhrX MagicMockr …r¡}r¢(h4UhKj–ubahYhÁubeubaubeubh£)r£}r¤(h4XgSpecial thanks to Julian Berman for his help with diagnosing and improving performance in this release.r¥hKjæhXhBhYh§h5}r¦(h7]r§hD]r¨h<]r©h:]rªhF]r«uhbKÜhchhd]r¬hrXgSpecial thanks to Julian Berman for his help with diagnosing and improving performance in this release.r­…r®}r¯(h4j¥hKj£ubaubeubhS)r°}r±(h4UhKhVhXhBhYhZh5}r²(h7]r³hD]r´h<]rµh:]r¶Uversion-0-8-0-beta-4r·ahF]r¸hauhbKáhchhd]r¹(hf)rº}r»(h4X2011/10/09 Version 0.8.0 beta 4r¼hKj°hXhBhYhjh5}r½(h7]r¾hD]r¿h<]rÀh:]rÁhF]rÂuhbKáhchhd]rÃhrX2011/10/09 Version 0.8.0 beta 4rÄ…rÅ}rÆ(h4j¼hKjºubaubhP)rÇ}rÈ(h4UhKj°hXhBhYhh5}rÉ(h‘X*h:]rÊh<]rËh7]rÌhD]rÍhF]rÎuhbKãhchhd]rÏ(hL)rÐ}rÑ(h4X9`patch` lookup is done at use time not at decoration timerÒhKjÇhXhBhYh›h5}rÓ(h7]rÔhD]rÕh<]rÖh:]r×hF]rØuhbNhchhd]rÙh£)rÚ}rÛ(h4jÒhKjÐhXhBhYh§h5}rÜ(h7]rÝhD]rÞh<]rßh:]ràhF]ráuhbKãhd]râ(h³)rã}rä(h4X`patch`råh5}ræ(h7]rçhD]rèh<]réh:]rêhF]rëuhKjÚhd]rìhrXpatchrí…rî}rï(h4UhKjãubahYhÁubhrX2 lookup is done at use time not at decoration timerð…rñ}rò(h4X2 lookup is done at use time not at decoration timeróhKjÚubeubaubhL)rô}rõ(h4XYWhen attaching a Mock to another Mock as a magic method, calls are recorded in mock_callsröhKjÇhXhBhYh›h5}r÷(h7]røhD]rùh<]rúh:]rûhF]rüuhbNhchhd]rýh£)rþ}rÿ(h4XYWhen attaching a Mock to another Mock as a magic method, calls are recorded in mock_callsrhKjôhXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbKähd]rhrXYWhen attaching a Mock to another Mock as a magic method, calls are recorded in mock_callsr…r }r (h4jhKjþubaubaubhL)r }r (h4X Addition of `attach_mock` methodr hKjÇhXhBhYh›h5}r(h7]rhD]rh<]rh:]rhF]ruhbNhchhd]rh£)r}r(h4j hKj hXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbKæhd]r(hrX Addition of r…r}r (h4X Addition of r!hKjubh³)r"}r#(h4X `attach_mock`r$h5}r%(h7]r&hD]r'h<]r(h:]r)hF]r*uhKjhd]r+hrX attach_mockr,…r-}r.(h4UhKj"ubahYhÁubhrX methodr/…r0}r1(h4X methodr2hKjubeubaubhL)r3}r4(h4XMRenamed the internal classes `Sentinel` and `SentinelObject` to prevent abuser5hKjÇhXhBhYh›h5}r6(h7]r7hD]r8h<]r9h:]r:hF]r;uhbNhchhd]r<h£)r=}r>(h4j5hKj3hXhBhYh§h5}r?(h7]r@hD]rAh<]rBh:]rChF]rDuhbKçhd]rE(hrXRenamed the internal classes rF…rG}rH(h4XRenamed the internal classes rIhKj=ubh³)rJ}rK(h4X `Sentinel`rLh5}rM(h7]rNhD]rOh<]rPh:]rQhF]rRuhKj=hd]rShrXSentinelrT…rU}rV(h4UhKjJubahYhÁubhrX and rW…rX}rY(h4X and rZhKj=ubh³)r[}r\(h4X`SentinelObject`r]h5}r^(h7]r_hD]r`h<]rah:]rbhF]rcuhKj=hd]rdhrXSentinelObjectre…rf}rg(h4UhKj[ubahYhÁubhrX to prevent abuserh…ri}rj(h4X to prevent abuserkhKj=ubeubaubhL)rl}rm(h4XmBUGFIX: various issues around circular references with mocks (setting a mock return value to be itself etc) rnhKjÇhXhBhYh›h5}ro(h7]rphD]rqh<]rrh:]rshF]rtuhbNhchhd]ruh£)rv}rw(h4XkBUGFIX: various issues around circular references with mocks (setting a mock return value to be itself etc)rxhKjlhXhBhYh§h5}ry(h7]rzhD]r{h<]r|h:]r}hF]r~uhbKèhd]rhrXkBUGFIX: various issues around circular references with mocks (setting a mock return value to be itself etc)r€…r}r‚(h4jxhKjvubaubaubeubeubhS)rƒ}r„(h4UhKhVhXhBhYhZh5}r…(h7]r†hD]r‡h<]rˆh:]r‰Uversion-0-8-0-beta-3rŠahF]r‹h)auhbKíhchhd]rŒ(hf)r}rŽ(h4X2011/08/15 Version 0.8.0 beta 3rhKjƒhXhBhYhjh5}r(h7]r‘hD]r’h<]r“h:]r”hF]r•uhbKíhchhd]r–hrX2011/08/15 Version 0.8.0 beta 3r—…r˜}r™(h4jhKjubaubhP)rš}r›(h4UhKjƒhXhBhYhh5}rœ(h‘X*h:]rh<]ržh7]rŸhD]r hF]r¡uhbKïhchhd]r¢(hL)r£}r¤(h4X­Mocks attached as attributes or return values to other mocks have calls recorded in `method_calls` and `mock_calls` of the parent (unless a name is already set on the child)r¥hKjšhXhBhYh›h5}r¦(h7]r§hD]r¨h<]r©h:]rªhF]r«uhbNhchhd]r¬h£)r­}r®(h4X­Mocks attached as attributes or return values to other mocks have calls recorded in `method_calls` and `mock_calls` of the parent (unless a name is already set on the child)r¯hKj£hXhBhYh§h5}r°(h7]r±hD]r²h<]r³h:]r´hF]rµuhbKïhd]r¶(hrXTMocks attached as attributes or return values to other mocks have calls recorded in r·…r¸}r¹(h4XTMocks attached as attributes or return values to other mocks have calls recorded in rºhKj­ubh³)r»}r¼(h4X`method_calls`r½h5}r¾(h7]r¿hD]rÀh<]rÁh:]rÂhF]rÃuhKj­hd]rÄhrX method_callsrÅ…rÆ}rÇ(h4UhKj»ubahYhÁubhrX and rÈ…rÉ}rÊ(h4X and rËhKj­ubh³)rÌ}rÍ(h4X `mock_calls`rÎh5}rÏ(h7]rÐhD]rÑh<]rÒh:]rÓhF]rÔuhKj­hd]rÕhrX mock_callsrÖ…r×}rØ(h4UhKjÌubahYhÁubhrX: of the parent (unless a name is already set on the child)rÙ…rÚ}rÛ(h4X: of the parent (unless a name is already set on the child)rÜhKj­ubeubaubhL)rÝ}rÞ(h4XVAddition of `mock_add_spec` method for adding (or changing) a spec on an existing mockrßhKjšhXhBhYh›h5}rà(h7]ráhD]râh<]rãh:]rähF]råuhbNhchhd]ræh£)rç}rè(h4XVAddition of `mock_add_spec` method for adding (or changing) a spec on an existing mockréhKjÝhXhBhYh§h5}rê(h7]rëhD]rìh<]ríh:]rîhF]rïuhbKòhd]rð(hrX Addition of rñ…rò}ró(h4X Addition of rôhKjçubh³)rõ}rö(h4X`mock_add_spec`r÷h5}rø(h7]rùhD]rúh<]rûh:]rühF]rýuhKjçhd]rþhrX mock_add_specrÿ…r}r(h4UhKjõubahYhÁubhrX; method for adding (or changing) a spec on an existing mockr…r}r(h4X; method for adding (or changing) a spec on an existing mockrhKjçubeubaubhL)r}r(h4XrImproved repr for `Mock.call_args` and entries in `Mock.call_args_list`, `Mock.method_calls` and `Mock.mock_calls`rhKjšhXhBhYh›h5}r (h7]r hD]r h<]r h:]r hF]ruhbNhchhd]rh£)r}r(h4XrImproved repr for `Mock.call_args` and entries in `Mock.call_args_list`, `Mock.method_calls` and `Mock.mock_calls`rhKjhXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbKôhd]r(hrXImproved repr for r…r}r(h4XImproved repr for rhKjubh³)r}r(h4X`Mock.call_args`r h5}r!(h7]r"hD]r#h<]r$h:]r%hF]r&uhKjhd]r'hrXMock.call_argsr(…r)}r*(h4UhKjubahYhÁubhrX and entries in r+…r,}r-(h4X and entries in r.hKjubh³)r/}r0(h4X`Mock.call_args_list`r1h5}r2(h7]r3hD]r4h<]r5h:]r6hF]r7uhKjhd]r8hrXMock.call_args_listr9…r:}r;(h4UhKj/ubahYhÁubhrX, r<…r=}r>(h4X, r?hKjubh³)r@}rA(h4X`Mock.method_calls`rBh5}rC(h7]rDhD]rEh<]rFh:]rGhF]rHuhKjhd]rIhrXMock.method_callsrJ…rK}rL(h4UhKj@ubahYhÁubhrX and rM…rN}rO(h4X and rPhKjubh³)rQ}rR(h4X`Mock.mock_calls`rSh5}rT(h7]rUhD]rVh<]rWh:]rXhF]rYuhKjhd]rZhrXMock.mock_callsr[…r\}r](h4UhKjQubahYhÁubeubaubhL)r^}r_(h4XImproved repr for mocksr`hKjšhXhBhYh›h5}ra(h7]rbhD]rch<]rdh:]rehF]rfuhbNhchhd]rgh£)rh}ri(h4j`hKj^hXhBhYh§h5}rj(h7]rkhD]rlh<]rmh:]rnhF]rouhbKöhd]rphrXImproved repr for mocksrq…rr}rs(h4j`hKjhubaubaubhL)rt}ru(h4XpBUGFIX: minor fixes in the way `mock_calls` is worked out, especially for "intermediate" mocks in a call chain rvhKjšhXhBhYh›h5}rw(h7]rxhD]ryh<]rzh:]r{hF]r|uhbNhchhd]r}h£)r~}r(h4XnBUGFIX: minor fixes in the way `mock_calls` is worked out, especially for "intermediate" mocks in a call chainr€hKjthXhBhYh§h5}r(h7]r‚hD]rƒh<]r„h:]r…hF]r†uhbK÷hd]r‡(hrXBUGFIX: minor fixes in the way rˆ…r‰}rŠ(h4XBUGFIX: minor fixes in the way r‹hKj~ubh³)rŒ}r(h4X `mock_calls`rŽh5}r(h7]rhD]r‘h<]r’h:]r“hF]r”uhKj~hd]r•hrX mock_callsr–…r—}r˜(h4UhKjŒubahYhÁubhrXC is worked out, especially for "intermediate" mocks in a call chainr™…rš}r›(h4XC is worked out, especially for "intermediate" mocks in a call chainrœhKj~ubeubaubeubeubhS)r}rž(h4UhKhVhXhBhYhZh5}rŸ(h7]r hD]r¡h<]r¢h:]r£Uversion-0-8-0-beta-2r¤ahF]r¥hauhbKühchhd]r¦(hf)r§}r¨(h4X2011/08/05 Version 0.8.0 beta 2r©hKjhXhBhYhjh5}rª(h7]r«hD]r¬h<]r­h:]r®hF]r¯uhbKühchhd]r°hrX2011/08/05 Version 0.8.0 beta 2r±…r²}r³(h4j©hKj§ubaubhP)r´}rµ(h4UhKjhXhBhYhh5}r¶(h‘X*h:]r·h<]r¸h7]r¹hD]rºhF]r»uhbKþhchhd]r¼(hL)r½}r¾(h4XlSetting `side_effect` to an iterable will cause calls to the mock to return the next value from the iterabler¿hKj´hXhBhYh›h5}rÀ(h7]rÁhD]rÂh<]rÃh:]rÄhF]rÅuhbNhchhd]rÆh£)rÇ}rÈ(h4XlSetting `side_effect` to an iterable will cause calls to the mock to return the next value from the iterablerÉhKj½hXhBhYh§h5}rÊ(h7]rËhD]rÌh<]rÍh:]rÎhF]rÏuhbKþhd]rÐ(hrXSetting rÑ…rÒ}rÓ(h4XSetting rÔhKjÇubh³)rÕ}rÖ(h4X `side_effect`r×h5}rØ(h7]rÙhD]rÚh<]rÛh:]rÜhF]rÝuhKjÇhd]rÞhrX side_effectrß…rà}rá(h4UhKjÕubahYhÁubhrXW to an iterable will cause calls to the mock to return the next value from the iterablerâ…rã}rä(h4XW to an iterable will cause calls to the mock to return the next value from the iterableråhKjÇubeubaubhL)ræ}rç(h4XAdded `assert_any_call` methodrèhKj´hXhBhYh›h5}ré(h7]rêhD]rëh<]rìh:]ríhF]rîuhbNhchhd]rïh£)rð}rñ(h4jèhKjæhXhBhYh§h5}rò(h7]róhD]rôh<]rõh:]röhF]r÷uhbMhd]rø(hrXAdded rù…rú}rû(h4XAdded rühKjðubh³)rý}rþ(h4X`assert_any_call`rÿh5}r(h7]rhD]rh<]rh:]rhF]ruhKjðhd]rhrXassert_any_callr…r}r (h4UhKjýubahYhÁubhrX methodr …r }r (h4X methodr hKjðubeubaubhL)r}r(h4X3Moved `assert_has_calls` from call lists onto mocksrhKj´hXhBhYh›h5}r(h7]rhD]rh<]rh:]rhF]ruhbNhchhd]rh£)r}r(h4jhKjhXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbMhd]r (hrXMoved r!…r"}r#(h4XMoved r$hKjubh³)r%}r&(h4X`assert_has_calls`r'h5}r((h7]r)hD]r*h<]r+h:]r,hF]r-uhKjhd]r.hrXassert_has_callsr/…r0}r1(h4UhKj%ubahYhÁubhrX from call lists onto mocksr2…r3}r4(h4X from call lists onto mocksr5hKjubeubaubhL)r6}r7(h4X”BUGFIX: `call_args` and all members of `call_args_list` are two tuples of `(args, kwargs)` again instead of three tuples of `(name, args, kwargs)` r8hKj´hXhBhYh›h5}r9(h7]r:hD]r;h<]r<h:]r=hF]r>uhbNhchhd]r?h£)r@}rA(h4X’BUGFIX: `call_args` and all members of `call_args_list` are two tuples of `(args, kwargs)` again instead of three tuples of `(name, args, kwargs)`rBhKj6hXhBhYh§h5}rC(h7]rDhD]rEh<]rFh:]rGhF]rHuhbMhd]rI(hrXBUGFIX: rJ…rK}rL(h4XBUGFIX: rMhKj@ubh³)rN}rO(h4X `call_args`rPh5}rQ(h7]rRhD]rSh<]rTh:]rUhF]rVuhKj@hd]rWhrX call_argsrX…rY}rZ(h4UhKjNubahYhÁubhrX and all members of r[…r\}r](h4X and all members of r^hKj@ubh³)r_}r`(h4X`call_args_list`rah5}rb(h7]rchD]rdh<]reh:]rfhF]rguhKj@hd]rhhrXcall_args_listri…rj}rk(h4UhKj_ubahYhÁubhrX are two tuples of rl…rm}rn(h4X are two tuples of rohKj@ubh³)rp}rq(h4X`(args, kwargs)`rrh5}rs(h7]rthD]ruh<]rvh:]rwhF]rxuhKj@hd]ryhrX(args, kwargs)rz…r{}r|(h4UhKjpubahYhÁubhrX" again instead of three tuples of r}…r~}r(h4X" again instead of three tuples of r€hKj@ubh³)r}r‚(h4X`(name, args, kwargs)`rƒh5}r„(h7]r…hD]r†h<]r‡h:]rˆhF]r‰uhKj@hd]rŠhrX(name, args, kwargs)r‹…rŒ}r(h4UhKjubahYhÁubeubaubeubeubhS)rŽ}r(h4UhKhVhXhBhYhZh5}r(h7]r‘hD]r’h<]r“h:]r”Uversion-0-8-0-beta-1r•ahF]r–hauhbMhchhd]r—(hf)r˜}r™(h4X2011/07/25 Version 0.8.0 beta 1ršhKjŽhXhBhYhjh5}r›(h7]rœhD]rh<]ržh:]rŸhF]r uhbMhchhd]r¡hrX2011/07/25 Version 0.8.0 beta 1r¢…r£}r¤(h4jšhKj˜ubaubhP)r¥}r¦(h4UhKjŽhXhBhYhh5}r§(h‘X*h:]r¨h<]r©h7]rªhD]r«hF]r¬uhbM hchhd]r­(hL)r®}r¯(h4Xe`patch.TEST_PREFIX` for controlling how patchers recognise test methods when used to decorate a classr°hKj¥hXhBhYh›h5}r±(h7]r²hD]r³h<]r´h:]rµhF]r¶uhbNhchhd]r·h£)r¸}r¹(h4Xe`patch.TEST_PREFIX` for controlling how patchers recognise test methods when used to decorate a classrºhKj®hXhBhYh§h5}r»(h7]r¼hD]r½h<]r¾h:]r¿hF]rÀuhbM hd]rÁ(h³)rÂ}rÃ(h4X`patch.TEST_PREFIX`rÄh5}rÅ(h7]rÆhD]rÇh<]rÈh:]rÉhF]rÊuhKj¸hd]rËhrXpatch.TEST_PREFIXrÌ…rÍ}rÎ(h4UhKjÂubahYhÁubhrXR for controlling how patchers recognise test methods when used to decorate a classrÏ…rÐ}rÑ(h4XR for controlling how patchers recognise test methods when used to decorate a classrÒhKj¸ubeubaubhL)rÓ}rÔ(h4XË`Mock` call lists (`call_args_list`, `method_calls` & `mock_calls`) are now custom list objects that allow membership tests for "sub lists" and have an `assert_has_calls` method for unordered call checksrÕhKj¥hXhBhYh›h5}rÖ(h7]r×hD]rØh<]rÙh:]rÚhF]rÛuhbNhchhd]rÜh£)rÝ}rÞ(h4XË`Mock` call lists (`call_args_list`, `method_calls` & `mock_calls`) are now custom list objects that allow membership tests for "sub lists" and have an `assert_has_calls` method for unordered call checksrßhKjÓhXhBhYh§h5}rà(h7]ráhD]râh<]rãh:]rähF]råuhbM hd]ræ(h³)rç}rè(h4X`Mock`réh5}rê(h7]rëhD]rìh<]ríh:]rîhF]rïuhKjÝhd]rðhrXMockrñ…rò}ró(h4UhKjçubahYhÁubhrX call lists (rô…rõ}rö(h4X call lists (r÷hKjÝubh³)rø}rù(h4X`call_args_list`rúh5}rû(h7]rühD]rýh<]rþh:]rÿhF]ruhKjÝhd]rhrXcall_args_listr…r}r(h4UhKjøubahYhÁubhrX, r…r}r(h4X, rhKjÝubh³)r }r (h4X`method_calls`r h5}r (h7]r hD]rh<]rh:]rhF]ruhKjÝhd]rhrX method_callsr…r}r(h4UhKj ubahYhÁubhrX & r…r}r(h4X & rhKjÝubh³)r}r(h4X `mock_calls`rh5}r(h7]rhD]rh<]r h:]r!hF]r"uhKjÝhd]r#hrX mock_callsr$…r%}r&(h4UhKjubahYhÁubhrXV) are now custom list objects that allow membership tests for "sub lists" and have an r'…r(}r)(h4XV) are now custom list objects that allow membership tests for "sub lists" and have an r*hKjÝubh³)r+}r,(h4X`assert_has_calls`r-h5}r.(h7]r/hD]r0h<]r1h:]r2hF]r3uhKjÝhd]r4hrXassert_has_callsr5…r6}r7(h4UhKj+ubahYhÁubhrX! method for unordered call checksr8…r9}r:(h4X! method for unordered call checksr;hKjÝubeubaubhL)r<}r=(h4XI`callargs` changed to *always* be a three-tuple of `(name, args, kwargs)`r>hKj¥hXhBhYh›h5}r?(h7]r@hD]rAh<]rBh:]rChF]rDuhbNhchhd]rEh£)rF}rG(h4j>hKj<hXhBhYh§h5}rH(h7]rIhD]rJh<]rKh:]rLhF]rMuhbMhd]rN(h³)rO}rP(h4X `callargs`rQh5}rR(h7]rShD]rTh<]rUh:]rVhF]rWuhKjFhd]rXhrXcallargsrY…rZ}r[(h4UhKjOubahYhÁubhrX changed to r\…r]}r^(h4X changed to r_hKjFubjd)r`}ra(h4X*always*rbh5}rc(h7]rdhD]reh<]rfh:]rghF]rhuhKjFhd]rihrXalwaysrj…rk}rl(h4UhKj`ubahYjrubhrX be a three-tuple of rm…rn}ro(h4X be a three-tuple of rphKjFubh³)rq}rr(h4X`(name, args, kwargs)`rsh5}rt(h7]ruhD]rvh<]rwh:]rxhF]ryuhKjFhd]rzhrX(name, args, kwargs)r{…r|}r}(h4UhKjqubahYhÁubeubaubhL)r~}r(h4XYAddition of `mock_calls` list for *all* calls (including magic methods and chained calls)r€hKj¥hXhBhYh›h5}r(h7]r‚hD]rƒh<]r„h:]r…hF]r†uhbNhchhd]r‡h£)rˆ}r‰(h4XYAddition of `mock_calls` list for *all* calls (including magic methods and chained calls)rŠhKj~hXhBhYh§h5}r‹(h7]rŒhD]rh<]rŽh:]rhF]ruhbMhd]r‘(hrX Addition of r’…r“}r”(h4X Addition of r•hKjˆubh³)r–}r—(h4X `mock_calls`r˜h5}r™(h7]ršhD]r›h<]rœh:]rhF]ržuhKjˆhd]rŸhrX mock_callsr …r¡}r¢(h4UhKj–ubahYhÁubhrX list for r£…r¤}r¥(h4X list for r¦hKjˆubjd)r§}r¨(h4X*all*r©h5}rª(h7]r«hD]r¬h<]r­h:]r®hF]r¯uhKjˆhd]r°hrXallr±…r²}r³(h4UhKj§ubahYjrubhrX2 calls (including magic methods and chained calls)r´…rµ}r¶(h4X2 calls (including magic methods and chained calls)r·hKjˆubeubaubhL)r¸}r¹(h4X©Extension of `call` object to support chained calls and `callargs` for better comparisons with or without names. `call` object has a `call_list` method for chained callsrºhKj¥hXhBhYh›h5}r»(h7]r¼hD]r½h<]r¾h:]r¿hF]rÀuhbNhchhd]rÁh£)rÂ}rÃ(h4X©Extension of `call` object to support chained calls and `callargs` for better comparisons with or without names. `call` object has a `call_list` method for chained callsrÄhKj¸hXhBhYh§h5}rÅ(h7]rÆhD]rÇh<]rÈh:]rÉhF]rÊuhbMhd]rË(hrX Extension of rÌ…rÍ}rÎ(h4X Extension of rÏhKjÂubh³)rÐ}rÑ(h4X`call`rÒh5}rÓ(h7]rÔhD]rÕh<]rÖh:]r×hF]rØuhKjÂhd]rÙhrXcallrÚ…rÛ}rÜ(h4UhKjÐubahYhÁubhrX% object to support chained calls and rÝ…rÞ}rß(h4X% object to support chained calls and ràhKjÂubh³)rá}râ(h4X `callargs`rãh5}rä(h7]råhD]ræh<]rçh:]rèhF]réuhKjÂhd]rêhrXcallargsrë…rì}rí(h4UhKjáubahYhÁubhrX/ for better comparisons with or without names. rî…rï}rð(h4X/ for better comparisons with or without names. rñhKjÂubh³)rò}ró(h4X`call`rôh5}rõ(h7]röhD]r÷h<]røh:]rùhF]rúuhKjÂhd]rûhrXcallrü…rý}rþ(h4UhKjòubahYhÁubhrX object has a rÿ…r}r(h4X object has a rhKjÂubh³)r}r(h4X `call_list`rh5}r(h7]rhD]rh<]r h:]r hF]r uhKjÂhd]r hrX call_listr …r}r(h4UhKjubahYhÁubhrX method for chained callsr…r}r(h4X method for chained callsrhKjÂubeubaubhL)r}r(h4X9Added the public `instance` argument to `create_autospec`rhKj¥hXhBhYh›h5}r(h7]rhD]rh<]rh:]rhF]ruhbNhchhd]rh£)r}r(h4jhKjhXhBhYh§h5}r (h7]r!hD]r"h<]r#h:]r$hF]r%uhbMhd]r&(hrXAdded the public r'…r(}r)(h4XAdded the public r*hKjubh³)r+}r,(h4X `instance`r-h5}r.(h7]r/hD]r0h<]r1h:]r2hF]r3uhKjhd]r4hrXinstancer5…r6}r7(h4UhKj+ubahYhÁubhrX argument to r8…r9}r:(h4X argument to r;hKjubh³)r<}r=(h4X`create_autospec`r>h5}r?(h7]r@hD]rAh<]rBh:]rChF]rDuhKjhd]rEhrXcreate_autospecrF…rG}rH(h4UhKj<ubahYhÁubeubaubhL)rI}rJ(h4X>Support for using Java exceptions as a `side_effect` on JythonrKhKj¥hXhBhYh›h5}rL(h7]rMhD]rNh<]rOh:]rPhF]rQuhbNhchhd]rRh£)rS}rT(h4jKhKjIhXhBhYh§h5}rU(h7]rVhD]rWh<]rXh:]rYhF]rZuhbMhd]r[(hrX'Support for using Java exceptions as a r\…r]}r^(h4X'Support for using Java exceptions as a r_hKjSubh³)r`}ra(h4X `side_effect`rbh5}rc(h7]rdhD]reh<]rfh:]rghF]rhuhKjShd]rihrX side_effectrj…rk}rl(h4UhKj`ubahYhÁubhrX on Jythonrm…rn}ro(h4X on JythonrphKjSubeubaubhL)rq}rr(h4XPImproved failure messages for `assert_called_with` and `assert_called_once_with`rshKj¥hXhBhYh›h5}rt(h7]ruhD]rvh<]rwh:]rxhF]ryuhbNhchhd]rzh£)r{}r|(h4XPImproved failure messages for `assert_called_with` and `assert_called_once_with`r}hKjqhXhBhYh§h5}r~(h7]rhD]r€h<]rh:]r‚hF]rƒuhbMhd]r„(hrXImproved failure messages for r……r†}r‡(h4XImproved failure messages for rˆhKj{ubh³)r‰}rŠ(h4X`assert_called_with`r‹h5}rŒ(h7]rhD]rŽh<]rh:]rhF]r‘uhKj{hd]r’hrXassert_called_withr“…r”}r•(h4UhKj‰ubahYhÁubhrX and r–…r—}r˜(h4X and r™hKj{ubh³)rš}r›(h4X`assert_called_once_with`rœh5}r(h7]ržhD]rŸh<]r h:]r¡hF]r¢uhKj{hd]r£hrXassert_called_once_withr¤…r¥}r¦(h4UhKjšubahYhÁubeubaubhL)r§}r¨(h4X`Tuples as well as lists can be used to specify allowed methods for `spec` & `spec_set` argumentsr©hKj¥hXhBhYh›h5}rª(h7]r«hD]r¬h<]r­h:]r®hF]r¯uhbNhchhd]r°h£)r±}r²(h4X`Tuples as well as lists can be used to specify allowed methods for `spec` & `spec_set` argumentsr³hKj§hXhBhYh§h5}r´(h7]rµhD]r¶h<]r·h:]r¸hF]r¹uhbMhd]rº(hrXCTuples as well as lists can be used to specify allowed methods for r»…r¼}r½(h4XCTuples as well as lists can be used to specify allowed methods for r¾hKj±ubh³)r¿}rÀ(h4X`spec`rÁh5}rÂ(h7]rÃhD]rÄh<]rÅh:]rÆhF]rÇuhKj±hd]rÈhrXspecrÉ…rÊ}rË(h4UhKj¿ubahYhÁubhrX & rÌ…rÍ}rÎ(h4X & rÏhKj±ubh³)rÐ}rÑ(h4X `spec_set`rÒh5}rÓ(h7]rÔhD]rÕh<]rÖh:]r×hF]rØuhKj±hd]rÙhrXspec_setrÚ…rÛ}rÜ(h4UhKjÐubahYhÁubhrX argumentsrÝ…rÞ}rß(h4X argumentsràhKj±ubeubaubhL)rá}râ(h4XNBUGFIX: Fixed bug in `patch.multiple` for argument passing when creating mocksrãhKj¥hXhBhYh›h5}rä(h7]råhD]ræh<]rçh:]rèhF]réuhbNhchhd]rêh£)rë}rì(h4XNBUGFIX: Fixed bug in `patch.multiple` for argument passing when creating mocksríhKjáhXhBhYh§h5}rî(h7]rïhD]rðh<]rñh:]ròhF]róuhbMhd]rô(hrXBUGFIX: Fixed bug in rõ…rö}r÷(h4XBUGFIX: Fixed bug in røhKjëubh³)rù}rú(h4X`patch.multiple`rûh5}rü(h7]rýhD]rþh<]rÿh:]rhF]ruhKjëhd]rhrXpatch.multipler…r}r(h4UhKjùubahYhÁubhrX) for argument passing when creating mocksr…r}r(h4X) for argument passing when creating mocksr hKjëubeubaubhL)r }r (h4X(Added license file to the distribution r hKj¥hXhBhYh›h5}r (h7]rhD]rh<]rh:]rhF]ruhbNhchhd]rh£)r}r(h4X&Added license file to the distributionrhKj hXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbMhd]rhrX&Added license file to the distributionr…r}r (h4jhKjubaubaubeubeubhS)r!}r"(h4UhKhVhXhBhYhZh5}r#(h7]r$hD]r%h<]r&h:]r'Uversion-0-8-0-alpha-2r(ahF]r)h%auhbM hchhd]r*(hf)r+}r,(h4X 2011/07/16 Version 0.8.0 alpha 2r-hKj!hXhBhYhjh5}r.(h7]r/hD]r0h<]r1h:]r2hF]r3uhbM hchhd]r4hrX 2011/07/16 Version 0.8.0 alpha 2r5…r6}r7(h4j-hKj+ubaubhP)r8}r9(h4UhKj!hXhBhYhh5}r:(h‘X*h:]r;h<]r<h7]r=hD]r>hF]r?uhbM"hchhd]r@(hL)rA}rB(h4XU`patch.multiple` for doing multiple patches in a single call, using keyword argumentsrChKj8hXhBhYh›h5}rD(h7]rEhD]rFh<]rGh:]rHhF]rIuhbNhchhd]rJh£)rK}rL(h4XU`patch.multiple` for doing multiple patches in a single call, using keyword argumentsrMhKjAhXhBhYh§h5}rN(h7]rOhD]rPh<]rQh:]rRhF]rSuhbM"hd]rT(h³)rU}rV(h4X`patch.multiple`rWh5}rX(h7]rYhD]rZh<]r[h:]r\hF]r]uhKjKhd]r^hrXpatch.multipler_…r`}ra(h4UhKjUubahYhÁubhrXE for doing multiple patches in a single call, using keyword argumentsrb…rc}rd(h4XE for doing multiple patches in a single call, using keyword argumentsrehKjKubeubaubhL)rf}rg(h4X½New `new_callable` argument to `patch` and `patch.object` allowing you to pass in a class or callable object (instead of `MagicMock`) that will be called to replace the object being patchedrhhKj8hXhBhYh›h5}ri(h7]rjhD]rkh<]rlh:]rmhF]rnuhbNhchhd]roh£)rp}rq(h4X½New `new_callable` argument to `patch` and `patch.object` allowing you to pass in a class or callable object (instead of `MagicMock`) that will be called to replace the object being patchedrrhKjfhXhBhYh§h5}rs(h7]rthD]ruh<]rvh:]rwhF]rxuhbM$hd]ry(hrXNew rz…r{}r|(h4XNew r}hKjpubh³)r~}r(h4X`new_callable`r€h5}r(h7]r‚hD]rƒh<]r„h:]r…hF]r†uhKjphd]r‡hrX new_callablerˆ…r‰}rŠ(h4UhKj~ubahYhÁubhrX argument to r‹…rŒ}r(h4X argument to rŽhKjpubh³)r}r(h4X`patch`r‘h5}r’(h7]r“hD]r”h<]r•h:]r–hF]r—uhKjphd]r˜hrXpatchr™…rš}r›(h4UhKjubahYhÁubhrX and rœ…r}rž(h4X and rŸhKjpubh³)r }r¡(h4X`patch.object`r¢h5}r£(h7]r¤hD]r¥h<]r¦h:]r§hF]r¨uhKjphd]r©hrX patch.objectrª…r«}r¬(h4UhKj ubahYhÁubhrX@ allowing you to pass in a class or callable object (instead of r­…r®}r¯(h4X@ allowing you to pass in a class or callable object (instead of r°hKjpubh³)r±}r²(h4X `MagicMock`r³h5}r´(h7]rµhD]r¶h<]r·h:]r¸hF]r¹uhKjphd]rºhrX MagicMockr»…r¼}r½(h4UhKj±ubahYhÁubhrX9) that will be called to replace the object being patchedr¾…r¿}rÀ(h4X9) that will be called to replace the object being patchedrÁhKjpubeubaubhL)rÂ}rÃ(h4X[Addition of `NonCallableMock` and `NonCallableMagicMock`, mocks without a `__call__` methodrÄhKj8hXhBhYh›h5}rÅ(h7]rÆhD]rÇh<]rÈh:]rÉhF]rÊuhbNhchhd]rËh£)rÌ}rÍ(h4X[Addition of `NonCallableMock` and `NonCallableMagicMock`, mocks without a `__call__` methodrÎhKjÂhXhBhYh§h5}rÏ(h7]rÐhD]rÑh<]rÒh:]rÓhF]rÔuhbM'hd]rÕ(hrX Addition of rÖ…r×}rØ(h4X Addition of rÙhKjÌubh³)rÚ}rÛ(h4X`NonCallableMock`rÜh5}rÝ(h7]rÞhD]rßh<]ràh:]ráhF]râuhKjÌhd]rãhrXNonCallableMockrä…rå}ræ(h4UhKjÚubahYhÁubhrX and rç…rè}ré(h4X and rêhKjÌubh³)rë}rì(h4X`NonCallableMagicMock`ríh5}rî(h7]rïhD]rðh<]rñh:]ròhF]róuhKjÌhd]rôhrXNonCallableMagicMockrõ…rö}r÷(h4UhKjëubahYhÁubhrX, mocks without a rø…rù}rú(h4X, mocks without a rûhKjÌubh³)rü}rý(h4X `__call__`rþh5}rÿ(h7]rhD]rh<]rh:]rhF]ruhKjÌhd]rhrX__call__r…r}r(h4UhKjüubahYhÁubhrX methodr …r }r (h4X methodr hKjÌubeubaubhL)r }r(h4X`Mocks created by `patch` have a `MagicMock` as the `return_value` where a class is being patchedrhKj8hXhBhYh›h5}r(h7]rhD]rh<]rh:]rhF]ruhbNhchhd]rh£)r}r(h4X`Mocks created by `patch` have a `MagicMock` as the `return_value` where a class is being patchedrhKj hXhBhYh§h5}r(h7]rhD]rh<]rh:]rhF]ruhbM)hd]r (hrXMocks created by r!…r"}r#(h4XMocks created by r$hKjubh³)r%}r&(h4X`patch`r'h5}r((h7]r)hD]r*h<]r+h:]r,hF]r-uhKjhd]r.hrXpatchr/…r0}r1(h4UhKj%ubahYhÁubhrX have a r2…r3}r4(h4X have a r5hKjubh³)r6}r7(h4X `MagicMock`r8h5}r9(h7]r:hD]r;h<]r<h:]r=hF]r>uhKjhd]r?hrX MagicMockr@…rA}rB(h4UhKj6ubahYhÁubhrX as the rC…rD}rE(h4X as the rFhKjubh³)rG}rH(h4X`return_value`rIh5}rJ(h7]rKhD]rLh<]rMh:]rNhF]rOuhKjhd]rPhrX return_valuerQ…rR}rS(h4UhKjGubahYhÁubhrX where a class is being patchedrT…rU}rV(h4X where a class is being patchedrWhKjubeubaubhL)rX}rY(h4X§`create_autospec` can create non-callable mocks for non-callable objects. `return_value` mocks of classes will be non-callable unless the class has a `__call__` methodrZhKj8hXhBhYh›h5}r[(h7]r\hD]r]h<]r^h:]r_hF]r`uhbNhchhd]rah£)rb}rc(h4X§`create_autospec` can create non-callable mocks for non-callable objects. `return_value` mocks of classes will be non-callable unless the class has a `__call__` methodrdhKjXhXhBhYh§h5}re(h7]rfhD]rgh<]rhh:]rihF]rjuhbM+hd]rk(h³)rl}rm(h4X`create_autospec`rnh5}ro(h7]rphD]rqh<]rrh:]rshF]rtuhKjbhd]ruhrXcreate_autospecrv…rw}rx(h4UhKjlubahYhÁubhrX9 can create non-callable mocks for non-callable objects. ry…rz}r{(h4X9 can create non-callable mocks for non-callable objects. r|hKjbubh³)r}}r~(h4X`return_value`rh5}r€(h7]rhD]r‚h<]rƒh:]r„hF]r…uhKjbhd]r†hrX return_valuer‡…rˆ}r‰(h4UhKj}ubahYhÁubhrX> mocks of classes will be non-callable unless the class has a rŠ…r‹}rŒ(h4X> mocks of classes will be non-callable unless the class has a rhKjbubh³)rŽ}r(h4X `__call__`rh5}r‘(h7]r’hD]r“h<]r”h:]r•hF]r–uhKjbhd]r—hrX__call__r˜…r™}rš(h4UhKjŽubahYhÁubhrX methodr›…rœ}r(h4X methodržhKjbubeubaubhL)rŸ}r (h4X‰`autospec` creates a `MagicMock` without a spec for properties and slot descriptors, because we don't know the type of object they returnr¡hKj8hXhBhYh›h5}r¢(h7]r£hD]r¤h<]r¥h:]r¦hF]r§uhbNhchhd]r¨h£)r©}rª(h4X‰`autospec` creates a `MagicMock` without a spec for properties and slot descriptors, because we don't know the type of object they returnr«hKjŸhXhBhYh§h5}r¬(h7]r­hD]r®h<]r¯h:]r°hF]r±uhbM.hd]r²(h³)r³}r´(h4X `autospec`rµh5}r¶(h7]r·hD]r¸h<]r¹h:]rºhF]r»uhKj©hd]r¼hrXautospecr½…r¾}r¿(h4UhKj³ubahYhÁubhrX creates a rÀ…rÁ}rÂ(h4X creates a rÃhKj©ubh³)rÄ}rÅ(h4X `MagicMock`rÆh5}rÇ(h7]rÈhD]rÉh<]rÊh:]rËhF]rÌuhKj©hd]rÍhrX MagicMockrÎ…rÏ}rÐ(h4UhKjÄubahYhÁubhrXi without a spec for properties and slot descriptors, because we don't know the type of object they returnrÑ…rÒ}rÓ(h4Xi without a spec for properties and slot descriptors, because we don't know the type of object they returnrÔhKj©ubeubaubhL)rÕ}rÖ(h4X5Removed the "inherit" argument from `create_autospec`r×hKj8hXhBhYh›h5}rØ(h7]rÙhD]rÚh<]rÛh:]rÜhF]rÝuhbNhchhd]rÞh£)rß}rà(h4j×hKjÕhXhBhYh§h5}rá(h7]râhD]rãh<]räh:]råhF]ræuhbM0hd]rç(hrX$Removed the "inherit" argument from rè…ré}rê(h4X$Removed the "inherit" argument from rëhKjßubh³)rì}rí(h4X`create_autospec`rîh5}rï(h7]rðhD]rñh<]ròh:]róhF]rôuhKjßhd]rõhrXcreate_autospecrö…r÷}rø(h4UhKjìubahYhÁubeubaubhL)rù}rú(h4XRCalling `stop` on an unstarted patcher fails with a more meaningful error messagerûhKj8hXhBhYh›h5}rü(h7]rýhD]rþh<]rÿh:]rhF]ruhbNhchhd]rh£)r}r(h4XRCalling `stop` on an unstarted patcher fails with a more meaningful error messagerhKjùhXhBhYh§h5}r(h7]rhD]rh<]r h:]r hF]r uhbM1hd]r (hrXCalling r …r}r(h4XCalling rhKjubh³)r}r(h4X`stop`rh5}r(h7]rhD]rh<]rh:]rhF]ruhKjhd]rhrXstopr…r}r(h4UhKjubahYhÁubhrXD on an unstarted patcher fails with a more meaningful error messager…r}r (h4XD on an unstarted patcher fails with a more meaningful error messager!hKjubeubaubhL)r"}r#(h4X]BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in placer$hKj8hXhBhYh›h5}r%(h7]r&hD]r'h<]r(h:]r)hF]r*uhbNhchhd]r+h£)r,}r-(h4X]BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in placer.hKj"hXhBhYh§h5}r/(h7]r0hD]r1h<]r2h:]r3hF]r4uhbM3hd]r5hrX]BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in placer6…r7}r8(h4j.hKj,ubaubaubhL)r9}r:(h4X\BUGFIX: `__truediv__` and `__rtruediv__` not available as magic methods on mocks in Python 3r;hKj8hXhBhYh›h5}r<(h7]r=hD]r>h<]r?h:]r@hF]rAuhbNhchhd]rBh£)rC}rD(h4X\BUGFIX: `__truediv__` and `__rtruediv__` not available as magic methods on mocks in Python 3rEhKj9hXhBhYh§h5}rF(h7]rGhD]rHh<]rIh:]rJhF]rKuhbM5hd]rL(hrXBUGFIX: rM…rN}rO(h4XBUGFIX: rPhKjCubh³)rQ}rR(h4X `__truediv__`rSh5}rT(h7]rUhD]rVh<]rWh:]rXhF]rYuhKjChd]rZhrX __truediv__r[…r\}r](h4UhKjQubahYhÁubhrX and r^…r_}r`(h4X and rahKjCubh³)rb}rc(h4X`__rtruediv__`rdh5}re(h7]rfhD]rgh<]rhh:]rihF]rjuhKjChd]rkhrX __rtruediv__rl…rm}rn(h4UhKjbubahYhÁubhrX4 not available as magic methods on mocks in Python 3ro…rp}rq(h4X4 not available as magic methods on mocks in Python 3rrhKjCubeubaubhL)rs}rt(h4XfBUGFIX: `assert_called_with` / `assert_called_once_with` can be used with `self` as a keyword argumentruhKj8hXhBhYh›h5}rv(h7]rwhD]rxh<]ryh:]rzhF]r{uhbNhchhd]r|h£)r}}r~(h4XfBUGFIX: `assert_called_with` / `assert_called_once_with` can be used with `self` as a keyword argumentrhKjshXhBhYh§h5}r€(h7]rhD]r‚h<]rƒh:]r„hF]r…uhbM7hd]r†(hrXBUGFIX: r‡…rˆ}r‰(h4XBUGFIX: rŠhKj}ubh³)r‹}rŒ(h4X`assert_called_with`rh5}rŽ(h7]rhD]rh<]r‘h:]r’hF]r“uhKj}hd]r”hrXassert_called_withr•…r–}r—(h4UhKj‹ubahYhÁubhrX / r˜…r™}rš(h4X / r›hKj}ubh³)rœ}r(h4X`assert_called_once_with`ržh5}rŸ(h7]r hD]r¡h<]r¢h:]r£hF]r¤uhKj}hd]r¥hrXassert_called_once_withr¦…r§}r¨(h4UhKjœubahYhÁubhrX can be used with r©…rª}r«(h4X can be used with r¬hKj}ubh³)r­}r®(h4X`self`r¯h5}r°(h7]r±hD]r²h<]r³h:]r´hF]rµuhKj}hd]r¶hrXselfr·…r¸}r¹(h4UhKj­ubahYhÁubhrX as a keyword argumentrº…r»}r¼(h4X as a keyword argumentr½hKj}ubeubaubhL)r¾}r¿(h4XsBUGFIX: autospec for functions / methods with an argument named self that isn't the first argument no longer brokenrÀhKj8hXhBhYh›h5}rÁ(h7]rÂhD]rÃh<]rÄh:]rÅhF]rÆuhbNhchhd]rÇh£)rÈ}rÉ(h4XsBUGFIX: autospec for functions / methods with an argument named self that isn't the first argument no longer brokenrÊhKj¾hXhBhYh§h5}rË(h7]rÌhD]rÍh<]rÎh:]rÏhF]rÐuhbM9hd]rÑhrXsBUGFIX: autospec for functions / methods with an argument named self that isn't the first argument no longer brokenrÒ…rÓ}rÔ(h4jÊhKjÈubaubaubhL)rÕ}rÖ(h4X¥BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance")r×hKj8hXhBhYh›h5}rØ(h7]rÙhD]rÚh<]rÛh:]rÜhF]rÝuhbNhchhd]rÞh£)rß}rà(h4X¥BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance")ráhKjÕhXhBhYh§h5}râ(h7]rãhD]räh<]råh:]ræhF]rçuhbM;hd]rèhrX¥BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance")ré…rê}rë(h4jáhKjßubaubaubhL)rì}rí(h4XEBUGFIX: remove the `__unittest` marker causing traceback truncation rîhKj8hXhBhYh›h5}rï(h7]rðhD]rñh<]ròh:]róhF]rôuhbNhchhd]rõh£)rö}r÷(h4XCBUGFIX: remove the `__unittest` marker causing traceback truncationrøhKjìhXhBhYh§h5}rù(h7]rúhD]rûh<]rüh:]rýhF]rþuhbM>hd]rÿ(hrXBUGFIX: remove the r…r}r(h4XBUGFIX: remove the rhKjöubh³)r}r(h4X `__unittest`rh5}r(h7]rhD]r h<]r h:]r hF]r uhKjöhd]r hrX __unittestr…r}r(h4UhKjubahYhÁubhrX$ marker causing traceback truncationr…r}r(h4X$ marker causing traceback truncationrhKjöubeubaubeubeubhS)r}r(h4UhKhVhXhBhYhZh5}r(h7]rhD]rh<]rh:]rUversion-0-8-0-alpha-1rahF]rh#auhbMBhchhd]r(hf)r}r (h4X 2011/06/14 Version 0.8.0 alpha 1r!hKjhXhBhYhjh5}r"(h7]r#hD]r$h<]r%h:]r&hF]r'uhbMBhchhd]r(hrX 2011/06/14 Version 0.8.0 alpha 1r)…r*}r+(h4j!hKjubaubh£)r,}r-(h4X<mock 0.8.0 is the last version that will support Python 2.4.r.hKjhXhBhYh§h5}r/(h7]r0hD]r1h<]r2h:]r3hF]r4uhbMDhchhd]r5hrX<mock 0.8.0 is the last version that will support Python 2.4.r6…r7}r8(h4j.hKj,ubaubhP)r9}r:(h4UhKjhXhBhYhh5}r;(h‘X*h:]r<h<]r=h7]r>hD]r?hF]r@uhbMFhchhd]rA(hL)rB}rC(h4XˆThe patchers (`patch`, `patch.object` and `patch.dict`), plus `Mock` and `MagicMock`, take arbitrary keyword arguments for configurationrDhKj9hXhBhYh›h5}rE(h7]rFhD]rGh<]rHh:]rIhF]rJuhbNhchhd]rKh£)rL}rM(h4XˆThe patchers (`patch`, `patch.object` and `patch.dict`), plus `Mock` and `MagicMock`, take arbitrary keyword arguments for configurationrNhKjBhXhBhYh§h5}rO(h7]rPhD]rQh<]rRh:]rShF]rTuhbMFhd]rU(hrXThe patchers (rV…rW}rX(h4XThe patchers (rYhKjLubh³)rZ}r[(h4X`patch`r\h5}r](h7]r^hD]r_h<]r`h:]rahF]rbuhKjLhd]rchrXpatchrd…re}rf(h4UhKjZubahYhÁubhrX, rg…rh}ri(h4X, rjhKjLubh³)rk}rl(h4X`patch.object`rmh5}rn(h7]rohD]rph<]rqh:]rrhF]rsuhKjLhd]rthrX patch.objectru…rv}rw(h4UhKjkubahYhÁubhrX and rx…ry}rz(h4X and r{hKjLubh³)r|}r}(h4X `patch.dict`r~h5}r(h7]r€hD]rh<]r‚h:]rƒhF]r„uhKjLhd]r…hrX patch.dictr†…r‡}rˆ(h4UhKj|ubahYhÁubhrX), plus r‰…rŠ}r‹(h4X), plus rŒhKjLubh³)r}rŽ(h4X`Mock`rh5}r(h7]r‘hD]r’h<]r“h:]r”hF]r•uhKjLhd]r–hrXMockr—…r˜}r™(h4UhKjubahYhÁubhrX and rš…r›}rœ(h4X and rhKjLubh³)rž}rŸ(h4X `MagicMock`r h5}r¡(h7]r¢hD]r£h<]r¤h:]r¥hF]r¦uhKjLhd]r§hrX MagicMockr¨…r©}rª(h4UhKjžubahYhÁubhrX4, take arbitrary keyword arguments for configurationr«…r¬}r­(h4X4, take arbitrary keyword arguments for configurationr®hKjLubeubaubhL)r¯}r°(h4XwNew mock method `configure_mock` for setting attributes and return values / side effects on the mock and its attributesr±hKj9hXhBhYh›h5}r²(h7]r³hD]r´h<]rµh:]r¶hF]r·uhbNhchhd]r¸h£)r¹}rº(h4XwNew mock method `configure_mock` for setting attributes and return values / side effects on the mock and its attributesr»hKj¯hXhBhYh§h5}r¼(h7]r½hD]r¾h<]r¿h:]rÀhF]rÁuhbMHhd]rÂ(hrXNew mock method rÃ…rÄ}rÅ(h4XNew mock method rÆhKj¹ubh³)rÇ}rÈ(h4X`configure_mock`rÉh5}rÊ(h7]rËhD]rÌh<]rÍh:]rÎhF]rÏuhKj¹hd]rÐhrXconfigure_mockrÑ…rÒ}rÓ(h4UhKjÇubahYhÁubhrXW for setting attributes and return values / side effects on the mock and its attributesrÔ…rÕ}rÖ(h4XW for setting attributes and return values / side effects on the mock and its attributesr×hKj¹ubeubaubhL)rØ}rÙ(h4XÄIn Python 2.6 or more recent, `dir` on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes.rÚhKj9hXhBhYh›h5}rÛ(h7]rÜhD]rÝh<]rÞh:]rßhF]ràuhbNhchhd]ráh£)râ}rã(h4XÄIn Python 2.6 or more recent, `dir` on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes.rähKjØhXhBhYh§h5}rå(h7]ræhD]rçh<]rèh:]réhF]rêuhbMJhd]rë(hrXIn Python 2.6 or more recent, rì…rí}rî(h4XIn Python 2.6 or more recent, rïhKjâubh³)rð}rñ(h4X`dir`ròh5}ró(h7]rôhD]rõh<]röh:]r÷hF]røuhKjâhd]rùhrXdirrú…rû}rü(h4UhKjðubahYhÁubhrX¡ on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes.rý…rþ}rÿ(h4X¡ on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes.r hKjâubeubaubhL)r }r (h4XModule level `FILTER_DIR` added to control whether `dir(mock)` filters private attributes. `True` by default. Note that `vars(Mock())` can still be used to get all instance attributes and `dir(type(Mock())` will still return all the other attributes (irrespective of `FILTER_DIR`)r hKj9hXhBhYh›h5}r (h7]r hD]r h<]r h:]r hF]r uhbNhchhd]r h£)r }r (h4XModule level `FILTER_DIR` added to control whether `dir(mock)` filters private attributes. `True` by default. Note that `vars(Mock())` can still be used to get all instance attributes and `dir(type(Mock())` will still return all the other attributes (irrespective of `FILTER_DIR`)r hKj hXhBhYh§h5}r (h7]r hD]r h<]r h:]r hF]r uhbMMhd]r (hrX Module level r …r }r (h4X Module level r hKj ubh³)r }r (h4X `FILTER_DIR`r h5}r (h7]r hD]r h<]r h:]r hF]r! uhKj hd]r" hrX FILTER_DIRr# …r$ }r% (h4UhKj ubahYhÁubhrX added to control whether r& …r' }r( (h4X added to control whether r) hKj ubh³)r* }r+ (h4X `dir(mock)`r, h5}r- (h7]r. hD]r/ h<]r0 h:]r1 hF]r2 uhKj hd]r3 hrX dir(mock)r4 …r5 }r6 (h4UhKj* ubahYhÁubhrX filters private attributes. r7 …r8 }r9 (h4X filters private attributes. r: hKj ubh³)r; }r< (h4X`True`r= h5}r> (h7]r? hD]r@ h<]rA h:]rB hF]rC uhKj hd]rD hrXTruerE …rF }rG (h4UhKj; ubahYhÁubhrX by default. Note that rH …rI }rJ (h4X by default. Note that rK hKj ubh³)rL }rM (h4X`vars(Mock())`rN h5}rO (h7]rP hD]rQ h<]rR h:]rS hF]rT uhKj hd]rU hrX vars(Mock())rV …rW }rX (h4UhKjL ubahYhÁubhrX6 can still be used to get all instance attributes and rY …rZ }r[ (h4X6 can still be used to get all instance attributes and r\ hKj ubh³)r] }r^ (h4X`dir(type(Mock())`r_ h5}r` (h7]ra hD]rb h<]rc h:]rd hF]re uhKj hd]rf hrXdir(type(Mock())rg …rh }ri (h4UhKj] ubahYhÁubhrX= will still return all the other attributes (irrespective of rj …rk }rl (h4X= will still return all the other attributes (irrespective of rm hKj ubh³)rn }ro (h4X `FILTER_DIR`rp h5}rq (h7]rr hD]rs h<]rt h:]ru hF]rv uhKj hd]rw hrX FILTER_DIRrx …ry }rz (h4UhKjn ubahYhÁubhrX)…r{ }r| (h4X)hKj ubeubaubhL)r} }r~ (h4XR`patch` and `patch.object` now create a `MagicMock` instead of a `Mock` by defaultr hKj9hXhBhYh›h5}r€ (h7]r hD]r‚ h<]rƒ h:]r„ hF]r… uhbNhchhd]r† h£)r‡ }rˆ (h4XR`patch` and `patch.object` now create a `MagicMock` instead of a `Mock` by defaultr‰ hKj} hXhBhYh§h5}rŠ (h7]r‹ hD]rŒ h<]r h:]rŽ hF]r uhbMQhd]r (h³)r‘ }r’ (h4X`patch`r“ h5}r” (h7]r• hD]r– h<]r— h:]r˜ hF]r™ uhKj‡ hd]rš hrXpatchr› …rœ }r (h4UhKj‘ ubahYhÁubhrX and rž …rŸ }r  (h4X and r¡ hKj‡ ubh³)r¢ }r£ (h4X`patch.object`r¤ h5}r¥ (h7]r¦ hD]r§ h<]r¨ h:]r© hF]rª uhKj‡ hd]r« hrX patch.objectr¬ …r­ }r® (h4UhKj¢ ubahYhÁubhrX now create a r¯ …r° }r± (h4X now create a r² hKj‡ ubh³)r³ }r´ (h4X `MagicMock`rµ h5}r¶ (h7]r· hD]r¸ h<]r¹ h:]rº hF]r» uhKj‡ hd]r¼ hrX MagicMockr½ …r¾ }r¿ (h4UhKj³ ubahYhÁubhrX instead of a rÀ …rÁ }r (h4X instead of a rà hKj‡ ubh³)rÄ }rÅ (h4X`Mock`rÆ h5}rÇ (h7]rÈ hD]rÉ h<]rÊ h:]rË hF]rÌ uhKj‡ hd]rÍ hrXMockrÎ …rÏ }rÐ (h4UhKjÄ ubahYhÁubhrX by defaultrÑ …rÒ }rÓ (h4X by defaultrÔ hKj‡ ubeubaubhL)rÕ }rÖ (h4X@Added `ANY` for ignoring arguments in `assert_called_with` callsr× hKj9hXhBhYh›h5}rØ (h7]rÙ hD]rÚ h<]rÛ h:]rÜ hF]rÝ uhbNhchhd]rÞ h£)rß }rà (h4j× hKjÕ hXhBhYh§h5}rá (h7]râ hD]rã h<]rä h:]rå hF]ræ uhbMShd]rç (hrXAdded rè …ré }rê (h4XAdded rë hKjß ubh³)rì }rí (h4X`ANY`rî h5}rï (h7]rð hD]rñ h<]rò h:]ró hF]rô uhKjß hd]rõ hrXANYrö …r÷ }rø (h4UhKjì ubahYhÁubhrX for ignoring arguments in rù …rú }rû (h4X for ignoring arguments in rü hKjß ubh³)rý }rþ (h4X`assert_called_with`rÿ h5}r!(h7]r!hD]r!h<]r!h:]r!hF]r!uhKjß hd]r!hrXassert_called_withr!…r!}r !(h4UhKjý ubahYhÁubhrX callsr !…r !}r !(h4X callsr !hKjß ubeubaubhL)r!}r!(h4X Addition of `call` helper objectr!hKj9hXhBhYh›h5}r!(h7]r!hD]r!h<]r!h:]r!hF]r!uhbNhchhd]r!h£)r!}r!(h4j!hKj!hXhBhYh§h5}r!(h7]r!hD]r!h<]r!h:]r!hF]r!uhbMThd]r !(hrX Addition of r!!…r"!}r#!(h4X Addition of r$!hKj!ubh³)r%!}r&!(h4X`call`r'!h5}r(!(h7]r)!hD]r*!h<]r+!h:]r,!hF]r-!uhKj!hd]r.!hrXcallr/!…r0!}r1!(h4UhKj%!ubahYhÁubhrX helper objectr2!…r3!}r4!(h4X helper objectr5!hKj!ubeubaubhL)r6!}r7!(h4XÁProtocol methods on `MagicMock` are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a MagicMock instead of a Mock as it was previouslyr8!hKj9hXhBhYh›h5}r9!(h7]r:!hD]r;!h<]r!uhbNhchhd]r?!h£)r@!}rA!(h4XÁProtocol methods on `MagicMock` are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a MagicMock instead of a Mock as it was previouslyrB!hKj6!hXhBhYh§h5}rC!(h7]rD!hD]rE!h<]rF!h:]rG!hF]rH!uhbMUhd]rI!(hrXProtocol methods on rJ!…rK!}rL!(h4XProtocol methods on rM!hKj@!ubh³)rN!}rO!(h4X `MagicMock`rP!h5}rQ!(h7]rR!hD]rS!h<]rT!h:]rU!hF]rV!uhKj@!hd]rW!hrX MagicMockrX!…rY!}rZ!(h4UhKjN!ubahYhÁubhrX¢ are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a MagicMock instead of a Mock as it was previouslyr[!…r\!}r]!(h4X¢ are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a MagicMock instead of a Mock as it was previouslyr^!hKj@!ubeubaubhL)r_!}r`!(h4XUAdded the Mock API (`assert_called_with` etc) to functions created by `mocksignature`ra!hKj9hXhBhYh›h5}rb!(h7]rc!hD]rd!h<]re!h:]rf!hF]rg!uhbNhchhd]rh!h£)ri!}rj!(h4XUAdded the Mock API (`assert_called_with` etc) to functions created by `mocksignature`rk!hKj_!hXhBhYh§h5}rl!(h7]rm!hD]rn!h<]ro!h:]rp!hF]rq!uhbMXhd]rr!(hrXAdded the Mock API (rs!…rt!}ru!(h4XAdded the Mock API (rv!hKji!ubh³)rw!}rx!(h4X`assert_called_with`ry!h5}rz!(h7]r{!hD]r|!h<]r}!h:]r~!hF]r!uhKji!hd]r€!hrXassert_called_withr!…r‚!}rƒ!(h4UhKjw!ubahYhÁubhrX etc) to functions created by r„!…r…!}r†!(h4X etc) to functions created by r‡!hKji!ubh³)rˆ!}r‰!(h4X`mocksignature`rŠ!h5}r‹!(h7]rŒ!hD]r!h<]rŽ!h:]r!hF]r!uhKji!hd]r‘!hrX mocksignaturer’!…r“!}r”!(h4UhKjˆ!ubahYhÁubeubaubhL)r•!}r–!(h4XPrivate attributes `_name`, `_methods`, '_children', `_wraps` and `_parent` (etc) renamed to reduce likelihood of clash with user attributes.r—!hKj9hXhBhYh›h5}r˜!(h7]r™!hD]rš!h<]r›!h:]rœ!hF]r!uhbNhchhd]rž!h£)rŸ!}r !(h4XPrivate attributes `_name`, `_methods`, '_children', `_wraps` and `_parent` (etc) renamed to reduce likelihood of clash with user attributes.r¡!hKj•!hXhBhYh§h5}r¢!(h7]r£!hD]r¤!h<]r¥!h:]r¦!hF]r§!uhbMZhd]r¨!(hrXPrivate attributes r©!…rª!}r«!(h4XPrivate attributes r¬!hKjŸ!ubh³)r­!}r®!(h4X`_name`r¯!h5}r°!(h7]r±!hD]r²!h<]r³!h:]r´!hF]rµ!uhKjŸ!hd]r¶!hrX_namer·!…r¸!}r¹!(h4UhKj­!ubahYhÁubhrX, rº!…r»!}r¼!(h4X, r½!hKjŸ!ubh³)r¾!}r¿!(h4X `_methods`rÀ!h5}rÁ!(h7]rÂ!hD]rÃ!h<]rÄ!h:]rÅ!hF]rÆ!uhKjŸ!hd]rÇ!hrX_methodsrÈ!…rÉ!}rÊ!(h4UhKj¾!ubahYhÁubhrX, '_children', rË!…rÌ!}rÍ!(h4X, '_children', rÎ!hKjŸ!ubh³)rÏ!}rÐ!(h4X`_wraps`rÑ!h5}rÒ!(h7]rÓ!hD]rÔ!h<]rÕ!h:]rÖ!hF]r×!uhKjŸ!hd]rØ!hrX_wrapsrÙ!…rÚ!}rÛ!(h4UhKjÏ!ubahYhÁubhrX and rÜ!…rÝ!}rÞ!(h4X and rß!hKjŸ!ubh³)rà!}rá!(h4X `_parent`râ!h5}rã!(h7]rä!hD]rå!h<]ræ!h:]rç!hF]rè!uhKjŸ!hd]ré!hrX_parentrê!…rë!}rì!(h4UhKjà!ubahYhÁubhrXB (etc) renamed to reduce likelihood of clash with user attributes.rí!…rî!}rï!(h4XB (etc) renamed to reduce likelihood of clash with user attributes.rð!hKjŸ!ubeubaubhL)rñ!}rò!(h4XImplemented auto-speccing (recursive, lazy speccing of mocks with mocked signatures for functions/methods) Limitations: - Doesn't mock magic methods or attributes (it creates MagicMocks, so the magic methods are *there*, they just don't have the signature mocked nor are attributes followed) - Doesn't mock function / method attributes - Uses object traversal on the objects being mocked to determine types - so properties etc may be triggered - The return value of mocked classes (the 'instance') has the same call signature as the class __init__ (as they share the same spec) You create auto-specced mocks by passing `autospec=True` to `patch`. Note that attributes that are None are special cased and mocked without a spec (so any attribute / method can be used). This is because None is typically used as a default value for attributes that may be of some other type, and as we don't know what type that may be we allow all access. Note that the `autospec` option to `patch` obsoletes the `mocksignature` option. ró!hKj9hXhBhYh›h5}rô!(h7]rõ!hD]rö!h<]r÷!h:]rø!hF]rù!uhbNhchhd]rú!(h£)rû!}rü!(h4XjImplemented auto-speccing (recursive, lazy speccing of mocks with mocked signatures for functions/methods)rý!hKjñ!hXhBhYh§h5}rþ!(h7]rÿ!hD]r"h<]r"h:]r"hF]r"uhbM\hd]r"hrXjImplemented auto-speccing (recursive, lazy speccing of mocks with mocked signatures for functions/methods)r"…r"}r"(h4jý!hKjû!ubaubh£)r"}r "(h4X Limitations:r "hKjñ!hXhBhYh§h5}r "(h7]r "hD]r "h<]r"h:]r"hF]r"uhbM_hd]r"hrX Limitations:r"…r"}r"(h4j "hKj"ubaubhP)r"}r"(h4Uh5}r"(h‘X-h:]r"h<]r"h7]r"hD]r"hF]r"uhKjñ!hd]r"(hL)r"}r"(h4X©Doesn't mock magic methods or attributes (it creates MagicMocks, so the magic methods are *there*, they just don't have the signature mocked nor are attributes followed)r "h5}r!"(h7]r""hD]r#"h<]r$"h:]r%"hF]r&"uhKj"hd]r'"h£)r("}r)"(h4X©Doesn't mock magic methods or attributes (it creates MagicMocks, so the magic methods are *there*, they just don't have the signature mocked nor are attributes followed)r*"hKj"hXhBhYh§h5}r+"(h7]r,"hD]r-"h<]r."h:]r/"hF]r0"uhbMahd]r1"(hrXZDoesn't mock magic methods or attributes (it creates MagicMocks, so the magic methods are r2"…r3"}r4"(h4XZDoesn't mock magic methods or attributes (it creates MagicMocks, so the magic methods are r5"hKj("ubjd)r6"}r7"(h4X*there*r8"h5}r9"(h7]r:"hD]r;"h<]r<"h:]r="hF]r>"uhKj("hd]r?"hrXtherer@"…rA"}rB"(h4UhKj6"ubahYjrubhrXH, they just don't have the signature mocked nor are attributes followed)rC"…rD"}rE"(h4XH, they just don't have the signature mocked nor are attributes followed)rF"hKj("ubeubahYh›ubhL)rG"}rH"(h4X)Doesn't mock function / method attributesrI"h5}rJ"(h7]rK"hD]rL"h<]rM"h:]rN"hF]rO"uhKj"hd]rP"h£)rQ"}rR"(h4jI"hKjG"hXhBhYh§h5}rS"(h7]rT"hD]rU"h<]rV"h:]rW"hF]rX"uhbMdhd]rY"hrX)Doesn't mock function / method attributesrZ"…r["}r\"(h4jI"hKjQ"ubaubahYh›ubhL)r]"}r^"(h4XiUses object traversal on the objects being mocked to determine types - so properties etc may be triggeredr_"h5}r`"(h7]ra"hD]rb"h<]rc"h:]rd"hF]re"uhKj"hd]rf"h£)rg"}rh"(h4XiUses object traversal on the objects being mocked to determine types - so properties etc may be triggeredri"hKj]"hXhBhYh§h5}rj"(h7]rk"hD]rl"h<]rm"h:]rn"hF]ro"uhbMehd]rp"hrXiUses object traversal on the objects being mocked to determine types - so properties etc may be triggeredrq"…rr"}rs"(h4ji"hKjg"ubaubahYh›ubhL)rt"}ru"(h4X„The return value of mocked classes (the 'instance') has the same call signature as the class __init__ (as they share the same spec) rv"h5}rw"(h7]rx"hD]ry"h<]rz"h:]r{"hF]r|"uhKj"hd]r}"h£)r~"}r"(h4XƒThe return value of mocked classes (the 'instance') has the same call signature as the class __init__ (as they share the same spec)r€"hKjt"hXhBhYh§h5}r"(h7]r‚"hD]rƒ"h<]r„"h:]r…"hF]r†"uhbMghd]r‡"hrXƒThe return value of mocked classes (the 'instance') has the same call signature as the class __init__ (as they share the same spec)rˆ"…r‰"}rŠ"(h4j€"hKj~"ubaubahYh›ubehYhubh£)r‹"}rŒ"(h4XDYou create auto-specced mocks by passing `autospec=True` to `patch`.r"hKjñ!hXhBhYh§h5}rŽ"(h7]r"hD]r"h<]r‘"h:]r’"hF]r“"uhbMjhd]r”"(hrX)You create auto-specced mocks by passing r•"…r–"}r—"(h4X)You create auto-specced mocks by passing r˜"hKj‹"ubh³)r™"}rš"(h4X`autospec=True`r›"h5}rœ"(h7]r"hD]rž"h<]rŸ"h:]r "hF]r¡"uhKj‹"hd]r¢"hrX autospec=Truer£"…r¤"}r¥"(h4UhKj™"ubahYhÁubhrX to r¦"…r§"}r¨"(h4X to r©"hKj‹"ubh³)rª"}r«"(h4X`patch`r¬"h5}r­"(h7]r®"hD]r¯"h<]r°"h:]r±"hF]r²"uhKj‹"hd]r³"hrXpatchr´"…rµ"}r¶"(h4UhKjª"ubahYhÁubhrX.…r·"}r¸"(h4X.hKj‹"ubeubh£)r¹"}rº"(h4X Note that attributes that are None are special cased and mocked without a spec (so any attribute / method can be used). This is because None is typically used as a default value for attributes that may be of some other type, and as we don't know what type that may be we allow all access.r»"hKjñ!hXhBhYh§h5}r¼"(h7]r½"hD]r¾"h<]r¿"h:]rÀ"hF]rÁ"uhbMlhd]rÂ"hrX Note that attributes that are None are special cased and mocked without a spec (so any attribute / method can be used). This is because None is typically used as a default value for attributes that may be of some other type, and as we don't know what type that may be we allow all access.rÃ"…rÄ"}rÅ"(h4j»"hKj¹"ubaubh£)rÆ"}rÇ"(h4XPNote that the `autospec` option to `patch` obsoletes the `mocksignature` option.rÈ"hKjñ!hXhBhYh§h5}rÉ"(h7]rÊ"hD]rË"h<]rÌ"h:]rÍ"hF]rÎ"uhbMqhd]rÏ"(hrXNote that the rÐ"…rÑ"}rÒ"(h4XNote that the rÓ"hKjÆ"ubh³)rÔ"}rÕ"(h4X `autospec`rÖ"h5}r×"(h7]rØ"hD]rÙ"h<]rÚ"h:]rÛ"hF]rÜ"uhKjÆ"hd]rÝ"hrXautospecrÞ"…rß"}rà"(h4UhKjÔ"ubahYhÁubhrX option to rá"…râ"}rã"(h4X option to rä"hKjÆ"ubh³)rå"}ræ"(h4X`patch`rç"h5}rè"(h7]ré"hD]rê"h<]rë"h:]rì"hF]rí"uhKjÆ"hd]rî"hrXpatchrï"…rð"}rñ"(h4UhKjå"ubahYhÁubhrX obsoletes the rò"…ró"}rô"(h4X obsoletes the rõ"hKjÆ"ubh³)rö"}r÷"(h4X`mocksignature`rø"h5}rù"(h7]rú"hD]rû"h<]rü"h:]rý"hF]rþ"uhKjÆ"hd]rÿ"hrX mocksignaturer#…r#}r#(h4UhKjö"ubahYhÁubhrX option.r#…r#}r#(h4X option.r#hKjÆ"ubeubeubhL)r#}r#(h4XOAdded the `create_autospec` function for manually creating 'auto-specced' mocksr #hKj9hXhBhYh›h5}r #(h7]r #hD]r #h<]r #h:]r#hF]r#uhbNhchhd]r#h£)r#}r#(h4XOAdded the `create_autospec` function for manually creating 'auto-specced' mocksr#hKj#hXhBhYh§h5}r#(h7]r#hD]r#h<]r#h:]r#hF]r#uhbMthd]r#(hrX Added the r#…r#}r#(h4X Added the r#hKj#ubh³)r#}r #(h4X`create_autospec`r!#h5}r"#(h7]r##hD]r$#h<]r%#h:]r&#hF]r'#uhKj#hd]r(#hrXcreate_autospecr)#…r*#}r+#(h4UhKj#ubahYhÁubhrX4 function for manually creating 'auto-specced' mocksr,#…r-#}r.#(h4X4 function for manually creating 'auto-specced' mocksr/#hKj#ubeubaubhL)r0#}r1#(h4X&Removal of deprecated `patch_object` r2#hKj9hXhBhYh›h5}r3#(h7]r4#hD]r5#h<]r6#h:]r7#hF]r8#uhbNhchhd]r9#h£)r:#}r;#(h4X$Removal of deprecated `patch_object`r<#hKj0#hXhBhYh§h5}r=#(h7]r>#hD]r?#h<]r@#h:]rA#hF]rB#uhbMvhd]rC#(hrXRemoval of deprecated rD#…rE#}rF#(h4XRemoval of deprecated rG#hKj:#ubh³)rH#}rI#(h4X`patch_object`rJ#h5}rK#(h7]rL#hD]rM#h<]rN#h:]rO#hF]rP#uhKj:#hd]rQ#hrX patch_objectrR#…rS#}rT#(h4UhKjH#ubahYhÁubeubaubeubeubhS)rU#}rV#(h4UhKhVhXhBhYhZh5}rW#(h7]rX#hD]rY#h<]rZ#h:]r[#U version-0-7-2r\#ahF]r]#h auhbMzhchhd]r^#(hf)r_#}r`#(h4X2011/05/30 Version 0.7.2ra#hKjU#hXhBhYhjh5}rb#(h7]rc#hD]rd#h<]re#h:]rf#hF]rg#uhbMzhchhd]rh#hrX2011/05/30 Version 0.7.2ri#…rj#}rk#(h4ja#hKj_#ubaubhP)rl#}rm#(h4UhKjU#hXhBhYhh5}rn#(h‘X*h:]ro#h<]rp#h7]rq#hD]rr#hF]rs#uhbM|hchhd]rt#(hL)ru#}rv#(h4XBBUGFIX: instances of list subclasses can now be used as mock specsrw#hKjl#hXhBhYh›h5}rx#(h7]ry#hD]rz#h<]r{#h:]r|#hF]r}#uhbNhchhd]r~#h£)r#}r€#(h4jw#hKju#hXhBhYh§h5}r#(h7]r‚#hD]rƒ#h<]r„#h:]r…#hF]r†#uhbM|hd]r‡#hrXBBUGFIX: instances of list subclasses can now be used as mock specsrˆ#…r‰#}rŠ#(h4jw#hKj#ubaubaubhL)r‹#}rŒ#(h4X»BUGFIX: MagicMock equality / inequality protocol methods changed to use the default equality / inequality. This is done through a `side_effect` on the mocks used for `__eq__` / `__ne__` r#hKjl#hXhBhYh›h5}rŽ#(h7]r#hD]r#h<]r‘#h:]r’#hF]r“#uhbNhchhd]r”#h£)r•#}r–#(h4X¹BUGFIX: MagicMock equality / inequality protocol methods changed to use the default equality / inequality. This is done through a `side_effect` on the mocks used for `__eq__` / `__ne__`r—#hKj‹#hXhBhYh§h5}r˜#(h7]r™#hD]rš#h<]r›#h:]rœ#hF]r#uhbM}hd]rž#(hrX‚BUGFIX: MagicMock equality / inequality protocol methods changed to use the default equality / inequality. This is done through a rŸ#…r #}r¡#(h4X‚BUGFIX: MagicMock equality / inequality protocol methods changed to use the default equality / inequality. This is done through a r¢#hKj•#ubh³)r£#}r¤#(h4X `side_effect`r¥#h5}r¦#(h7]r§#hD]r¨#h<]r©#h:]rª#hF]r«#uhKj•#hd]r¬#hrX side_effectr­#…r®#}r¯#(h4UhKj£#ubahYhÁubhrX on the mocks used for r°#…r±#}r²#(h4X on the mocks used for r³#hKj•#ubh³)r´#}rµ#(h4X`__eq__`r¶#h5}r·#(h7]r¸#hD]r¹#h<]rº#h:]r»#hF]r¼#uhKj•#hd]r½#hrX__eq__r¾#…r¿#}rÀ#(h4UhKj´#ubahYhÁubhrX / rÁ#…rÂ#}rÃ#(h4X / rÄ#hKj•#ubh³)rÅ#}rÆ#(h4X`__ne__`rÇ#h5}rÈ#(h7]rÉ#hD]rÊ#h<]rË#h:]rÌ#hF]rÍ#uhKj•#hd]rÎ#hrX__ne__rÏ#…rÐ#}rÑ#(h4UhKjÅ#ubahYhÁubeubaubeubeubhS)rÒ#}rÓ#(h4UhKhVhXhBhYhZh5}rÔ#(h7]rÕ#hD]rÖ#h<]r×#h:]rØ#U version-0-7-1rÙ#ahF]rÚ#h auhbMƒhchhd]rÛ#(hf)rÜ#}rÝ#(h4X2011/05/06 Version 0.7.1rÞ#hKjÒ#hXhBhYhjh5}rß#(h7]rà#hD]rá#h<]râ#h:]rã#hF]rä#uhbMƒhchhd]rå#hrX2011/05/06 Version 0.7.1ræ#…rç#}rè#(h4jÞ#hKjÜ#ubaubh£)ré#}rê#(h4XAPackage fixes contributed by Michael Fladischer. No code changes.rë#hKjÒ#hXhBhYh§h5}rì#(h7]rí#hD]rî#h<]rï#h:]rð#hF]rñ#uhbM…hchhd]rò#hrXAPackage fixes contributed by Michael Fladischer. No code changes.ró#…rô#}rõ#(h4jë#hKjé#ubaubhP)rö#}r÷#(h4UhKjÒ#hXhBhYhh5}rø#(h‘X*h:]rù#h<]rú#h7]rû#hD]rü#hF]rý#uhbM‡hchhd]rþ#(hL)rÿ#}r$(h4XInclude template in packager$hKjö#hXhBhYh›h5}r$(h7]r$hD]r$h<]r$h:]r$hF]r$uhbNhchhd]r$h£)r $}r $(h4j$hKjÿ#hXhBhYh§h5}r $(h7]r $hD]r $h<]r$h:]r$hF]r$uhbM‡hd]r$hrXInclude template in packager$…r$}r$(h4j$hKj $ubaubaubhL)r$}r$(h4X'Use isolated binaries for the tox testsr$hKjö#hXhBhYh›h5}r$(h7]r$hD]r$h<]r$h:]r$hF]r$uhbNhchhd]r$h£)r$}r $(h4j$hKj$hXhBhYh§h5}r!$(h7]r"$hD]r#$h<]r$$h:]r%$hF]r&$uhbMˆhd]r'$hrX'Use isolated binaries for the tox testsr($…r)$}r*$(h4j$hKj$ubaubaubhL)r+$}r,$(h4XUnset executable bit on docsr-$hKjö#hXhBhYh›h5}r.$(h7]r/$hD]r0$h<]r1$h:]r2$hF]r3$uhbNhchhd]r4$h£)r5$}r6$(h4j-$hKj+$hXhBhYh§h5}r7$(h7]r8$hD]r9$h<]r:$h:]r;$hF]r<$uhbM‰hd]r=$hrXUnset executable bit on docsr>$…r?$}r@$(h4j-$hKj5$ubaubaubhL)rA$}rB$(h4X-Fix DOS line endings in getting-started.txt rC$hKjö#hXhBhYh›h5}rD$(h7]rE$hD]rF$h<]rG$h:]rH$hF]rI$uhbNhchhd]rJ$h£)rK$}rL$(h4X+Fix DOS line endings in getting-started.txtrM$hKjA$hXhBhYh§h5}rN$(h7]rO$hD]rP$h<]rQ$h:]rR$hF]rS$uhbMŠhd]rT$hrX+Fix DOS line endings in getting-started.txtrU$…rV$}rW$(h4jM$hKjK$ubaubaubeubeubhS)rX$}rY$(h4UhKhVhXhBhYhZh5}rZ$(h7]r[$hD]r\$h<]r]$h:]r^$U version-0-7-0r_$ahF]r`$hauhbMŽhchhd]ra$(hf)rb$}rc$(h4X2011/03/05 Version 0.7.0rd$hKjX$hXhBhYhjh5}re$(h7]rf$hD]rg$h<]rh$h:]ri$hF]rj$uhbMŽhchhd]rk$hrX2011/03/05 Version 0.7.0rl$…rm$}rn$(h4jd$hKjb$ubaubh£)ro$}rp$(h4X‰No API changes since 0.7.0 rc1. Many documentation changes including a stylish new `Sphinx theme `_.rq$hKjX$hXhBhYh§h5}rr$(h7]rs$hD]rt$h<]ru$h:]rv$hF]rw$uhbMhchhd]rx$(hrXSNo API changes since 0.7.0 rc1. Many documentation changes including a stylish new ry$…rz$}r{$(h4XSNo API changes since 0.7.0 rc1. Many documentation changes including a stylish new r|$hKjo$ubj=)r}$}r~$(h4X5`Sphinx theme `_r$h5}r€$(Unamer$X Sphinx themer‚$jDX#https://github.com/coordt/ADCtheme/rƒ$h:]r„$h<]r…$h7]r†$hD]r‡$hF]rˆ$uhKjo$hd]r‰$hrX Sphinx themerŠ$…r‹$}rŒ$(h4UhKj}$ubahYjOubjP)r$}rŽ$(h4X& r$jTKhKjo$hYjUh5}r$(Urefurir‘$jƒ$h:]r’$U sphinx-themer“$ah<]r”$h7]r•$hD]r–$hF]r—$hauhd]r˜$ubhrX.…r™$}rš$(h4X.hKjo$ubeubh£)r›$}rœ$(h4X(The full set of changes since 0.6.0 are:r$hKjX$hXhBhYh§h5}rž$(h7]rŸ$hD]r $h<]r¡$h:]r¢$hF]r£$uhbM“hchhd]r¤$hrX(The full set of changes since 0.6.0 are:r¥$…r¦$}r§$(h4j$hKj›$ubaubhP)r¨$}r©$(h4UhKjX$hXhBhYhh5}rª$(h‘X*h:]r«$h<]r¬$h7]r­$hD]r®$hF]r¯$uhbM•hchhd]r°$(hL)r±$}r²$(h4XPython 3 compatibilityr³$hKj¨$hXhBhYh›h5}r´$(h7]rµ$hD]r¶$h<]r·$h:]r¸$hF]r¹$uhbNhchhd]rº$h£)r»$}r¼$(h4j³$hKj±$hXhBhYh§h5}r½$(h7]r¾$hD]r¿$h<]rÀ$h:]rÁ$hF]rÂ$uhbM•hd]rÃ$hrXPython 3 compatibilityrÄ$…rÅ$}rÆ$(h4j³$hKj»$ubaubaubhL)rÇ$}rÈ$(h4XdAbility to mock magic methods with `Mock` and addition of `MagicMock` with pre-created magic methodsrÉ$hKj¨$hXhBhYh›h5}rÊ$(h7]rË$hD]rÌ$h<]rÍ$h:]rÎ$hF]rÏ$uhbNhchhd]rÐ$h£)rÑ$}rÒ$(h4XdAbility to mock magic methods with `Mock` and addition of `MagicMock` with pre-created magic methodsrÓ$hKjÇ$hXhBhYh§h5}rÔ$(h7]rÕ$hD]rÖ$h<]r×$h:]rØ$hF]rÙ$uhbM–hd]rÚ$(hrX#Ability to mock magic methods with rÛ$…rÜ$}rÝ$(h4X#Ability to mock magic methods with rÞ$hKjÑ$ubh³)rß$}rà$(h4X`Mock`rá$h5}râ$(h7]rã$hD]rä$h<]rå$h:]ræ$hF]rç$uhKjÑ$hd]rè$hrXMockré$…rê$}rë$(h4UhKjß$ubahYhÁubhrX and addition of rì$…rí$}rî$(h4X and addition of rï$hKjÑ$ubh³)rð$}rñ$(h4X `MagicMock`rò$h5}ró$(h7]rô$hD]rõ$h<]rö$h:]r÷$hF]rø$uhKjÑ$hd]rù$hrX MagicMockrú$…rû$}rü$(h4UhKjð$ubahYhÁubhrX with pre-created magic methodsrý$…rþ$}rÿ$(h4X with pre-created magic methodsr%hKjÑ$ubeubaubhL)r%}r%(h4XVAddition of `mocksignature` and `mocksignature` argument to `patch` and `patch.object`r%hKj¨$hXhBhYh›h5}r%(h7]r%hD]r%h<]r%h:]r%hF]r %uhbNhchhd]r %h£)r %}r %(h4XVAddition of `mocksignature` and `mocksignature` argument to `patch` and `patch.object`r %hKj%hXhBhYh§h5}r%(h7]r%hD]r%h<]r%h:]r%hF]r%uhbM˜hd]r%(hrX Addition of r%…r%}r%(h4X Addition of r%hKj %ubh³)r%}r%(h4X`mocksignature`r%h5}r%(h7]r%hD]r%h<]r%h:]r %hF]r!%uhKj %hd]r"%hrX mocksignaturer#%…r$%}r%%(h4UhKj%ubahYhÁubhrX and r&%…r'%}r(%(h4X and r)%hKj %ubh³)r*%}r+%(h4X`mocksignature`r,%h5}r-%(h7]r.%hD]r/%h<]r0%h:]r1%hF]r2%uhKj %hd]r3%hrX mocksignaturer4%…r5%}r6%(h4UhKj*%ubahYhÁubhrX argument to r7%…r8%}r9%(h4X argument to r:%hKj %ubh³)r;%}r<%(h4X`patch`r=%h5}r>%(h7]r?%hD]r@%h<]rA%h:]rB%hF]rC%uhKj %hd]rD%hrXpatchrE%…rF%}rG%(h4UhKj;%ubahYhÁubhrX and rH%…rI%}rJ%(h4X and rK%hKj %ubh³)rL%}rM%(h4X`patch.object`rN%h5}rO%(h7]rP%hD]rQ%h<]rR%h:]rS%hF]rT%uhKj %hd]rU%hrX patch.objectrV%…rW%}rX%(h4UhKjL%ubahYhÁubeubaubhL)rY%}rZ%(h4X@Addition of `patch.dict` for changing dictionaries during a testr[%hKj¨$hXhBhYh›h5}r\%(h7]r]%hD]r^%h<]r_%h:]r`%hF]ra%uhbNhchhd]rb%h£)rc%}rd%(h4j[%hKjY%hXhBhYh§h5}re%(h7]rf%hD]rg%h<]rh%h:]ri%hF]rj%uhbMšhd]rk%(hrX Addition of rl%…rm%}rn%(h4X Addition of ro%hKjc%ubh³)rp%}rq%(h4X `patch.dict`rr%h5}rs%(h7]rt%hD]ru%h<]rv%h:]rw%hF]rx%uhKjc%hd]ry%hrX patch.dictrz%…r{%}r|%(h4UhKjp%ubahYhÁubhrX( for changing dictionaries during a testr}%…r~%}r%(h4X( for changing dictionaries during a testr€%hKjc%ubeubaubhL)r%}r‚%(h4XKAbility to use `patch`, `patch.object` and `patch.dict` as class decoratorsrƒ%hKj¨$hXhBhYh›h5}r„%(h7]r…%hD]r†%h<]r‡%h:]rˆ%hF]r‰%uhbNhchhd]rŠ%h£)r‹%}rŒ%(h4jƒ%hKj%hXhBhYh§h5}r%(h7]rŽ%hD]r%h<]r%h:]r‘%hF]r’%uhbM›hd]r“%(hrXAbility to use r”%…r•%}r–%(h4XAbility to use r—%hKj‹%ubh³)r˜%}r™%(h4X`patch`rš%h5}r›%(h7]rœ%hD]r%h<]rž%h:]rŸ%hF]r %uhKj‹%hd]r¡%hrXpatchr¢%…r£%}r¤%(h4UhKj˜%ubahYhÁubhrX, r¥%…r¦%}r§%(h4X, r¨%hKj‹%ubh³)r©%}rª%(h4X`patch.object`r«%h5}r¬%(h7]r­%hD]r®%h<]r¯%h:]r°%hF]r±%uhKj‹%hd]r²%hrX patch.objectr³%…r´%}rµ%(h4UhKj©%ubahYhÁubhrX and r¶%…r·%}r¸%(h4X and r¹%hKj‹%ubh³)rº%}r»%(h4X `patch.dict`r¼%h5}r½%(h7]r¾%hD]r¿%h<]rÀ%h:]rÁ%hF]rÂ%uhKj‹%hd]rÃ%hrX patch.dictrÄ%…rÅ%}rÆ%(h4UhKjº%ubahYhÁubhrX as class decoratorsrÇ%…rÈ%}rÉ%(h4X as class decoratorsrÊ%hKj‹%ubeubaubhL)rË%}rÌ%(h4XKRenamed ``patch_object`` to `patch.object` (``patch_object`` is deprecated)rÍ%hKj¨$hXhBhYh›h5}rÎ%(h7]rÏ%hD]rÐ%h<]rÑ%h:]rÒ%hF]rÓ%uhbNhchhd]rÔ%h£)rÕ%}rÖ%(h4XKRenamed ``patch_object`` to `patch.object` (``patch_object`` is deprecated)r×%hKjË%hXhBhYh§h5}rØ%(h7]rÙ%hD]rÚ%h<]rÛ%h:]rÜ%hF]rÝ%uhbMœhd]rÞ%(hrXRenamed rß%…rà%}rá%(h4XRenamed râ%hKjÕ%ubjå )rã%}rä%(h4X``patch_object``rå%h5}ræ%(h7]rç%hD]rè%h<]ré%h:]rê%hF]rë%uhKjÕ%hd]rì%hrX patch_objectrí%…rî%}rï%(h4UhKjã%ubahYjô ubhrX to rð%…rñ%}rò%(h4X to ró%hKjÕ%ubh³)rô%}rõ%(h4X`patch.object`rö%h5}r÷%(h7]rø%hD]rù%h<]rú%h:]rû%hF]rü%uhKjÕ%hd]rý%hrX patch.objectrþ%…rÿ%}r&(h4UhKjô%ubahYhÁubhrX (r&…r&}r&(h4X (r&hKjÕ%ubjå )r&}r&(h4X``patch_object``r&h5}r&(h7]r &hD]r &h<]r &h:]r &hF]r &uhKjÕ%hd]r&hrX patch_objectr&…r&}r&(h4UhKj&ubahYjô ubhrX is deprecated)r&…r&}r&(h4X is deprecated)r&hKjÕ%ubeubaubhL)r&}r&(h4X«Addition of soft comparisons: `call_args`, `call_args_list` and `method_calls` now return tuple-like objects which compare equal even when empty args or kwargs are skippedr&hKj¨$hXhBhYh›h5}r&(h7]r&hD]r&h<]r&h:]r&hF]r&uhbNhchhd]r&h£)r &}r!&(h4X«Addition of soft comparisons: `call_args`, `call_args_list` and `method_calls` now return tuple-like objects which compare equal even when empty args or kwargs are skippedr"&hKj&hXhBhYh§h5}r#&(h7]r$&hD]r%&h<]r&&h:]r'&hF]r(&uhbMžhd]r)&(hrXAddition of soft comparisons: r*&…r+&}r,&(h4XAddition of soft comparisons: r-&hKj &ubh³)r.&}r/&(h4X `call_args`r0&h5}r1&(h7]r2&hD]r3&h<]r4&h:]r5&hF]r6&uhKj &hd]r7&hrX call_argsr8&…r9&}r:&(h4UhKj.&ubahYhÁubhrX, r;&…r<&}r=&(h4X, r>&hKj &ubh³)r?&}r@&(h4X`call_args_list`rA&h5}rB&(h7]rC&hD]rD&h<]rE&h:]rF&hF]rG&uhKj &hd]rH&hrXcall_args_listrI&…rJ&}rK&(h4UhKj?&ubahYhÁubhrX and rL&…rM&}rN&(h4X and rO&hKj &ubh³)rP&}rQ&(h4X`method_calls`rR&h5}rS&(h7]rT&hD]rU&h<]rV&h:]rW&hF]rX&uhKj &hd]rY&hrX method_callsrZ&…r[&}r\&(h4UhKjP&ubahYhÁubhrX] now return tuple-like objects which compare equal even when empty args or kwargs are skippedr]&…r^&}r_&(h4X] now return tuple-like objects which compare equal even when empty args or kwargs are skippedr`&hKj &ubeubaubhL)ra&}rb&(h4XOpatchers (`patch`, `patch.object` and `patch.dict`) have start and stop methodsrc&hKj¨$hXhBhYh›h5}rd&(h7]re&hD]rf&h<]rg&h:]rh&hF]ri&uhbNhchhd]rj&h£)rk&}rl&(h4XOpatchers (`patch`, `patch.object` and `patch.dict`) have start and stop methodsrm&hKja&hXhBhYh§h5}rn&(h7]ro&hD]rp&h<]rq&h:]rr&hF]rs&uhbM¡hd]rt&(hrX patchers (ru&…rv&}rw&(h4X patchers (rx&hKjk&ubh³)ry&}rz&(h4X`patch`r{&h5}r|&(h7]r}&hD]r~&h<]r&h:]r€&hF]r&uhKjk&hd]r‚&hrXpatchrƒ&…r„&}r…&(h4UhKjy&ubahYhÁubhrX, r†&…r‡&}rˆ&(h4X, r‰&hKjk&ubh³)rŠ&}r‹&(h4X`patch.object`rŒ&h5}r&(h7]rŽ&hD]r&h<]r&h:]r‘&hF]r’&uhKjk&hd]r“&hrX patch.objectr”&…r•&}r–&(h4UhKjŠ&ubahYhÁubhrX and r—&…r˜&}r™&(h4X and rš&hKjk&ubh³)r›&}rœ&(h4X `patch.dict`r&h5}rž&(h7]rŸ&hD]r &h<]r¡&h:]r¢&hF]r£&uhKjk&hd]r¤&hrX patch.dictr¥&…r¦&}r§&(h4UhKj›&ubahYhÁubhrX) have start and stop methodsr¨&…r©&}rª&(h4X) have start and stop methodsr«&hKjk&ubeubaubhL)r¬&}r­&(h4X,Addition of `assert_called_once_with` methodr®&hKj¨$hXhBhYh›h5}r¯&(h7]r°&hD]r±&h<]r²&h:]r³&hF]r´&uhbNhchhd]rµ&h£)r¶&}r·&(h4j®&hKj¬&hXhBhYh§h5}r¸&(h7]r¹&hD]rº&h<]r»&h:]r¼&hF]r½&uhbM£hd]r¾&(hrX Addition of r¿&…rÀ&}rÁ&(h4X Addition of rÂ&hKj¶&ubh³)rÃ&}rÄ&(h4X`assert_called_once_with`rÅ&h5}rÆ&(h7]rÇ&hD]rÈ&h<]rÉ&h:]rÊ&hF]rË&uhKj¶&hd]rÌ&hrXassert_called_once_withrÍ&…rÎ&}rÏ&(h4UhKjÃ&ubahYhÁubhrX methodrÐ&…rÑ&}rÒ&(h4X methodrÓ&hKj¶&ubeubaubhL)rÔ&}rÕ&(h4XXMocks can now be named (`name` argument to constructor) and the name is used in the reprrÖ&hKj¨$hXhBhYh›h5}r×&(h7]rØ&hD]rÙ&h<]rÚ&h:]rÛ&hF]rÜ&uhbNhchhd]rÝ&h£)rÞ&}rß&(h4XXMocks can now be named (`name` argument to constructor) and the name is used in the reprrà&hKjÔ&hXhBhYh§h5}rá&(h7]râ&hD]rã&h<]rä&h:]rå&hF]ræ&uhbM¤hd]rç&(hrXMocks can now be named (rè&…ré&}rê&(h4XMocks can now be named (rë&hKjÞ&ubh³)rì&}rí&(h4X`name`rî&h5}rï&(h7]rð&hD]rñ&h<]rò&h:]ró&hF]rô&uhKjÞ&hd]rõ&hrXnamerö&…r÷&}rø&(h4UhKjì&ubahYhÁubhrX: argument to constructor) and the name is used in the reprrù&…rú&}rû&(h4X: argument to constructor) and the name is used in the reprrü&hKjÞ&ubeubaubhL)rý&}rþ&(h4X>repr of a mock with a spec includes the class name of the specrÿ&hKj¨$hXhBhYh›h5}r'(h7]r'hD]r'h<]r'h:]r'hF]r'uhbNhchhd]r'h£)r'}r'(h4jÿ&hKjý&hXhBhYh§h5}r '(h7]r 'hD]r 'h<]r 'h:]r 'hF]r'uhbM¦hd]r'hrX>repr of a mock with a spec includes the class name of the specr'…r'}r'(h4jÿ&hKj'ubaubaubhL)r'}r'(h4X,`assert_called_with` works with `python -OO`r'hKj¨$hXhBhYh›h5}r'(h7]r'hD]r'h<]r'h:]r'hF]r'uhbNhchhd]r'h£)r'}r'(h4j'hKj'hXhBhYh§h5}r'(h7]r 'hD]r!'h<]r"'h:]r#'hF]r$'uhbM§hd]r%'(h³)r&'}r''(h4X`assert_called_with`r('h5}r)'(h7]r*'hD]r+'h<]r,'h:]r-'hF]r.'uhKj'hd]r/'hrXassert_called_withr0'…r1'}r2'(h4UhKj&'ubahYhÁubhrX works with r3'…r4'}r5'(h4X works with r6'hKj'ubh³)r7'}r8'(h4X `python -OO`r9'h5}r:'(h7]r;'hD]r<'h<]r='h:]r>'hF]r?'uhKj'hd]r@'hrX python -OOrA'…rB'}rC'(h4UhKj7'ubahYhÁubeubaubhL)rD'}rE'(h4X™New `spec_set` keyword argument to `Mock` and `patch`. If used, attempting to *set* an attribute on a mock not on the spec will raise an `AttributeError`rF'hKj¨$hXhBhYh›h5}rG'(h7]rH'hD]rI'h<]rJ'h:]rK'hF]rL'uhbNhchhd]rM'h£)rN'}rO'(h4X™New `spec_set` keyword argument to `Mock` and `patch`. If used, attempting to *set* an attribute on a mock not on the spec will raise an `AttributeError`rP'hKjD'hXhBhYh§h5}rQ'(h7]rR'hD]rS'h<]rT'h:]rU'hF]rV'uhbM¨hd]rW'(hrXNew rX'…rY'}rZ'(h4XNew r['hKjN'ubh³)r\'}r]'(h4X `spec_set`r^'h5}r_'(h7]r`'hD]ra'h<]rb'h:]rc'hF]rd'uhKjN'hd]re'hrXspec_setrf'…rg'}rh'(h4UhKj\'ubahYhÁubhrX keyword argument to ri'…rj'}rk'(h4X keyword argument to rl'hKjN'ubh³)rm'}rn'(h4X`Mock`ro'h5}rp'(h7]rq'hD]rr'h<]rs'h:]rt'hF]ru'uhKjN'hd]rv'hrXMockrw'…rx'}ry'(h4UhKjm'ubahYhÁubhrX and rz'…r{'}r|'(h4X and r}'hKjN'ubh³)r~'}r'(h4X`patch`r€'h5}r'(h7]r‚'hD]rƒ'h<]r„'h:]r…'hF]r†'uhKjN'hd]r‡'hrXpatchrˆ'…r‰'}rŠ'(h4UhKj~'ubahYhÁubhrX. If used, attempting to r‹'…rŒ'}r'(h4X. If used, attempting to rŽ'hKjN'ubjd)r'}r'(h4X*set*r‘'h5}r’'(h7]r“'hD]r”'h<]r•'h:]r–'hF]r—'uhKjN'hd]r˜'hrXsetr™'…rš'}r›'(h4UhKj'ubahYjrubhrX6 an attribute on a mock not on the spec will raise an rœ'…r'}rž'(h4X6 an attribute on a mock not on the spec will raise an rŸ'hKjN'ubh³)r '}r¡'(h4X`AttributeError`r¢'h5}r£'(h7]r¤'hD]r¥'h<]r¦'h:]r§'hF]r¨'uhKjN'hd]r©'hrXAttributeErrorrª'…r«'}r¬'(h4UhKj 'ubahYhÁubeubaubhL)r­'}r®'(h4XdMocks created with a spec can now pass `isinstance` tests (`__class__` returns the type of the spec)r¯'hKj¨$hXhBhYh›h5}r°'(h7]r±'hD]r²'h<]r³'h:]r´'hF]rµ'uhbNhchhd]r¶'h£)r·'}r¸'(h4XdMocks created with a spec can now pass `isinstance` tests (`__class__` returns the type of the spec)r¹'hKj­'hXhBhYh§h5}rº'(h7]r»'hD]r¼'h<]r½'h:]r¾'hF]r¿'uhbM«hd]rÀ'(hrX'Mocks created with a spec can now pass rÁ'…rÂ'}rÃ'(h4X'Mocks created with a spec can now pass rÄ'hKj·'ubh³)rÅ'}rÆ'(h4X `isinstance`rÇ'h5}rÈ'(h7]rÉ'hD]rÊ'h<]rË'h:]rÌ'hF]rÍ'uhKj·'hd]rÎ'hrX isinstancerÏ'…rÐ'}rÑ'(h4UhKjÅ'ubahYhÁubhrX tests (rÒ'…rÓ'}rÔ'(h4X tests (rÕ'hKj·'ubh³)rÖ'}r×'(h4X `__class__`rØ'h5}rÙ'(h7]rÚ'hD]rÛ'h<]rÜ'h:]rÝ'hF]rÞ'uhKj·'hd]rß'hrX __class__rà'…rá'}râ'(h4UhKjÖ'ubahYhÁubhrX returns the type of the spec)rã'…rä'}rå'(h4X returns the type of the spec)ræ'hKj·'ubeubaubhL)rç'}rè'(h4XAdded docstrings to all objectsré'hKj¨$hXhBhYh›h5}rê'(h7]rë'hD]rì'h<]rí'h:]rî'hF]rï'uhbNhchhd]rð'h£)rñ'}rò'(h4jé'hKjç'hXhBhYh§h5}ró'(h7]rô'hD]rõ'h<]rö'h:]r÷'hF]rø'uhbM­hd]rù'hrXAdded docstrings to all objectsrú'…rû'}rü'(h4jé'hKjñ'ubaubaubhL)rý'}rþ'(h4X_Improved failure message for `Mock.assert_called_with` when the mock has not been called at allrÿ'hKj¨$hXhBhYh›h5}r((h7]r(hD]r(h<]r(h:]r(hF]r(uhbNhchhd]r(h£)r(}r((h4X_Improved failure message for `Mock.assert_called_with` when the mock has not been called at allr (hKjý'hXhBhYh§h5}r ((h7]r (hD]r (h<]r (h:]r(hF]r(uhbM®hd]r((hrXImproved failure message for r(…r(}r((h4XImproved failure message for r(hKj(ubh³)r(}r((h4X`Mock.assert_called_with`r(h5}r((h7]r(hD]r(h<]r(h:]r(hF]r(uhKj(hd]r(hrXMock.assert_called_withr(…r (}r!((h4UhKj(ubahYhÁubhrX) when the mock has not been called at allr"(…r#(}r$((h4X) when the mock has not been called at allr%(hKj(ubeubaubhL)r&(}r'((h4X\Decorated functions / methods have their docstring and `__module__` preserved on Python 2.4.r((hKj¨$hXhBhYh›h5}r)((h7]r*(hD]r+(h<]r,(h:]r-(hF]r.(uhbNhchhd]r/(h£)r0(}r1((h4X\Decorated functions / methods have their docstring and `__module__` preserved on Python 2.4.r2(hKj&(hXhBhYh§h5}r3((h7]r4(hD]r5(h<]r6(h:]r7(hF]r8(uhbM°hd]r9((hrX7Decorated functions / methods have their docstring and r:(…r;(}r<((h4X7Decorated functions / methods have their docstring and r=(hKj0(ubh³)r>(}r?((h4X `__module__`r@(h5}rA((h7]rB(hD]rC(h<]rD(h:]rE(hF]rF(uhKj0(hd]rG(hrX __module__rH(…rI(}rJ((h4UhKj>(ubahYhÁubhrX preserved on Python 2.4.rK(…rL(}rM((h4X preserved on Python 2.4.rN(hKj0(ubeubaubhL)rO(}rP((h4XƒBUGFIX: `mock.patch` now works correctly with certain types of objects that proxy attribute access, like the django settings objectrQ(hKj¨$hXhBhYh›h5}rR((h7]rS(hD]rT(h<]rU(h:]rV(hF]rW(uhbNhchhd]rX(h£)rY(}rZ((h4XƒBUGFIX: `mock.patch` now works correctly with certain types of objects that proxy attribute access, like the django settings objectr[(hKjO(hXhBhYh§h5}r\((h7]r](hD]r^(h<]r_(h:]r`(hF]ra(uhbM²hd]rb((hrXBUGFIX: rc(…rd(}re((h4XBUGFIX: rf(hKjY(ubh³)rg(}rh((h4X `mock.patch`ri(h5}rj((h7]rk(hD]rl(h<]rm(h:]rn(hF]ro(uhKjY(hd]rp(hrX mock.patchrq(…rr(}rs((h4UhKjg(ubahYhÁubhrXo now works correctly with certain types of objects that proxy attribute access, like the django settings objectrt(…ru(}rv((h4Xo now works correctly with certain types of objects that proxy attribute access, like the django settings objectrw(hKjY(ubeubaubhL)rx(}ry((h4X[BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this)rz(hKj¨$hXhBhYh›h5}r{((h7]r|(hD]r}(h<]r~(h:]r(hF]r€(uhbNhchhd]r(h£)r‚(}rƒ((h4X[BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this)r„(hKjx(hXhBhYh§h5}r…((h7]r†(hD]r‡(h<]rˆ(h:]r‰(hF]rŠ(uhbM´hd]r‹(hrX[BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this)rŒ(…r(}rŽ((h4j„(hKj‚(ubaubaubhL)r(}r((h4X0BUGFIX: `spec=True` works with old style classesr‘(hKj¨$hXhBhYh›h5}r’((h7]r“(hD]r”(h<]r•(h:]r–(hF]r—(uhbNhchhd]r˜(h£)r™(}rš((h4j‘(hKj(hXhBhYh§h5}r›((h7]rœ(hD]r(h<]rž(h:]rŸ(hF]r (uhbM¶hd]r¡((hrXBUGFIX: r¢(…r£(}r¤((h4XBUGFIX: r¥(hKj™(ubh³)r¦(}r§((h4X `spec=True`r¨(h5}r©((h7]rª(hD]r«(h<]r¬(h:]r­(hF]r®(uhKj™(hd]r¯(hrX spec=Truer°(…r±(}r²((h4UhKj¦(ubahYhÁubhrX works with old style classesr³(…r´(}rµ((h4X works with old style classesr¶(hKj™(ubeubaubhL)r·(}r¸((h4X§BUGFIX: ``help(mock)`` works now (on the module). Can no longer use ``__bases__`` as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this)r¹(hKj¨$hXhBhYh›h5}rº((h7]r»(hD]r¼(h<]r½(h:]r¾(hF]r¿(uhbNhchhd]rÀ(h£)rÁ(}rÂ((h4X§BUGFIX: ``help(mock)`` works now (on the module). Can no longer use ``__bases__`` as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this)rÃ(hKj·(hXhBhYh§h5}rÄ((h7]rÅ(hD]rÆ(h<]rÇ(h:]rÈ(hF]rÉ(uhbM·hd]rÊ((hrXBUGFIX: rË(…rÌ(}rÍ((h4XBUGFIX: rÎ(hKjÁ(ubjå )rÏ(}rÐ((h4X``help(mock)``rÑ(h5}rÒ((h7]rÓ(hD]rÔ(h<]rÕ(h:]rÖ(hF]r×(uhKjÁ(hd]rØ(hrX help(mock)rÙ(…rÚ(}rÛ((h4UhKjÏ(ubahYjô ubhrX. works now (on the module). Can no longer use rÜ(…rÝ(}rÞ((h4X. works now (on the module). Can no longer use rß(hKjÁ(ubjå )rà(}rá((h4X ``__bases__``râ(h5}rã((h7]rä(hD]rå(h<]ræ(h:]rç(hF]rè(uhKjÁ(hd]ré(hrX __bases__rê(…rë(}rì((h4UhKjà(ubahYjô ubhrXV as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this)rí(…rî(}rï((h4XV as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this)rð(hKjÁ(ubeubaubhL)rñ(}rò((h4X^BUGFIX: ``side_effect`` now works with ``BaseException`` exceptions like ``KeyboardInterrupt``ró(hKj¨$hXhBhYh›h5}rô((h7]rõ(hD]rö(h<]r÷(h:]rø(hF]rù(uhbNhchhd]rú(h£)rû(}rü((h4X^BUGFIX: ``side_effect`` now works with ``BaseException`` exceptions like ``KeyboardInterrupt``rý(hKjñ(hXhBhYh§h5}rþ((h7]rÿ(hD]r)h<]r)h:]r)hF]r)uhbMºhd]r)(hrXBUGFIX: r)…r)}r)(h4XBUGFIX: r)hKjû(ubjå )r )}r )(h4X``side_effect``r )h5}r )(h7]r )hD]r)h<]r)h:]r)hF]r)uhKjû(hd]r)hrX side_effectr)…r)}r)(h4UhKj )ubahYjô ubhrX now works with r)…r)}r)(h4X now works with r)hKjû(ubjå )r)}r)(h4X``BaseException``r)h5}r)(h7]r)hD]r)h<]r )h:]r!)hF]r")uhKjû(hd]r#)hrX BaseExceptionr$)…r%)}r&)(h4UhKj)ubahYjô ubhrX exceptions like r')…r()}r))(h4X exceptions like r*)hKjû(ubjå )r+)}r,)(h4X``KeyboardInterrupt``r-)h5}r.)(h7]r/)hD]r0)h<]r1)h:]r2)hF]r3)uhKjû(hd]r4)hrXKeyboardInterruptr5)…r6)}r7)(h4UhKj+)ubahYjô ubeubaubhL)r8)}r9)(h4XYBUGFIX: `reset_mock` caused infinite recursion when a mock is set as its own return valuer:)hKj¨$hXhBhYh›h5}r;)(h7]r<)hD]r=)h<]r>)h:]r?)hF]r@)uhbNhchhd]rA)h£)rB)}rC)(h4XYBUGFIX: `reset_mock` caused infinite recursion when a mock is set as its own return valuerD)hKj8)hXhBhYh§h5}rE)(h7]rF)hD]rG)h<]rH)h:]rI)hF]rJ)uhbM¼hd]rK)(hrXBUGFIX: rL)…rM)}rN)(h4XBUGFIX: rO)hKjB)ubh³)rP)}rQ)(h4X `reset_mock`rR)h5}rS)(h7]rT)hD]rU)h<]rV)h:]rW)hF]rX)uhKjB)hd]rY)hrX reset_mockrZ)…r[)}r\)(h4UhKjP)ubahYhÁubhrXE caused infinite recursion when a mock is set as its own return valuer])…r^)}r_)(h4XE caused infinite recursion when a mock is set as its own return valuer`)hKjB)ubeubaubhL)ra)}rb)(h4XIBUGFIX: patching the same object twice now restores the patches correctlyrc)hKj¨$hXhBhYh›h5}rd)(h7]re)hD]rf)h<]rg)h:]rh)hF]ri)uhbNhchhd]rj)h£)rk)}rl)(h4jc)hKja)hXhBhYh§h5}rm)(h7]rn)hD]ro)h<]rp)h:]rq)hF]rr)uhbM¾hd]rs)hrXIBUGFIX: patching the same object twice now restores the patches correctlyrt)…ru)}rv)(h4jc)hKjk)ubaubaubhL)rw)}rx)(h4X.with statement tests now skipped on Python 2.4ry)hKj¨$hXhBhYh›h5}rz)(h7]r{)hD]r|)h<]r})h:]r~)hF]r)uhbNhchhd]r€)h£)r)}r‚)(h4jy)hKjw)hXhBhYh§h5}rƒ)(h7]r„)hD]r…)h<]r†)h:]r‡)hF]rˆ)uhbM¿hd]r‰)hrX.with statement tests now skipped on Python 2.4rŠ)…r‹)}rŒ)(h4jy)hKj)ubaubaubhL)r)}rŽ)(h4X2Tests require unittest2 (or unittest2-py3k) to runr)hKj¨$hXhBhYh›h5}r)(h7]r‘)hD]r’)h<]r“)h:]r”)hF]r•)uhbNhchhd]r–)h£)r—)}r˜)(h4j)hKj)hXhBhYh§h5}r™)(h7]rš)hD]r›)h<]rœ)h:]r)hF]rž)uhbMÀhd]rŸ)hrX2Tests require unittest2 (or unittest2-py3k) to runr )…r¡)}r¢)(h4j)hKj—)ubaubaubhL)r£)}r¤)(h4XiTested with `tox `_ on Python 2.4 - 3.2, jython and pypy (excluding 3.0)r¥)hKj¨$hXhBhYh›h5}r¦)(h7]r§)hD]r¨)h<]r©)h:]rª)hF]r«)uhbNhchhd]r¬)h£)r­)}r®)(h4XiTested with `tox `_ on Python 2.4 - 3.2, jython and pypy (excluding 3.0)r¯)hKj£)hXhBhYh§h5}r°)(h7]r±)hD]r²)h<]r³)h:]r´)hF]rµ)uhbMÁhd]r¶)(hrX Tested with r·)…r¸)}r¹)(h4X Tested with rº)hKj­)ubj=)r»)}r¼)(h4X(`tox `_r½)h5}r¾)(Unamer¿)XtoxrÀ)jDXhttp://pypi.python.org/pypi/toxrÁ)h:]rÂ)h<]rÃ)h7]rÄ)hD]rÅ)hF]rÆ)uhKj­)hd]rÇ)hrXtoxrÈ)…rÉ)}rÊ)(h4UhKj»)ubahYjOubjP)rË)}rÌ)(h4X" rÍ)jTKhKj­)hYjUh5}rÎ)(UrefurirÏ)jÁ)h:]rÐ)UtoxrÑ)ah<]rÒ)h7]rÓ)hD]rÔ)hF]rÕ)h auhd]rÖ)ubhrX5 on Python 2.4 - 3.2, jython and pypy (excluding 3.0)r×)…rØ)}rÙ)(h4X5 on Python 2.4 - 3.2, jython and pypy (excluding 3.0)rÚ)hKj­)ubeubaubhL)rÛ)}rÜ)(h4XdAdded 'build_sphinx' command to setup.py (requires setuptools or distribute) Thanks to Florian BauerrÝ)hKj¨$hXhBhYh›h5}rÞ)(h7]rß)hD]rà)h<]rá)h:]râ)hF]rã)uhbNhchhd]rä)h£)rå)}ræ)(h4XdAdded 'build_sphinx' command to setup.py (requires setuptools or distribute) Thanks to Florian Bauerrç)hKjÛ)hXhBhYh§h5}rè)(h7]ré)hD]rê)h<]rë)h:]rì)hF]rí)uhbMÃhd]rî)hrXdAdded 'build_sphinx' command to setup.py (requires setuptools or distribute) Thanks to Florian Bauerrï)…rð)}rñ)(h4jç)hKjå)ubaubaubhL)rò)}ró)(h4X=Switched from subversion to mercurial for source code controlrô)hKj¨$hXhBhYh›h5}rõ)(h7]rö)hD]r÷)h<]rø)h:]rù)hF]rú)uhbNhchhd]rû)h£)rü)}rý)(h4jô)hKjò)hXhBhYh§h5}rþ)(h7]rÿ)hD]r*h<]r*h:]r*hF]r*uhbMÅhd]r*hrX=Switched from subversion to mercurial for source code controlr*…r*}r*(h4jô)hKjü)ubaubaubhL)r*}r *(h4XG`Konrad Delong `_ added as co-maintainer r *hKj¨$hXhBhYh›h5}r *(h7]r *hD]r *h<]r*h:]r*hF]r*uhbNhchhd]r*h£)r*}r*(h4XE`Konrad Delong `_ added as co-maintainerr*hKj*hXhBhYh§h5}r*(h7]r*hD]r*h<]r*h:]r*hF]r*uhbMÆhd]r*(j=)r*}r*(h4X.`Konrad Delong `_r*h5}r*(Unamer *X Konrad Delongr!*jDXhttp://konryd.blogspot.com/r"*h:]r#*h<]r$*h7]r%*hD]r&*hF]r'*uhKj*hd]r(*hrX Konrad Delongr)*…r**}r+*(h4UhKj*ubahYjOubjP)r,*}r-*(h4X r.*jTKhKj*hYjUh5}r/*(Urefurir0*j"*h:]r1*U konrad-delongr2*ah<]r3*h7]r4*hD]r5*hF]r6*h"auhd]r7*ubhrX added as co-maintainerr8*…r9*}r:*(h4X added as co-maintainerr;*hKj*ubeubaubeubeubhS)r<*}r=*(h4UhKhVhXhBhYhZh5}r>*(h7]r?*hD]r@*h<]rA*h:]rB*Uversion-0-7-0-rc-1rC*ahF]rD*hauhbMÊhchhd]rE*(hf)rF*}rG*(h4X2011/02/16 Version 0.7.0 RC 1rH*hKj<*hXhBhYhjh5}rI*(h7]rJ*hD]rK*h<]rL*h:]rM*hF]rN*uhbMÊhchhd]rO*hrX2011/02/16 Version 0.7.0 RC 1rP*…rQ*}rR*(h4jH*hKjF*ubaubh£)rS*}rT*(h4XChanges since beta 4:rU*hKj<*hXhBhYh§h5}rV*(h7]rW*hD]rX*h<]rY*h:]rZ*hF]r[*uhbMÌhchhd]r\*hrXChanges since beta 4:r]*…r^*}r_*(h4jU*hKjS*ubaubhP)r`*}ra*(h4UhKj<*hXhBhYhh5}rb*(h‘X*h:]rc*h<]rd*h7]re*hD]rf*hF]rg*uhbMÎhchhd]rh*(hL)ri*}rj*(h4X/Tested with jython, pypy and Python 3.2 and 3.1rk*hKj`*hXhBhYh›h5}rl*(h7]rm*hD]rn*h<]ro*h:]rp*hF]rq*uhbNhchhd]rr*h£)rs*}rt*(h4jk*hKji*hXhBhYh§h5}ru*(h7]rv*hD]rw*h<]rx*h:]ry*hF]rz*uhbMÎhd]r{*hrX/Tested with jython, pypy and Python 3.2 and 3.1r|*…r}*}r~*(h4jk*hKjs*ubaubaubhL)r*}r€*(h4X[Decorated functions / methods have their docstring and `__module__` preserved on Python 2.4r*hKj`*hXhBhYh›h5}r‚*(h7]rƒ*hD]r„*h<]r…*h:]r†*hF]r‡*uhbNhchhd]rˆ*h£)r‰*}rŠ*(h4X[Decorated functions / methods have their docstring and `__module__` preserved on Python 2.4r‹*hKj*hXhBhYh§h5}rŒ*(h7]r*hD]rŽ*h<]r*h:]r*hF]r‘*uhbMÏhd]r’*(hrX7Decorated functions / methods have their docstring and r“*…r”*}r•*(h4X7Decorated functions / methods have their docstring and r–*hKj‰*ubh³)r—*}r˜*(h4X `__module__`r™*h5}rš*(h7]r›*hD]rœ*h<]r*h:]rž*hF]rŸ*uhKj‰*hd]r *hrX __module__r¡*…r¢*}r£*(h4UhKj—*ubahYhÁubhrX preserved on Python 2.4r¤*…r¥*}r¦*(h4X preserved on Python 2.4r§*hKj‰*ubeubaubhL)r¨*}r©*(h4XƒBUGFIX: `mock.patch` now works correctly with certain types of objects that proxy attribute access, like the django settings objectrª*hKj`*hXhBhYh›h5}r«*(h7]r¬*hD]r­*h<]r®*h:]r¯*hF]r°*uhbNhchhd]r±*h£)r²*}r³*(h4XƒBUGFIX: `mock.patch` now works correctly with certain types of objects that proxy attribute access, like the django settings objectr´*hKj¨*hXhBhYh§h5}rµ*(h7]r¶*hD]r·*h<]r¸*h:]r¹*hF]rº*uhbMÑhd]r»*(hrXBUGFIX: r¼*…r½*}r¾*(h4XBUGFIX: r¿*hKj²*ubh³)rÀ*}rÁ*(h4X `mock.patch`rÂ*h5}rÃ*(h7]rÄ*hD]rÅ*h<]rÆ*h:]rÇ*hF]rÈ*uhKj²*hd]rÉ*hrX mock.patchrÊ*…rË*}rÌ*(h4UhKjÀ*ubahYhÁubhrXo now works correctly with certain types of objects that proxy attribute access, like the django settings objectrÍ*…rÎ*}rÏ*(h4Xo now works correctly with certain types of objects that proxy attribute access, like the django settings objectrÐ*hKj²*ubeubaubhL)rÑ*}rÒ*(h4X[BUGFIX: `reset_mock` caused infinite recursion when a mock is set as its own return value rÓ*hKj`*hXhBhYh›h5}rÔ*(h7]rÕ*hD]rÖ*h<]r×*h:]rØ*hF]rÙ*uhbNhchhd]rÚ*h£)rÛ*}rÜ*(h4XYBUGFIX: `reset_mock` caused infinite recursion when a mock is set as its own return valuerÝ*hKjÑ*hXhBhYh§h5}rÞ*(h7]rß*hD]rà*h<]rá*h:]râ*hF]rã*uhbMÓhd]rä*(hrXBUGFIX: rå*…ræ*}rç*(h4XBUGFIX: rè*hKjÛ*ubh³)ré*}rê*(h4X `reset_mock`rë*h5}rì*(h7]rí*hD]rî*h<]rï*h:]rð*hF]rñ*uhKjÛ*hd]rò*hrX reset_mockró*…rô*}rõ*(h4UhKjé*ubahYhÁubhrXE caused infinite recursion when a mock is set as its own return valuerö*…r÷*}rø*(h4XE caused infinite recursion when a mock is set as its own return valuerù*hKjÛ*ubeubaubeubeubhS)rú*}rû*(h4UhKhVhXhBhYhZh5}rü*(h7]rý*hD]rþ*h<]rÿ*h:]r+Uversion-0-7-0-beta-4r+ahF]r+hauhbMØhchhd]r+(hf)r+}r+(h4X2010/11/12 Version 0.7.0 beta 4r+hKjú*hXhBhYhjh5}r+(h7]r+hD]r +h<]r +h:]r +hF]r +uhbMØhchhd]r +hrX2010/11/12 Version 0.7.0 beta 4r+…r+}r+(h4j+hKj+ubaubhP)r+}r+(h4UhKjú*hXhBhYhh5}r+(h‘X*h:]r+h<]r+h7]r+hD]r+hF]r+uhbMÚhchhd]r+(hL)r+}r+(h4XOpatchers (`patch`, `patch.object` and `patch.dict`) have start and stop methodsr+hKj+hXhBhYh›h5}r+(h7]r+hD]r+h<]r +h:]r!+hF]r"+uhbNhchhd]r#+h£)r$+}r%+(h4XOpatchers (`patch`, `patch.object` and `patch.dict`) have start and stop methodsr&+hKj+hXhBhYh§h5}r'+(h7]r(+hD]r)+h<]r*+h:]r++hF]r,+uhbMÚhd]r-+(hrX patchers (r.+…r/+}r0+(h4X patchers (r1+hKj$+ubh³)r2+}r3+(h4X`patch`r4+h5}r5+(h7]r6+hD]r7+h<]r8+h:]r9+hF]r:+uhKj$+hd]r;+hrXpatchr<+…r=+}r>+(h4UhKj2+ubahYhÁubhrX, r?+…r@+}rA+(h4X, rB+hKj$+ubh³)rC+}rD+(h4X`patch.object`rE+h5}rF+(h7]rG+hD]rH+h<]rI+h:]rJ+hF]rK+uhKj$+hd]rL+hrX patch.objectrM+…rN+}rO+(h4UhKjC+ubahYhÁubhrX and rP+…rQ+}rR+(h4X and rS+hKj$+ubh³)rT+}rU+(h4X `patch.dict`rV+h5}rW+(h7]rX+hD]rY+h<]rZ+h:]r[+hF]r\+uhKj$+hd]r]+hrX patch.dictr^+…r_+}r`+(h4UhKjT+ubahYhÁubhrX) have start and stop methodsra+…rb+}rc+(h4X) have start and stop methodsrd+hKj$+ubeubaubhL)re+}rf+(h4X,Addition of `assert_called_once_with` methodrg+hKj+hXhBhYh›h5}rh+(h7]ri+hD]rj+h<]rk+h:]rl+hF]rm+uhbNhchhd]rn+h£)ro+}rp+(h4jg+hKje+hXhBhYh§h5}rq+(h7]rr+hD]rs+h<]rt+h:]ru+hF]rv+uhbMÜhd]rw+(hrX Addition of rx+…ry+}rz+(h4X Addition of r{+hKjo+ubh³)r|+}r}+(h4X`assert_called_once_with`r~+h5}r+(h7]r€+hD]r+h<]r‚+h:]rƒ+hF]r„+uhKjo+hd]r…+hrXassert_called_once_withr†+…r‡+}rˆ+(h4UhKj|+ubahYhÁubhrX methodr‰+…rŠ+}r‹+(h4X methodrŒ+hKjo+ubeubaubhL)r+}rŽ+(h4X>repr of a mock with a spec includes the class name of the specr+hKj+hXhBhYh›h5}r+(h7]r‘+hD]r’+h<]r“+h:]r”+hF]r•+uhbNhchhd]r–+h£)r—+}r˜+(h4j+hKj+hXhBhYh§h5}r™+(h7]rš+hD]r›+h<]rœ+h:]r+hF]rž+uhbMÝhd]rŸ+hrX>repr of a mock with a spec includes the class name of the specr +…r¡+}r¢+(h4j+hKj—+ubaubaubhL)r£+}r¤+(h4X,`assert_called_with` works with `python -OO`r¥+hKj+hXhBhYh›h5}r¦+(h7]r§+hD]r¨+h<]r©+h:]rª+hF]r«+uhbNhchhd]r¬+h£)r­+}r®+(h4j¥+hKj£+hXhBhYh§h5}r¯+(h7]r°+hD]r±+h<]r²+h:]r³+hF]r´+uhbMÞhd]rµ+(h³)r¶+}r·+(h4X`assert_called_with`r¸+h5}r¹+(h7]rº+hD]r»+h<]r¼+h:]r½+hF]r¾+uhKj­+hd]r¿+hrXassert_called_withrÀ+…rÁ+}rÂ+(h4UhKj¶+ubahYhÁubhrX works with rÃ+…rÄ+}rÅ+(h4X works with rÆ+hKj­+ubh³)rÇ+}rÈ+(h4X `python -OO`rÉ+h5}rÊ+(h7]rË+hD]rÌ+h<]rÍ+h:]rÎ+hF]rÏ+uhKj­+hd]rÐ+hrX python -OOrÑ+…rÒ+}rÓ+(h4UhKjÇ+ubahYhÁubeubaubhL)rÔ+}rÕ+(h4X™New `spec_set` keyword argument to `Mock` and `patch`. If used, attempting to *set* an attribute on a mock not on the spec will raise an `AttributeError`rÖ+hKj+hXhBhYh›h5}r×+(h7]rØ+hD]rÙ+h<]rÚ+h:]rÛ+hF]rÜ+uhbNhchhd]rÝ+h£)rÞ+}rß+(h4X™New `spec_set` keyword argument to `Mock` and `patch`. If used, attempting to *set* an attribute on a mock not on the spec will raise an `AttributeError`rà+hKjÔ+hXhBhYh§h5}rá+(h7]râ+hD]rã+h<]rä+h:]rå+hF]ræ+uhbMßhd]rç+(hrXNew rè+…ré+}rê+(h4XNew rë+hKjÞ+ubh³)rì+}rí+(h4X `spec_set`rî+h5}rï+(h7]rð+hD]rñ+h<]rò+h:]ró+hF]rô+uhKjÞ+hd]rõ+hrXspec_setrö+…r÷+}rø+(h4UhKjì+ubahYhÁubhrX keyword argument to rù+…rú+}rû+(h4X keyword argument to rü+hKjÞ+ubh³)rý+}rþ+(h4X`Mock`rÿ+h5}r,(h7]r,hD]r,h<]r,h:]r,hF]r,uhKjÞ+hd]r,hrXMockr,…r,}r ,(h4UhKjý+ubahYhÁubhrX and r ,…r ,}r ,(h4X and r ,hKjÞ+ubh³)r,}r,(h4X`patch`r,h5}r,(h7]r,hD]r,h<]r,h:]r,hF]r,uhKjÞ+hd]r,hrXpatchr,…r,}r,(h4UhKj,ubahYhÁubhrX. If used, attempting to r,…r,}r,(h4X. If used, attempting to r,hKjÞ+ubjd)r,}r ,(h4X*set*r!,h5}r",(h7]r#,hD]r$,h<]r%,h:]r&,hF]r',uhKjÞ+hd]r(,hrXsetr),…r*,}r+,(h4UhKj,ubahYjrubhrX6 an attribute on a mock not on the spec will raise an r,,…r-,}r.,(h4X6 an attribute on a mock not on the spec will raise an r/,hKjÞ+ubh³)r0,}r1,(h4X`AttributeError`r2,h5}r3,(h7]r4,hD]r5,h<]r6,h:]r7,hF]r8,uhKjÞ+hd]r9,hrXAttributeErrorr:,…r;,}r<,(h4UhKj0,ubahYhÁubeubaubhL)r=,}r>,(h4XDAttributes and return value of a `MagicMock` are `MagicMock` objectsr?,hKj+hXhBhYh›h5}r@,(h7]rA,hD]rB,h<]rC,h:]rD,hF]rE,uhbNhchhd]rF,h£)rG,}rH,(h4j?,hKj=,hXhBhYh§h5}rI,(h7]rJ,hD]rK,h<]rL,h:]rM,hF]rN,uhbMâhd]rO,(hrX!Attributes and return value of a rP,…rQ,}rR,(h4X!Attributes and return value of a rS,hKjG,ubh³)rT,}rU,(h4X `MagicMock`rV,h5}rW,(h7]rX,hD]rY,h<]rZ,h:]r[,hF]r\,uhKjG,hd]r],hrX MagicMockr^,…r_,}r`,(h4UhKjT,ubahYhÁubhrX are ra,…rb,}rc,(h4X are rd,hKjG,ubh³)re,}rf,(h4X `MagicMock`rg,h5}rh,(h7]ri,hD]rj,h<]rk,h:]rl,hF]rm,uhKjG,hd]rn,hrX MagicMockro,…rp,}rq,(h4UhKje,ubahYhÁubhrX objectsrr,…rs,}rt,(h4X objectsru,hKjG,ubeubaubhL)rv,}rw,(h4XLAttempting to set an unsupported magic method now raises an `AttributeError`rx,hKj+hXhBhYh›h5}ry,(h7]rz,hD]r{,h<]r|,h:]r},hF]r~,uhbNhchhd]r,h£)r€,}r,(h4jx,hKjv,hXhBhYh§h5}r‚,(h7]rƒ,hD]r„,h<]r…,h:]r†,hF]r‡,uhbMãhd]rˆ,(hrX<Attempting to set an unsupported magic method now raises an r‰,…rŠ,}r‹,(h4X<Attempting to set an unsupported magic method now raises an rŒ,hKj€,ubh³)r,}rŽ,(h4X`AttributeError`r,h5}r,(h7]r‘,hD]r’,h<]r“,h:]r”,hF]r•,uhKj€,hd]r–,hrXAttributeErrorr—,…r˜,}r™,(h4UhKj,ubahYhÁubeubaubhL)rš,}r›,(h4X'`patch.dict` works as a class decoratorrœ,hKj+hXhBhYh›h5}r,(h7]rž,hD]rŸ,h<]r ,h:]r¡,hF]r¢,uhbNhchhd]r£,h£)r¤,}r¥,(h4jœ,hKjš,hXhBhYh§h5}r¦,(h7]r§,hD]r¨,h<]r©,h:]rª,hF]r«,uhbMähd]r¬,(h³)r­,}r®,(h4X `patch.dict`r¯,h5}r°,(h7]r±,hD]r²,h<]r³,h:]r´,hF]rµ,uhKj¤,hd]r¶,hrX patch.dictr·,…r¸,}r¹,(h4UhKj­,ubahYhÁubhrX works as a class decoratorrº,…r»,}r¼,(h4X works as a class decoratorr½,hKj¤,ubeubaubhL)r¾,}r¿,(h4X=Switched from subversion to mercurial for source code controlrÀ,hKj+hXhBhYh›h5}rÁ,(h7]rÂ,hD]rÃ,h<]rÄ,h:]rÅ,hF]rÆ,uhbNhchhd]rÇ,h£)rÈ,}rÉ,(h4jÀ,hKj¾,hXhBhYh§h5}rÊ,(h7]rË,hD]rÌ,h<]rÍ,h:]rÎ,hF]rÏ,uhbMåhd]rÐ,hrX=Switched from subversion to mercurial for source code controlrÑ,…rÒ,}rÓ,(h4jÀ,hKjÈ,ubaubaubhL)rÔ,}rÕ,(h4X[BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this)rÖ,hKj+hXhBhYh›h5}r×,(h7]rØ,hD]rÙ,h<]rÚ,h:]rÛ,hF]rÜ,uhbNhchhd]rÝ,h£)rÞ,}rß,(h4X[BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this)rà,hKjÔ,hXhBhYh§h5}rá,(h7]râ,hD]rã,h<]rä,h:]rå,hF]ræ,uhbMæhd]rç,hrX[BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this)rè,…ré,}rê,(h4jà,hKjÞ,ubaubaubhL)rë,}rì,(h4X0BUGFIX: `spec=True` works with old style classesrí,hKj+hXhBhYh›h5}rî,(h7]rï,hD]rð,h<]rñ,h:]rò,hF]ró,uhbNhchhd]rô,h£)rõ,}rö,(h4jí,hKjë,hXhBhYh§h5}r÷,(h7]rø,hD]rù,h<]rú,h:]rû,hF]rü,uhbMèhd]rý,(hrXBUGFIX: rþ,…rÿ,}r-(h4XBUGFIX: r-hKjõ,ubh³)r-}r-(h4X `spec=True`r-h5}r-(h7]r-hD]r-h<]r-h:]r -hF]r -uhKjõ,hd]r -hrX spec=Truer -…r -}r-(h4UhKj-ubahYhÁubhrX works with old style classesr-…r-}r-(h4X works with old style classesr-hKjõ,ubeubaubhL)r-}r-(h4XPBUGFIX: `mocksignature=True` can now patch instance methods via `patch.object` r-hKj+hXhBhYh›h5}r-(h7]r-hD]r-h<]r-h:]r-hF]r-uhbNhchhd]r-h£)r-}r-(h4XNBUGFIX: `mocksignature=True` can now patch instance methods via `patch.object`r-hKj-hXhBhYh§h5}r -(h7]r!-hD]r"-h<]r#-h:]r$-hF]r%-uhbMéhd]r&-(hrXBUGFIX: r'-…r(-}r)-(h4XBUGFIX: r*-hKj-ubh³)r+-}r,-(h4X`mocksignature=True`r--h5}r.-(h7]r/-hD]r0-h<]r1-h:]r2-hF]r3-uhKj-hd]r4-hrXmocksignature=Truer5-…r6-}r7-(h4UhKj+-ubahYhÁubhrX$ can now patch instance methods via r8-…r9-}r:-(h4X$ can now patch instance methods via r;-hKj-ubh³)r<-}r=-(h4X`patch.object`r>-h5}r?-(h7]r@-hD]rA-h<]rB-h:]rC-hF]rD-uhKj-hd]rE-hrX patch.objectrF-…rG-}rH-(h4UhKj<-ubahYhÁubeubaubeubeubhS)rI-}rJ-(h4UhKhVhXhBhYhZh5}rK-(h7]rL-hD]rM-h<]rN-h:]rO-Uversion-0-7-0-beta-3rP-ahF]rQ-hauhbMîhchhd]rR-(hf)rS-}rT-(h4X2010/09/18 Version 0.7.0 beta 3rU-hKjI-hXhBhYhjh5}rV-(h7]rW-hD]rX-h<]rY-h:]rZ-hF]r[-uhbMîhchhd]r\-hrX2010/09/18 Version 0.7.0 beta 3r]-…r^-}r_-(h4jU-hKjS-ubaubhP)r`-}ra-(h4UhKjI-hXhBhYhh5}rb-(h‘X*h:]rc-h<]rd-h7]re-hD]rf-hF]rg-uhbMðhchhd]rh-(hL)ri-}rj-(h4XMUsing spec with :class:`MagicMock` only pre-creates magic methods in the specrk-hKj`-hXhBhYh›h5}rl-(h7]rm-hD]rn-h<]ro-h:]rp-hF]rq-uhbNhchhd]rr-h£)rs-}rt-(h4jk-hKji-hXhBhYh§h5}ru-(h7]rv-hD]rw-h<]rx-h:]ry-hF]rz-uhbMðhd]r{-(hrXUsing spec with r|-…r}-}r~-(h4XUsing spec with r-hKjs-ubjÌ )r€-}r-(h4X:class:`MagicMock`r‚-hKjs-hXhBhYjÐ h5}rƒ-(Ureftyper„-Xclassr…-jÔ ‰jÕ X MagicMockr†-U refdomainr‡-Xpyrˆ-h:]r‰-h<]rŠ-U refexplicitr‹-‰h7]rŒ-hD]r-hF]rŽ-jß jà já Njâ jã uhbMðhd]r-jå )r-}r‘-(h4j‚-h5}r’-(h7]r“-hD]r”-(jë jˆ-Xpy-classr•-eh<]r–-h:]r—-hF]r˜-uhKj€-hd]r™-hrX MagicMockrš-…r›-}rœ-(h4UhKj-ubahYjô ubaubhrX+ only pre-creates magic methods in the specr-…rž-}rŸ-(h4X+ only pre-creates magic methods in the specr -hKjs-ubeubaubhL)r¡-}r¢-(h4X]Setting a magic method on a mock with a ``spec`` can only be done if the spec has that methodr£-hKj`-hXhBhYh›h5}r¤-(h7]r¥-hD]r¦-h<]r§-h:]r¨-hF]r©-uhbNhchhd]rª-h£)r«-}r¬-(h4X]Setting a magic method on a mock with a ``spec`` can only be done if the spec has that methodr­-hKj¡-hXhBhYh§h5}r®-(h7]r¯-hD]r°-h<]r±-h:]r²-hF]r³-uhbMñhd]r´-(hrX(Setting a magic method on a mock with a rµ-…r¶-}r·-(h4X(Setting a magic method on a mock with a r¸-hKj«-ubjå )r¹-}rº-(h4X``spec``r»-h5}r¼-(h7]r½-hD]r¾-h<]r¿-h:]rÀ-hF]rÁ-uhKj«-hd]rÂ-hrXspecrÃ-…rÄ-}rÅ-(h4UhKj¹-ubahYjô ubhrX- can only be done if the spec has that methodrÆ-…rÇ-}rÈ-(h4X- can only be done if the spec has that methodrÉ-hKj«-ubeubaubhL)rÊ-}rË-(h4XXMocks can now be named (`name` argument to constructor) and the name is used in the reprrÌ-hKj`-hXhBhYh›h5}rÍ-(h7]rÎ-hD]rÏ-h<]rÐ-h:]rÑ-hF]rÒ-uhbNhchhd]rÓ-h£)rÔ-}rÕ-(h4XXMocks can now be named (`name` argument to constructor) and the name is used in the reprrÖ-hKjÊ-hXhBhYh§h5}r×-(h7]rØ-hD]rÙ-h<]rÚ-h:]rÛ-hF]rÜ-uhbMóhd]rÝ-(hrXMocks can now be named (rÞ-…rß-}rà-(h4XMocks can now be named (rá-hKjÔ-ubh³)râ-}rã-(h4X`name`rä-h5}rå-(h7]ræ-hD]rç-h<]rè-h:]ré-hF]rê-uhKjÔ-hd]rë-hrXnamerì-…rí-}rî-(h4UhKjâ-ubahYhÁubhrX: argument to constructor) and the name is used in the reprrï-…rð-}rñ-(h4X: argument to constructor) and the name is used in the reprrò-hKjÔ-ubeubaubhL)ró-}rô-(h4X`mocksignature` can now be used with classes (signature based on `__init__`) and callable objects (signature based on `__call__`)rõ-hKj`-hXhBhYh›h5}rö-(h7]r÷-hD]rø-h<]rù-h:]rú-hF]rû-uhbNhchhd]rü-h£)rý-}rþ-(h4X`mocksignature` can now be used with classes (signature based on `__init__`) and callable objects (signature based on `__call__`)rÿ-hKjó-hXhBhYh§h5}r.(h7]r.hD]r.h<]r.h:]r.hF]r.uhbMõhd]r.(h³)r.}r.(h4X`mocksignature`r .h5}r .(h7]r .hD]r .h<]r .h:]r.hF]r.uhKjý-hd]r.hrX mocksignaturer.…r.}r.(h4UhKj.ubahYhÁubhrX2 can now be used with classes (signature based on r.…r.}r.(h4X2 can now be used with classes (signature based on r.hKjý-ubh³)r.}r.(h4X `__init__`r.h5}r.(h7]r.hD]r.h<]r.h:]r.hF]r .uhKjý-hd]r!.hrX__init__r".…r#.}r$.(h4UhKj.ubahYhÁubhrX+) and callable objects (signature based on r%.…r&.}r'.(h4X+) and callable objects (signature based on r(.hKjý-ubh³)r).}r*.(h4X `__call__`r+.h5}r,.(h7]r-.hD]r..h<]r/.h:]r0.hF]r1.uhKjý-hd]r2.hrX__call__r3.…r4.}r5.(h4UhKj).ubahYhÁubhrX)…r6.}r7.(h4X)hKjý-ubeubaubhL)r8.}r9.(h4XdMocks created with a spec can now pass `isinstance` tests (`__class__` returns the type of the spec)r:.hKj`-hXhBhYh›h5}r;.(h7]r<.hD]r=.h<]r>.h:]r?.hF]r@.uhbNhchhd]rA.h£)rB.}rC.(h4XdMocks created with a spec can now pass `isinstance` tests (`__class__` returns the type of the spec)rD.hKj8.hXhBhYh§h5}rE.(h7]rF.hD]rG.h<]rH.h:]rI.hF]rJ.uhbM÷hd]rK.(hrX'Mocks created with a spec can now pass rL.…rM.}rN.(h4X'Mocks created with a spec can now pass rO.hKjB.ubh³)rP.}rQ.(h4X `isinstance`rR.h5}rS.(h7]rT.hD]rU.h<]rV.h:]rW.hF]rX.uhKjB.hd]rY.hrX isinstancerZ.…r[.}r\.(h4UhKjP.ubahYhÁubhrX tests (r].…r^.}r_.(h4X tests (r`.hKjB.ubh³)ra.}rb.(h4X `__class__`rc.h5}rd.(h7]re.hD]rf.h<]rg.h:]rh.hF]ri.uhKjB.hd]rj.hrX __class__rk.…rl.}rm.(h4UhKja.ubahYhÁubhrX returns the type of the spec)rn.…ro.}rp.(h4X returns the type of the spec)rq.hKjB.ubeubaubhL)rr.}rs.(h4XvDefault numeric value for MagicMock is 1 rather than zero (because the MagicMock bool defaults to True and 0 is False)rt.hKj`-hXhBhYh›h5}ru.(h7]rv.hD]rw.h<]rx.h:]ry.hF]rz.uhbNhchhd]r{.h£)r|.}r}.(h4XvDefault numeric value for MagicMock is 1 rather than zero (because the MagicMock bool defaults to True and 0 is False)r~.hKjr.hXhBhYh§h5}r.(h7]r€.hD]r.h<]r‚.h:]rƒ.hF]r„.uhbMùhd]r….hrXvDefault numeric value for MagicMock is 1 rather than zero (because the MagicMock bool defaults to True and 0 is False)r†.…r‡.}rˆ.(h4j~.hKj|.ubaubaubhL)r‰.}rŠ.(h4XfImproved failure message for :meth:`~Mock.assert_called_with` when the mock has not been called at allr‹.hKj`-hXhBhYh›h5}rŒ.(h7]r.hD]rŽ.h<]r.h:]r.hF]r‘.uhbNhchhd]r’.h£)r“.}r”.(h4XfImproved failure message for :meth:`~Mock.assert_called_with` when the mock has not been called at allr•.hKj‰.hXhBhYh§h5}r–.(h7]r—.hD]r˜.h<]r™.h:]rš.hF]r›.uhbMûhd]rœ.(hrXImproved failure message for r.…rž.}rŸ.(h4XImproved failure message for r .hKj“.ubjÌ )r¡.}r¢.(h4X :meth:`~Mock.assert_called_with`r£.hKj“.hXhBhYjÐ h5}r¤.(Ureftyper¥.Xmethr¦.jÔ ‰jÕ XMock.assert_called_withr§.U refdomainr¨.Xpyr©.h:]rª.h<]r«.U refexplicitr¬.‰h7]r­.hD]r®.hF]r¯.jß jà já Njâ jã uhbMûhd]r°.jå )r±.}r².(h4j£.h5}r³.(h7]r´.hD]rµ.(jë j©.Xpy-methr¶.eh<]r·.h:]r¸.hF]r¹.uhKj¡.hd]rº.hrXassert_called_with()r».…r¼.}r½.(h4UhKj±.ubahYjô ubaubhrX) when the mock has not been called at allr¾.…r¿.}rÀ.(h4X) when the mock has not been called at allrÁ.hKj“.ubeubaubhL)rÂ.}rÃ.(h4X¹Adding the following to the set of supported magic methods: - ``__getformat__`` and ``__setformat__`` - pickle methods - ``__trunc__``, ``__ceil__`` and ``__floor__`` - ``__sizeof__`` rÄ.hKj`-hXNhYh›h5}rÅ.(h7]rÆ.hD]rÇ.h<]rÈ.h:]rÉ.hF]rÊ.uhbNhchhd]rË.(h£)rÌ.}rÍ.(h4X;Adding the following to the set of supported magic methods:rÎ.hKjÂ.hXhBhYh§h5}rÏ.(h7]rÐ.hD]rÑ.h<]rÒ.h:]rÓ.hF]rÔ.uhbMýhd]rÕ.hrX;Adding the following to the set of supported magic methods:rÖ.…r×.}rØ.(h4jÎ.hKjÌ.ubaubhP)rÙ.}rÚ.(h4Uh5}rÛ.(h‘X-h:]rÜ.h<]rÝ.h7]rÞ.hD]rß.hF]rà.uhKjÂ.hd]rá.(hL)râ.}rã.(h4X'``__getformat__`` and ``__setformat__``rä.h5}rå.(h7]ræ.hD]rç.h<]rè.h:]ré.hF]rê.uhKjÙ.hd]rë.h£)rì.}rí.(h4jä.hKjâ.hXhBhYh§h5}rî.(h7]rï.hD]rð.h<]rñ.h:]rò.hF]ró.uhbMÿhd]rô.(jå )rõ.}rö.(h4X``__getformat__``r÷.h5}rø.(h7]rù.hD]rú.h<]rû.h:]rü.hF]rý.uhKjì.hd]rþ.hrX __getformat__rÿ.…r/}r/(h4UhKjõ.ubahYjô ubhrX and r/…r/}r/(h4X and r/hKjì.ubjå )r/}r/(h4X``__setformat__``r/h5}r /(h7]r /hD]r /h<]r /h:]r /hF]r/uhKjì.hd]r/hrX __setformat__r/…r/}r/(h4UhKj/ubahYjô ubeubahYh›ubhL)r/}r/(h4Xpickle methodsr/h5}r/(h7]r/hD]r/h<]r/h:]r/hF]r/uhKjÙ.hd]r/h£)r/}r/(h4j/hKj/hXhBhYh§h5}r/(h7]r /hD]r!/h<]r"/h:]r#/hF]r$/uhbMhd]r%/hrXpickle methodsr&/…r'/}r(/(h4j/hKj/ubaubahYh›ubhL)r)/}r*/(h4X-``__trunc__``, ``__ceil__`` and ``__floor__``r+/h5}r,/(h7]r-/hD]r./h<]r//h:]r0/hF]r1/uhKjÙ.hd]r2/h£)r3/}r4/(h4j+/hKj)/hXhBhYh§h5}r5/(h7]r6/hD]r7/h<]r8/h:]r9/hF]r:/uhbMhd]r;/(jå )r/h5}r?/(h7]r@/hD]rA/h<]rB/h:]rC/hF]rD/uhKj3/hd]rE/hrX __trunc__rF/…rG/}rH/(h4UhKj0h<]r?0h:]r@0hF]rA0uhbNhchhd]rB0h£)rC0}rD0(h4XŠ``patch.dict`` takes a string to specify dictionary as well as a dictionary object. If a string is supplied the name specified is importedrE0hKj90hXhBhYh§h5}rF0(h7]rG0hD]rH0h<]rI0h:]rJ0hF]rK0uhbMhd]rL0(jå )rM0}rN0(h4X``patch.dict``rO0h5}rP0(h7]rQ0hD]rR0h<]rS0h:]rT0hF]rU0uhKjC0hd]rV0hrX patch.dictrW0…rX0}rY0(h4UhKjM0ubahYjô ubhrX| takes a string to specify dictionary as well as a dictionary object. If a string is supplied the name specified is importedrZ0…r[0}r\0(h4X| takes a string to specify dictionary as well as a dictionary object. If a string is supplied the name specified is importedr]0hKjC0ubeubaubhL)r^0}r_0(h4XMBUGFIX: ``patch.dict`` restores dictionary even when an exception is raised r`0hKjü/hXhBhYh›h5}ra0(h7]rb0hD]rc0h<]rd0h:]re0hF]rf0uhbNhchhd]rg0h£)rh0}ri0(h4XKBUGFIX: ``patch.dict`` restores dictionary even when an exception is raisedrj0hKj^0hXhBhYh§h5}rk0(h7]rl0hD]rm0h<]rn0h:]ro0hF]rp0uhbMhd]rq0(hrXBUGFIX: rr0…rs0}rt0(h4XBUGFIX: ru0hKjh0ubjå )rv0}rw0(h4X``patch.dict``rx0h5}ry0(h7]rz0hD]r{0h<]r|0h:]r}0hF]r~0uhKjh0hd]r0hrX patch.dictr€0…r0}r‚0(h4UhKjv0ubahYjô ubhrX5 restores dictionary even when an exception is raisedrƒ0…r„0}r…0(h4X5 restores dictionary even when an exception is raisedr†0hKjh0ubeubaubeubeubhThS)r‡0}rˆ0(h4UhKhVhXhBhYhZh5}r‰0(h7]rŠ0hD]r‹0h<]rŒ0h:]r0U version-0-6-0rŽ0ahF]r0hauhbM1hchhd]r0(hf)r‘0}r’0(h4X2009/08/22 Version 0.6.0r“0hKj‡0hXhBhYhjh5}r”0(h7]r•0hD]r–0h<]r—0h:]r˜0hF]r™0uhbM1hchhd]rš0hrX2009/08/22 Version 0.6.0r›0…rœ0}r0(h4j“0hKj‘0ubaubhP)rž0}rŸ0(h4UhKj‡0hXhBhYhh5}r 0(h‘X*h:]r¡0h<]r¢0h7]r£0hD]r¤0hF]r¥0uhbM3hchhd]r¦0(hL)r§0}r¨0(h4X.New test layout compatible with test discoveryr©0hKjž0hXhBhYh›h5}rª0(h7]r«0hD]r¬0h<]r­0h:]r®0hF]r¯0uhbNhchhd]r°0h£)r±0}r²0(h4j©0hKj§0hXhBhYh§h5}r³0(h7]r´0hD]rµ0h<]r¶0h:]r·0hF]r¸0uhbM3hd]r¹0hrX.New test layout compatible with test discoveryrº0…r»0}r¼0(h4j©0hKj±0ubaubaubhL)r½0}r¾0(h4XZDescriptors (static methods / class methods etc) can now be patched and restored correctlyr¿0hKjž0hXhBhYh›h5}rÀ0(h7]rÁ0hD]rÂ0h<]rÃ0h:]rÄ0hF]rÅ0uhbNhchhd]rÆ0h£)rÇ0}rÈ0(h4XZDescriptors (static methods / class methods etc) can now be patched and restored correctlyrÉ0hKj½0hXhBhYh§h5}rÊ0(h7]rË0hD]rÌ0h<]rÍ0h:]rÎ0hF]rÏ0uhbM4hd]rÐ0hrXZDescriptors (static methods / class methods etc) can now be patched and restored correctlyrÑ0…rÒ0}rÓ0(h4jÉ0hKjÇ0ubaubaubhL)rÔ0}rÕ0(h4XcMocks can raise exceptions when called by setting ``side_effect`` to an exception class or instancerÖ0hKjž0hXhBhYh›h5}r×0(h7]rØ0hD]rÙ0h<]rÚ0h:]rÛ0hF]rÜ0uhbNhchhd]rÝ0h£)rÞ0}rß0(h4XcMocks can raise exceptions when called by setting ``side_effect`` to an exception class or instancerà0hKjÔ0hXhBhYh§h5}rá0(h7]râ0hD]rã0h<]rä0h:]rå0hF]ræ0uhbM6hd]rç0(hrX2Mocks can raise exceptions when called by setting rè0…ré0}rê0(h4X2Mocks can raise exceptions when called by setting rë0hKjÞ0ubjå )rì0}rí0(h4X``side_effect``rî0h5}rï0(h7]rð0hD]rñ0h<]rò0h:]ró0hF]rô0uhKjÞ0hd]rõ0hrX side_effectrö0…r÷0}rø0(h4UhKjì0ubahYjô ubhrX" to an exception class or instancerù0…rú0}rû0(h4X" to an exception class or instancerü0hKjÞ0ubeubaubhL)rý0}rþ0(h4XlMocks that wrap objects will not pass on calls to the underlying object if an explicit return_value is set rÿ0hKjž0hXhBhYh›h5}r1(h7]r1hD]r1h<]r1h:]r1hF]r1uhbNhchhd]r1h£)r1}r1(h4XjMocks that wrap objects will not pass on calls to the underlying object if an explicit return_value is setr 1hKjý0hXhBhYh§h5}r 1(h7]r 1hD]r 1h<]r 1h:]r1hF]r1uhbM8hd]r1hrXjMocks that wrap objects will not pass on calls to the underlying object if an explicit return_value is setr1…r1}r1(h4j 1hKj1ubaubaubeubeubhS)r1}r1(h4UhKhVhXhBhYhZh5}r1(h7]r1hD]r1h<]r1h:]r1U version-0-5-0r1ahF]r1hauhbM=hchhd]r1(hf)r1}r1(h4X2009/04/17 Version 0.5.0r 1hKj1hXhBhYhjh5}r!1(h7]r"1hD]r#1h<]r$1h:]r%1hF]r&1uhbM=hchhd]r'1hrX2009/04/17 Version 0.5.0r(1…r)1}r*1(h4j 1hKj1ubaubhP)r+1}r,1(h4UhKj1hXhBhYhh5}r-1(h‘X*h:]r.1h<]r/1h7]r01hD]r11hF]r21uhbM?hchhd]r31(hL)r41}r51(h4X$Made DEFAULT part of the public api.r61hKj+1hXhBhYh›h5}r71(h7]r81hD]r91h<]r:1h:]r;1hF]r<1uhbNhchhd]r=1h£)r>1}r?1(h4j61hKj41hXhBhYh§h5}r@1(h7]rA1hD]rB1h<]rC1h:]rD1hF]rE1uhbM?hd]rF1hrX$Made DEFAULT part of the public api.rG1…rH1}rI1(h4j61hKj>1ubaubaubhL)rJ1}rK1(h4X Documentation built with Sphinx.rL1hKj+1hXhBhYh›h5}rM1(h7]rN1hD]rO1h<]rP1h:]rQ1hF]rR1uhbNhchhd]rS1h£)rT1}rU1(h4jL1hKjJ1hXhBhYh§h5}rV1(h7]rW1hD]rX1h<]rY1h:]rZ1hF]r[1uhbM@hd]r\1hrX Documentation built with Sphinx.r]1…r^1}r_1(h4jL1hKjT1ubaubaubhL)r`1}ra1(h4X«``side_effect`` is now called with the same arguments as the mock is called with and if returns a non-DEFAULT value that is automatically set as the ``mock.return_value``.rb1hKj+1hXhBhYh›h5}rc1(h7]rd1hD]re1h<]rf1h:]rg1hF]rh1uhbNhchhd]ri1h£)rj1}rk1(h4X«``side_effect`` is now called with the same arguments as the mock is called with and if returns a non-DEFAULT value that is automatically set as the ``mock.return_value``.rl1hKj`1hXhBhYh§h5}rm1(h7]rn1hD]ro1h<]rp1h:]rq1hF]rr1uhbMAhd]rs1(jå )rt1}ru1(h4X``side_effect``rv1h5}rw1(h7]rx1hD]ry1h<]rz1h:]r{1hF]r|1uhKjj1hd]r}1hrX side_effectr~1…r1}r€1(h4UhKjt1ubahYjô ubhrX† is now called with the same arguments as the mock is called with and if returns a non-DEFAULT value that is automatically set as the r1…r‚1}rƒ1(h4X† is now called with the same arguments as the mock is called with and if returns a non-DEFAULT value that is automatically set as the r„1hKjj1ubjå )r…1}r†1(h4X``mock.return_value``r‡1h5}rˆ1(h7]r‰1hD]rŠ1h<]r‹1h:]rŒ1hF]r1uhKjj1hd]rŽ1hrXmock.return_valuer1…r1}r‘1(h4UhKj…1ubahYjô ubhrX.…r’1}r“1(h4X.hKjj1ubeubaubhL)r”1}r•1(h4Xg``wraps`` keyword argument used for wrapping objects (and passing calls through to the wrapped object).r–1hKj+1hXhBhYh›h5}r—1(h7]r˜1hD]r™1h<]rš1h:]r›1hF]rœ1uhbNhchhd]r1h£)rž1}rŸ1(h4j–1hKj”1hXhBhYh§h5}r 1(h7]r¡1hD]r¢1h<]r£1h:]r¤1hF]r¥1uhbMChd]r¦1(jå )r§1}r¨1(h4X ``wraps``r©1h5}rª1(h7]r«1hD]r¬1h<]r­1h:]r®1hF]r¯1uhKjž1hd]r°1hrXwrapsr±1…r²1}r³1(h4UhKj§1ubahYjô ubhrX^ keyword argument used for wrapping objects (and passing calls through to the wrapped object).r´1…rµ1}r¶1(h4X^ keyword argument used for wrapping objects (and passing calls through to the wrapped object).r·1hKjž1ubeubaubhL)r¸1}r¹1(h4XM``Mock.reset`` renamed to ``Mock.reset_mock``, as reset is a common API name.rº1hKj+1hXhBhYh›h5}r»1(h7]r¼1hD]r½1h<]r¾1h:]r¿1hF]rÀ1uhbNhchhd]rÁ1h£)rÂ1}rÃ1(h4jº1hKj¸1hXhBhYh§h5}rÄ1(h7]rÅ1hD]rÆ1h<]rÇ1h:]rÈ1hF]rÉ1uhbMDhd]rÊ1(jå )rË1}rÌ1(h4X``Mock.reset``rÍ1h5}rÎ1(h7]rÏ1hD]rÐ1h<]rÑ1h:]rÒ1hF]rÓ1uhKjÂ1hd]rÔ1hrX Mock.resetrÕ1…rÖ1}r×1(h4UhKjË1ubahYjô ubhrX renamed to rØ1…rÙ1}rÚ1(h4X renamed to rÛ1hKjÂ1ubjå )rÜ1}rÝ1(h4X``Mock.reset_mock``rÞ1h5}rß1(h7]rà1hD]rá1h<]râ1h:]rã1hF]rä1uhKjÂ1hd]rå1hrXMock.reset_mockræ1…rç1}rè1(h4UhKjÜ1ubahYjô ubhrX , as reset is a common API name.ré1…rê1}rë1(h4X , as reset is a common API name.rì1hKjÂ1ubeubaubhL)rí1}rî1(h4XT``patch`` / ``patch_object`` are now context managers and can be used with ``with``.rï1hKj+1hXhBhYh›h5}rð1(h7]rñ1hD]rò1h<]ró1h:]rô1hF]rõ1uhbNhchhd]rö1h£)r÷1}rø1(h4jï1hKjí1hXhBhYh§h5}rù1(h7]rú1hD]rû1h<]rü1h:]rý1hF]rþ1uhbMEhd]rÿ1(jå )r2}r2(h4X ``patch``r2h5}r2(h7]r2hD]r2h<]r2h:]r2hF]r2uhKj÷1hd]r 2hrXpatchr 2…r 2}r 2(h4UhKj2ubahYjô ubhrX / r 2…r2}r2(h4X / r2hKj÷1ubjå )r2}r2(h4X``patch_object``r2h5}r2(h7]r2hD]r2h<]r2h:]r2hF]r2uhKj÷1hd]r2hrX patch_objectr2…r2}r2(h4UhKj2ubahYjô ubhrX/ are now context managers and can be used with r2…r2}r 2(h4X/ are now context managers and can be used with r!2hKj÷1ubjå )r"2}r#2(h4X``with``r$2h5}r%2(h7]r&2hD]r'2h<]r(2h:]r)2hF]r*2uhKj÷1hd]r+2hrXwithr,2…r-2}r.2(h4UhKj"2ubahYjô ubhrX.…r/2}r02(h4X.hKj÷1ubeubaubhL)r12}r22(h4X A new 'create' keyword argument to patch and patch_object that allows them to patch (and unpatch) attributes that don't exist. (Potentially unsafe to use - it can allow you to have tests that pass when they are testing an API that doesn't exist - use at your own risk!)r32hKj+1hXhBhYh›h5}r42(h7]r52hD]r62h<]r72h:]r82hF]r92uhbNhchhd]r:2h£)r;2}r<2(h4X A new 'create' keyword argument to patch and patch_object that allows them to patch (and unpatch) attributes that don't exist. (Potentially unsafe to use - it can allow you to have tests that pass when they are testing an API that doesn't exist - use at your own risk!)r=2hKj12hXhBhYh§h5}r>2(h7]r?2hD]r@2h<]rA2h:]rB2hF]rC2uhbMFhd]rD2hrX A new 'create' keyword argument to patch and patch_object that allows them to patch (and unpatch) attributes that don't exist. (Potentially unsafe to use - it can allow you to have tests that pass when they are testing an API that doesn't exist - use at your own risk!)rE2…rF2}rG2(h4j=2hKj;2ubaubaubhL)rH2}rI2(h4XžThe methods keyword argument to Mock has been removed and merged with spec. The spec argument can now be a list of methods or an object to take the spec from.rJ2hKj+1hXhBhYh›h5}rK2(h7]rL2hD]rM2h<]rN2h:]rO2hF]rP2uhbNhchhd]rQ2h£)rR2}rS2(h4XžThe methods keyword argument to Mock has been removed and merged with spec. The spec argument can now be a list of methods or an object to take the spec from.rT2hKjH2hXhBhYh§h5}rU2(h7]rV2hD]rW2h<]rX2h:]rY2hF]rZ2uhbMJhd]r[2hrXžThe methods keyword argument to Mock has been removed and merged with spec. The spec argument can now be a list of methods or an object to take the spec from.r\2…r]2}r^2(h4jT2hKjR2ubaubaubhL)r_2}r`2(h4XNested patches may now be applied in a different order (created mocks passed in the opposite order). This is actually a bugfix.ra2hKj+1hXhBhYh›h5}rb2(h7]rc2hD]rd2h<]re2h:]rf2hF]rg2uhbNhchhd]rh2h£)ri2}rj2(h4XNested patches may now be applied in a different order (created mocks passed in the opposite order). This is actually a bugfix.rk2hKj_2hXhBhYh§h5}rl2(h7]rm2hD]rn2h<]ro2h:]rp2hF]rq2uhbMLhd]rr2hrXNested patches may now be applied in a different order (created mocks passed in the opposite order). This is actually a bugfix.rs2…rt2}ru2(h4jk2hKji2ubaubaubhL)rv2}rw2(h4Xpatch and patch_object now take a spec keyword argument. If spec is passed in as 'True' then the Mock created will take the object it is replacing as its spec object. If the object being replaced is a class, then the return value for the mock will also use the class as a spec.rx2hKj+1hXhBhYh›h5}ry2(h7]rz2hD]r{2h<]r|2h:]r}2hF]r~2uhbNhchhd]r2h£)r€2}r2(h4Xpatch and patch_object now take a spec keyword argument. If spec is passed in as 'True' then the Mock created will take the object it is replacing as its spec object. If the object being replaced is a class, then the return value for the mock will also use the class as a spec.r‚2hKjv2hXhBhYh§h5}rƒ2(h7]r„2hD]r…2h<]r†2h:]r‡2hF]rˆ2uhbMNhd]r‰2hrXpatch and patch_object now take a spec keyword argument. If spec is passed in as 'True' then the Mock created will take the object it is replacing as its spec object. If the object being replaced is a class, then the return value for the mock will also use the class as a spec.rŠ2…r‹2}rŒ2(h4j‚2hKj€2ubaubaubhL)r2}rŽ2(h4XˆA Mock created without a spec will not attempt to mock any magic methods / attributes (they will raise an ``AttributeError`` instead). r2hKj+1hXhBhYh›h5}r2(h7]r‘2hD]r’2h<]r“2h:]r”2hF]r•2uhbNhchhd]r–2h£)r—2}r˜2(h4X†A Mock created without a spec will not attempt to mock any magic methods / attributes (they will raise an ``AttributeError`` instead).r™2hKj2hXhBhYh§h5}rš2(h7]r›2hD]rœ2h<]r2h:]rž2hF]rŸ2uhbMRhd]r 2(hrXjA Mock created without a spec will not attempt to mock any magic methods / attributes (they will raise an r¡2…r¢2}r£2(h4XjA Mock created without a spec will not attempt to mock any magic methods / attributes (they will raise an r¤2hKj—2ubjå )r¥2}r¦2(h4X``AttributeError``r§2h5}r¨2(h7]r©2hD]rª2h<]r«2h:]r¬2hF]r­2uhKj—2hd]r®2hrXAttributeErrorr¯2…r°2}r±2(h4UhKj¥2ubahYjô ubhrX instead).r²2…r³2}r´2(h4X instead).rµ2hKj—2ubeubaubeubeubhS)r¶2}r·2(h4UhKhVhXhBhYhZh5}r¸2(h7]r¹2hD]rº2h<]r»2h:]r¼2U version-0-4-0r½2ahF]r¾2hauhbMWhchhd]r¿2(hf)rÀ2}rÁ2(h4X2008/10/12 Version 0.4.0rÂ2hKj¶2hXhBhYhjh5}rÃ2(h7]rÄ2hD]rÅ2h<]rÆ2h:]rÇ2hF]rÈ2uhbMWhchhd]rÉ2hrX2008/10/12 Version 0.4.0rÊ2…rË2}rÌ2(h4jÂ2hKjÀ2ubaubhP)rÍ2}rÎ2(h4UhKj¶2hXhBhYhh5}rÏ2(h‘X*h:]rÐ2h<]rÑ2h7]rÒ2hD]rÓ2hF]rÔ2uhbMYhchhd]rÕ2(hL)rÖ2}r×2(h4X7Default return value is now a new mock rather than NonerØ2hKjÍ2hXhBhYh›h5}rÙ2(h7]rÚ2hD]rÛ2h<]rÜ2h:]rÝ2hF]rÞ2uhbNhchhd]rß2h£)rà2}rá2(h4jØ2hKjÖ2hXhBhYh§h5}râ2(h7]rã2hD]rä2h<]rå2h:]ræ2hF]rç2uhbMYhd]rè2hrX7Default return value is now a new mock rather than Noneré2…rê2}rë2(h4jØ2hKjà2ubaubaubhL)rì2}rí2(h4X;return_value added as a keyword argument to the constructorrî2hKjÍ2hXhBhYh›h5}rï2(h7]rð2hD]rñ2h<]rò2h:]ró2hF]rô2uhbNhchhd]rõ2h£)rö2}r÷2(h4jî2hKjì2hXhBhYh§h5}rø2(h7]rù2hD]rú2h<]rû2h:]rü2hF]rý2uhbMZhd]rþ2hrX;return_value added as a keyword argument to the constructorrÿ2…r3}r3(h4jî2hKjö2ubaubaubhL)r3}r3(h4XNew method 'assert_called_with'r3hKjÍ2hXhBhYh›h5}r3(h7]r3hD]r3h<]r3h:]r 3hF]r 3uhbNhchhd]r 3h£)r 3}r 3(h4j3hKj3hXhBhYh§h5}r3(h7]r3hD]r3h<]r3h:]r3hF]r3uhbM[hd]r3hrXNew method 'assert_called_with'r3…r3}r3(h4j3hKj 3ubaubaubhL)r3}r3(h4XKAdded 'side_effect' attribute / keyword argument called when mock is calledr3hKjÍ2hXhBhYh›h5}r3(h7]r3hD]r3h<]r3h:]r3hF]r 3uhbNhchhd]r!3h£)r"3}r#3(h4j3hKj3hXhBhYh§h5}r$3(h7]r%3hD]r&3h<]r'3h:]r(3hF]r)3uhbM\hd]r*3hrXKAdded 'side_effect' attribute / keyword argument called when mock is calledr+3…r,3}r-3(h4j3hKj"3ubaubaubhL)r.3}r/3(h4Xpatch 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) r03hKjÍ2hXhBhYh›h5}r13(h7]r23hD]r33h<]r43h:]r53hF]r63uhbNhchhd]r73(h£)r83}r93(h4X*patch decorator split into two decorators:r:3hKj.3hXhBhYh§h5}r;3(h7]r<3hD]r=3h<]r>3h:]r?3hF]r@3uhbM]hd]rA3hrX*patch decorator split into two decorators:rB3…rC3}rD3(h4j:3hKj83ubaubcdocutils.nodes block_quote rE3)rF3}rG3(h4Uh5}rH3(h7]rI3hD]rJ3h<]rK3h:]rL3hF]rM3uhKj.3hd]rN3hP)rO3}rP3(h4Uh5}rQ3(h‘X-h:]rR3h<]rS3h7]rT3hD]rU3hF]rV3uhKjF3hd]rW3(hL)rX3}rY3(h4X``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)rZ3h5}r[3(h7]r\3hD]r]3h<]r^3h:]r_3hF]r`3uhKjO3hd]ra3h£)rb3}rc3(h4X``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)rd3hKjX3hXhBhYh§h5}re3(h7]rf3hD]rg3h<]rh3h:]ri3hF]rj3uhbM_hd]rk3(jå )rl3}rm3(h4X``patch_object``rn3h5}ro3(h7]rp3hD]rq3h<]rr3h:]rs3hF]rt3uhKjb3hd]ru3hrX patch_objectrv3…rw3}rx3(h4UhKjl3ubahYjô ubhrX} which takes an object and an attribute name to patch (plus optionally a value to patch with which defaults to a mock object)ry3…rz3}r{3(h4X} which takes an object and an attribute name to patch (plus optionally a value to patch with which defaults to a mock object)r|3hKjb3ubeubahYh›ubhL)r}3}r~3(h4X³``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) r3h5}r€3(h7]r3hD]r‚3h<]rƒ3h:]r„3hF]r…3uhKjO3hd]r†3h£)r‡3}rˆ3(h4X²``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)r‰3hKj}3hXhBhYh§h5}rŠ3(h7]r‹3hD]rŒ3h<]r3h:]rŽ3hF]r3uhbMahd]r3(jå )r‘3}r’3(h4X ``patch``r“3h5}r”3(h7]r•3hD]r–3h<]r—3h:]r˜3hF]r™3uhKj‡3hd]rš3hrXpatchr›3…rœ3}r3(h4UhKj‘3ubahYjô ubhrX© 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)rž3…rŸ3}r 3(h4X© 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)r¡3hKj‡3ubeubahYh›ubehYhubahYU block_quoter¢3ubeubhL)r£3}r¤3(h4X#Can now patch objects with ``None``r¥3hKjÍ2hXhBhYh›h5}r¦3(h7]r§3hD]r¨3h<]r©3h:]rª3hF]r«3uhbNhchhd]r¬3h£)r­3}r®3(h4j¥3hKj£3hXhBhYh§h5}r¯3(h7]r°3hD]r±3h<]r²3h:]r³3hF]r´3uhbMehd]rµ3(hrXCan now patch objects with r¶3…r·3}r¸3(h4XCan now patch objects with r¹3hKj­3ubjå )rº3}r»3(h4X``None``r¼3h5}r½3(h7]r¾3hD]r¿3h<]rÀ3h:]rÁ3hF]rÂ3uhKj­3hd]rÃ3hrXNonerÄ3…rÅ3}rÆ3(h4UhKjº3ubahYjô ubeubaubhL)rÇ3}rÈ3(h4XPChange to patch for nose compatibility with error reporting in wrapped functionsrÉ3hKjÍ2hXhBhYh›h5}rÊ3(h7]rË3hD]rÌ3h<]rÍ3h:]rÎ3hF]rÏ3uhbNhchhd]rÐ3h£)rÑ3}rÒ3(h4jÉ3hKjÇ3hXhBhYh§h5}rÓ3(h7]rÔ3hD]rÕ3h<]rÖ3h:]r×3hF]rØ3uhbMfhd]rÙ3hrXPChange to patch for nose compatibility with error reporting in wrapped functionsrÚ3…rÛ3}rÜ3(h4jÉ3hKjÑ3ubaubaubhL)rÝ3}rÞ3(h4Xª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). rß3hKjÍ2hXhBhYh›h5}rà3(h7]rá3hD]râ3h<]rã3h:]rä3hF]rå3uhbNhchhd]ræ3h£)rç3}rè3(h4X©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).ré3hKjÝ3hXhBhYh§h5}rê3(h7]rë3hD]rì3h<]rí3h:]rî3hF]rï3uhbMghd]rð3hrX©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).rñ3…rò3}ró3(h4jé3hKjç3ubaubaubeubh£)rô3}rõ3(h4XNThanks to Konrad Delong, Kevin Dangoor and others for patches and suggestions.rö3hKj¶2hXhBhYh§h5}r÷3(h7]rø3hD]rù3h<]rú3h:]rû3hF]rü3uhbMkhchhd]rý3hrXNThanks to Konrad Delong, Kevin Dangoor and others for patches and suggestions.rþ3…rÿ3}r4(h4jö3hKjô3ubaubeubhS)r4}r4(h4UhKhVhXhBhYhZh5}r4(h7]r4hD]r4h<]r4h:]r4U version-0-3-1r4ahF]r 4hauhbMohchhd]r 4(hf)r 4}r 4(h4X2007/12/03 Version 0.3.1r 4hKj4hXhBhYhjh5}r4(h7]r4hD]r4h<]r4h:]r4hF]r4uhbMohchhd]r4hrX2007/12/03 Version 0.3.1r4…r4}r4(h4j 4hKj 4ubaubh£)r4}r4(h4Xc``patch`` maintains the name of decorated functions for compatibility with nose test autodiscovery.r4hKj4hXhBhYh§h5}r4(h7]r4hD]r4h<]r4h:]r4hF]r 4uhbMqhchhd]r!4(jå )r"4}r#4(h4X ``patch``r$4h5}r%4(h7]r&4hD]r'4h<]r(4h:]r)4hF]r*4uhKj4hd]r+4hrXpatchr,4…r-4}r.4(h4UhKj"4ubahYjô ubhrXZ maintains the name of decorated functions for compatibility with nose test autodiscovery.r/4…r04}r14(h4XZ maintains the name of decorated functions for compatibility with nose test autodiscovery.r24hKj4ubeubh£)r34}r44(h4XTests decorated with ``patch`` that use the two argument form (implicit mock creation) will receive the mock(s) passed in as extra arguments.r54hKj4hXhBhYh§h5}r64(h7]r74hD]r84h<]r94h:]r:4hF]r;4uhbMthchhd]r<4(hrXTests decorated with r=4…r>4}r?4(h4XTests decorated with r@4hKj34ubjå )rA4}rB4(h4X ``patch``rC4h5}rD4(h7]rE4hD]rF4h<]rG4h:]rH4hF]rI4uhKj34hd]rJ4hrXpatchrK4…rL4}rM4(h4UhKjA4ubahYjô ubhrXo that use the two argument form (implicit mock creation) will receive the mock(s) passed in as extra arguments.rN4…rO4}rP4(h4Xo that use the two argument form (implicit mock creation) will receive the mock(s) passed in as extra arguments.rQ4hKj34ubeubh£)rR4}rS4(h4X*Thanks to Kevin Dangoor for these changes.rT4hKj4hXhBhYh§h5}rU4(h7]rV4hD]rW4h<]rX4h:]rY4hF]rZ4uhbMwhchhd]r[4hrX*Thanks to Kevin Dangoor for these changes.r\4…r]4}r^4(h4jT4hKjR4ubaubeubhS)r_4}r`4(h4UhKhVhXhBhYhZh5}ra4(h7]rb4hD]rc4h<]rd4h:]re4U version-0-3-0rf4ahF]rg4h*auhbM{hchhd]rh4(hf)ri4}rj4(h4X2007/11/30 Version 0.3.0rk4hKj_4hXhBhYhjh5}rl4(h7]rm4hD]rn4h<]ro4h:]rp4hF]rq4uhbM{hchhd]rr4hrX2007/11/30 Version 0.3.0rs4…rt4}ru4(h4jk4hKji4ubaubh£)rv4}rw4(h4XeRemoved ``patch_module``. ``patch`` can now take a string as the first argument for patching modules.rx4hKj_4hXhBhYh§h5}ry4(h7]rz4hD]r{4h<]r|4h:]r}4hF]r~4uhbM}hchhd]r4(hrXRemoved r€4…r4}r‚4(h4XRemoved rƒ4hKjv4ubjå )r„4}r…4(h4X``patch_module``r†4h5}r‡4(h7]rˆ4hD]r‰4h<]rŠ4h:]r‹4hF]rŒ4uhKjv4hd]r4hrX patch_modulerŽ4…r4}r4(h4UhKj„4ubahYjô ubhrX. r‘4…r’4}r“4(h4X. r”4hKjv4ubjå )r•4}r–4(h4X ``patch``r—4h5}r˜4(h7]r™4hD]rš4h<]r›4h:]rœ4hF]r4uhKjv4hd]rž4hrXpatchrŸ4…r 4}r¡4(h4UhKj•4ubahYjô ubhrXB can now take a string as the first argument for patching modules.r¢4…r£4}r¤4(h4XB can now take a string as the first argument for patching modules.r¥4hKjv4ubeubh£)r¦4}r§4(h4XgThe third argument to ``patch`` is optional - a mock will be created by default if it is not passed in.r¨4hKj_4hXhBhYh§h5}r©4(h7]rª4hD]r«4h<]r¬4h:]r­4hF]r®4uhbM€hchhd]r¯4(hrXThe third argument to r°4…r±4}r²4(h4XThe third argument to r³4hKj¦4ubjå )r´4}rµ4(h4X ``patch``r¶4h5}r·4(h7]r¸4hD]r¹4h<]rº4h:]r»4hF]r¼4uhKj¦4hd]r½4hrXpatchr¾4…r¿4}rÀ4(h4UhKj´4ubahYjô ubhrXH is optional - a mock will be created by default if it is not passed in.rÁ4…rÂ4}rÃ4(h4XH is optional - a mock will be created by default if it is not passed in.rÄ4hKj¦4ubeubeubhS)rÅ4}rÆ4(h4UhKhVhXhBhYhZh5}rÇ4(h7]rÈ4hD]rÉ4h<]rÊ4h:]rË4U version-0-2-1rÌ4ahF]rÍ4hauhbM…hchhd]rÎ4(hf)rÏ4}rÐ4(h4X2007/11/21 Version 0.2.1rÑ4hKjÅ4hXhBhYhjh5}rÒ4(h7]rÓ4hD]rÔ4h<]rÕ4h:]rÖ4hF]r×4uhbM…hchhd]rØ4hrX2007/11/21 Version 0.2.1rÙ4…rÚ4}rÛ4(h4jÑ4hKjÏ4ubaubh£)rÜ4}rÝ4(h4XQBug fix, allows reuse of functions decorated with ``patch`` and ``patch_module``.rÞ4hKjÅ4hXhBhYh§h5}rß4(h7]rà4hD]rá4h<]râ4h:]rã4hF]rä4uhbM‡hchhd]rå4(hrX2Bug fix, allows reuse of functions decorated with ræ4…rç4}rè4(h4X2Bug fix, allows reuse of functions decorated with ré4hKjÜ4ubjå )rê4}rë4(h4X ``patch``rì4h5}rí4(h7]rî4hD]rï4h<]rð4h:]rñ4hF]rò4uhKjÜ4hd]ró4hrXpatchrô4…rõ4}rö4(h4UhKjê4ubahYjô ubhrX and r÷4…rø4}rù4(h4X and rú4hKjÜ4ubjå )rû4}rü4(h4X``patch_module``rý4h5}rþ4(h7]rÿ4hD]r5h<]r5h:]r5hF]r5uhKjÜ4hd]r5hrX patch_moduler5…r5}r5(h4UhKjû4ubahYjô ubhrX.…r5}r 5(h4X.hKjÜ4ubeubeubhS)r 5}r 5(h4UhKhVhXhBhYhZh5}r 5(h7]r 5hD]r5h<]r5h:]r5U version-0-2-0r5ahF]r5h auhbM‹hchhd]r5(hf)r5}r5(h4X2007/11/20 Version 0.2.0r5hKj 5hXhBhYhjh5}r5(h7]r5hD]r5h<]r5h:]r5hF]r5uhbM‹hchhd]r5hrX2007/11/20 Version 0.2.0r5…r5}r 5(h4j5hKj5ubaubh£)r!5}r"5(h4XZAdded ``spec`` keyword argument for creating ``Mock`` objects from a specification object.r#5hKj 5hXhBhYh§h5}r$5(h7]r%5hD]r&5h<]r'5h:]r(5hF]r)5uhbMhchhd]r*5(hrXAdded r+5…r,5}r-5(h4XAdded r.5hKj!5ubjå )r/5}r05(h4X``spec``r15h5}r25(h7]r35hD]r45h<]r55h:]r65hF]r75uhKj!5hd]r85hrXspecr95…r:5}r;5(h4UhKj/5ubahYjô ubhrX keyword argument for creating r<5…r=5}r>5(h4X keyword argument for creating r?5hKj!5ubjå )r@5}rA5(h4X``Mock``rB5h5}rC5(h7]rD5hD]rE5h<]rF5h:]rG5hF]rH5uhKj!5hd]rI5hrXMockrJ5…rK5}rL5(h4UhKj@5ubahYjô ubhrX% objects from a specification object.rM5…rN5}rO5(h4X% objects from a specification object.rP5hKj!5ubeubh£)rQ5}rR5(h4X@Added ``patch`` and ``patch_module`` monkey patching decorators.rS5hKj 5hXhBhYh§h5}rT5(h7]rU5hD]rV5h<]rW5h:]rX5hF]rY5uhbMhchhd]rZ5(hrXAdded r[5…r\5}r]5(h4XAdded r^5hKjQ5ubjå )r_5}r`5(h4X ``patch``ra5h5}rb5(h7]rc5hD]rd5h<]re5h:]rf5hF]rg5uhKjQ5hd]rh5hrXpatchri5…rj5}rk5(h4UhKj_5ubahYjô ubhrX and rl5…rm5}rn5(h4X and ro5hKjQ5ubjå )rp5}rq5(h4X``patch_module``rr5h5}rs5(h7]rt5hD]ru5h<]rv5h:]rw5hF]rx5uhKjQ5hd]ry5hrX patch_modulerz5…r{5}r|5(h4UhKjp5ubahYjô ubhrX monkey patching decorators.r}5…r~5}r5(h4X monkey patching decorators.r€5hKjQ5ubeubh£)r5}r‚5(h4X;Added ``sentinel`` for convenient access to unique objects.rƒ5hKj 5hXhBhYh§h5}r„5(h7]r…5hD]r†5h<]r‡5h:]rˆ5hF]r‰5uhbM’hchhd]rŠ5(hrXAdded r‹5…rŒ5}r5(h4XAdded rŽ5hKj5ubjå )r5}r5(h4X ``sentinel``r‘5h5}r’5(h7]r“5hD]r”5h<]r•5h:]r–5hF]r—5uhKj5hd]r˜5hrXsentinelr™5…rš5}r›5(h4UhKj5ubahYjô ubhrX) for convenient access to unique objects.rœ5…r5}rž5(h4X) for convenient access to unique objects.rŸ5hKj5ubeubh£)r 5}r¡5(h4X!Distribution includes unit tests.r¢5hKj 5hXhBhYh§h5}r£5(h7]r¤5hD]r¥5h<]r¦5h:]r§5hF]r¨5uhbM”hchhd]r©5hrX!Distribution includes unit tests.rª5…r«5}r¬5(h4j¢5hKj 5ubaubeubhS)r­5}r®5(h4UhKhVhXhBhYhZh5}r¯5(h7]r°5hD]r±5h<]r²5h:]r³5U version-0-1-0r´5ahF]rµ5h,auhbM˜hchhd]r¶5(hf)r·5}r¸5(h4X2007/11/19 Version 0.1.0r¹5hKj­5hXhBhYhjh5}rº5(h7]r»5hD]r¼5h<]r½5h:]r¾5hF]r¿5uhbM˜hchhd]rÀ5hrX2007/11/19 Version 0.1.0rÁ5…rÂ5}rÃ5(h4j¹5hKj·5ubaubh£)rÄ5}rÅ5(h4XInitial release.rÆ5hKj­5hXhBhYh§h5}rÇ5(h7]rÈ5hD]rÉ5h<]rÊ5h:]rË5hF]rÌ5uhbMšhchhd]rÍ5hrXInitial release.rÎ5…rÏ5}rÐ5(h4jÆ5hKjÄ5ubaubeubeubhXhBhYhZh5}rÑ5(h7]rÒ5hD]rÓ5h<]rÔ5h:]rÕ5Uversion-0-7-0-beta-1rÖ5ahF]r×5hauhbMhchhd]rØ5(hf)rÙ5}rÚ5(h4X2010/06/22 Version 0.7.0 beta 1rÛ5hKhThXhBhYhjh5}rÜ5(h7]rÝ5hD]rÞ5h<]rß5h:]rà5hF]rá5uhbMhchhd]râ5hrX2010/06/22 Version 0.7.0 beta 1rã5…rä5}rå5(h4jÛ5hKjÙ5ubaubhQeubhXhBhYhh5}ræ5(h‘X*h:]rç5h<]rè5h7]ré5hD]rê5hF]rë5uhbMhchhd]rì5(hL)rí5}rî5(h4X!Addition of :func:`mocksignature`rï5hKhQhXhBhYh›h5}rð5(h7]rñ5hD]rò5h<]ró5h:]rô5hF]rõ5uhbNhchhd]rö5h£)r÷5}rø5(h4jï5hKjí5hXhBhYh§h5}rù5(h7]rú5hD]rû5h<]rü5h:]rý5hF]rþ5uhbMhd]rÿ5(hrX Addition of r6…r6}r6(h4X Addition of r6hKj÷5ubjÌ )r6}r6(h4X:func:`mocksignature`r6hKj÷5hXhBhYjÐ h5}r6(Ureftyper6Xfuncr 6jÔ ‰jÕ X mocksignaturer 6U refdomainr 6Xpyr 6h:]r 6h<]r6U refexplicitr6‰h7]r6hD]r6hF]r6jß jà já Njâ jã uhbMhd]r6jå )r6}r6(h4j6h5}r6(h7]r6hD]r6(jë j 6Xpy-funcr6eh<]r6h:]r6hF]r6uhKj6hd]r6hrXmocksignature()r6…r6}r 6(h4UhKj6ubahYjô ubaubeubaubhL)r!6}r"6(h4XAbility to mock magic methodsr#6hKhQhXhBhYh›h5}r$6(h7]r%6hD]r&6h<]r'6h:]r(6hF]r)6uhbNhchhd]r*6h£)r+6}r,6(h4j#6hKj!6hXhBhYh§h5}r-6(h7]r.6hD]r/6h<]r06h:]r16hF]r26uhbMhd]r36hrXAbility to mock magic methodsr46…r56}r66(h4j#6hKj+6ubaubaubhL)r76}r86(h4XAAbility to use ``patch`` and ``patch.object`` as class decoratorsr96hKhQhXhBhYh›h5}r:6(h7]r;6hD]r<6h<]r=6h:]r>6hF]r?6uhbNhchhd]r@6h£)rA6}rB6(h4j96hKj76hXhBhYh§h5}rC6(h7]rD6hD]rE6h<]rF6h:]rG6hF]rH6uhbMhd]rI6(hrXAbility to use rJ6…rK6}rL6(h4XAbility to use rM6hKjA6ubjå )rN6}rO6(h4X ``patch``rP6h5}rQ6(h7]rR6hD]rS6h<]rT6h:]rU6hF]rV6uhKjA6hd]rW6hrXpatchrX6…rY6}rZ6(h4UhKjN6ubahYjô ubhrX and r[6…r\6}r]6(h4X and r^6hKjA6ubjå )r_6}r`6(h4X``patch.object``ra6h5}rb6(h7]rc6hD]rd6h<]re6h:]rf6hF]rg6uhKjA6hd]rh6hrX patch.objectri6…rj6}rk6(h4UhKj_6ubahYjô ubhrX as class decoratorsrl6…rm6}rn6(h4X as class decoratorsro6hKjA6ubeubaubhL)rp6}rq6(h4XQRenamed ``patch_object`` to :func:`patch.object` (``patch_object`` is deprecated)rr6hKhQhXhBhYh›h5}rs6(h7]rt6hD]ru6h<]rv6h:]rw6hF]rx6uhbNhchhd]ry6h£)rz6}r{6(h4XQRenamed ``patch_object`` to :func:`patch.object` (``patch_object`` is deprecated)r|6hKjp6hXhBhYh§h5}r}6(h7]r~6hD]r6h<]r€6h:]r6hF]r‚6uhbMhd]rƒ6(hrXRenamed r„6…r…6}r†6(h4XRenamed r‡6hKjz6ubjå )rˆ6}r‰6(h4X``patch_object``rŠ6h5}r‹6(h7]rŒ6hD]r6h<]rŽ6h:]r6hF]r6uhKjz6hd]r‘6hrX patch_objectr’6…r“6}r”6(h4UhKjˆ6ubahYjô ubhrX to r•6…r–6}r—6(h4X to r˜6hKjz6ubjÌ )r™6}rš6(h4X:func:`patch.object`r›6hKjz6hXhBhYjÐ h5}rœ6(Ureftyper6Xfuncrž6jÔ ‰jÕ X patch.objectrŸ6U refdomainr 6Xpyr¡6h:]r¢6h<]r£6U refexplicitr¤6‰h7]r¥6hD]r¦6hF]r§6jß jà já Njâ jã uhbMhd]r¨6jå )r©6}rª6(h4j›6h5}r«6(h7]r¬6hD]r­6(jë j¡6Xpy-funcr®6eh<]r¯6h:]r°6hF]r±6uhKj™6hd]r²6hrXpatch.object()r³6…r´6}rµ6(h4UhKj©6ubahYjô ubaubhrX (r¶6…r·6}r¸6(h4X (r¹6hKjz6ubjå )rº6}r»6(h4X``patch_object``r¼6h5}r½6(h7]r¾6hD]r¿6h<]rÀ6h:]rÁ6hF]rÂ6uhKjz6hd]rÃ6hrX patch_objectrÄ6…rÅ6}rÆ6(h4UhKjº6ubahYjô ubhrX is deprecated)rÇ6…rÈ6}rÉ6(h4X is deprecated)rÊ6hKjz6ubeubaubhL)rË6}rÌ6(h4XOAddition of :class:`MagicMock` class with all magic methods pre-created for yourÍ6hKhQhXhBhYh›h5}rÎ6(h7]rÏ6hD]rÐ6h<]rÑ6h:]rÒ6hF]rÓ6uhbNhchhd]rÔ6h£)rÕ6}rÖ6(h4jÍ6hKjË6hXhBhYh§h5}r×6(h7]rØ6hD]rÙ6h<]rÚ6h:]rÛ6hF]rÜ6uhbMhd]rÝ6(hrX Addition of rÞ6…rß6}rà6(h4X Addition of rá6hKjÕ6ubjÌ )râ6}rã6(h4X:class:`MagicMock`rä6hKjÕ6hXhBhYjÐ h5}rå6(Ureftyperæ6Xclassrç6jÔ ‰jÕ X MagicMockrè6U refdomainré6Xpyrê6h:]rë6h<]rì6U refexplicitrí6‰h7]rî6hD]rï6hF]rð6jß jà já Njâ jã uhbMhd]rñ6jå )rò6}ró6(h4jä6h5}rô6(h7]rõ6hD]rö6(jë jê6Xpy-classr÷6eh<]rø6h:]rù6hF]rú6uhKjâ6hd]rû6hrX MagicMockrü6…rý6}rþ6(h4UhKjò6ubahYjô ubaubhrX1 class with all magic methods pre-created for yourÿ6…r7}r7(h4X1 class with all magic methods pre-created for your7hKjÕ6ubeubaubhL)r7}r7(h4XOPython 3 compatibility (tested with 3.2 but should work with 3.0 & 3.1 as well)r7hKhQhXhBhYh›h5}r7(h7]r7hD]r7h<]r 7h:]r 7hF]r 7uhbNhchhd]r 7h£)r 7}r7(h4XOPython 3 compatibility (tested with 3.2 but should work with 3.0 & 3.1 as well)r7hKj7hXhBhYh§h5}r7(h7]r7hD]r7h<]r7h:]r7hF]r7uhbMhd]r7hrXOPython 3 compatibility (tested with 3.2 but should work with 3.0 & 3.1 as well)r7…r7}r7(h4j7hKj 7ubaubaubhL)r7}r7(h4XFAddition of :func:`patch.dict` for changing dictionaries during a testr7hKhQhXhBhYh›h5}r7(h7]r7hD]r7h<]r 7h:]r!7hF]r"7uhbNhchhd]r#7h£)r$7}r%7(h4j7hKj7hXhBhYh§h5}r&7(h7]r'7hD]r(7h<]r)7h:]r*7hF]r+7uhbMhd]r,7(hrX Addition of r-7…r.7}r/7(h4X Addition of r07hKj$7ubjÌ )r17}r27(h4X:func:`patch.dict`r37hKj$7hXhBhYjÐ h5}r47(Ureftyper57Xfuncr67jÔ ‰jÕ X patch.dictr77U refdomainr87Xpyr97h:]r:7h<]r;7U refexplicitr<7‰h7]r=7hD]r>7hF]r?7jß jà já Njâ jã uhbMhd]r@7jå )rA7}rB7(h4j37h5}rC7(h7]rD7hD]rE7(jë j97Xpy-funcrF7eh<]rG7h:]rH7hF]rI7uhKj17hd]rJ7hrX patch.dict()rK7…rL7}rM7(h4UhKjA7ubahYjô ubaubhrX( for changing dictionaries during a testrN7…rO7}rP7(h4X( for changing dictionaries during a testrQ7hKj$7ubeubaubhL)rR7}rS7(h4XHAddition of ``mocksignature`` argument to ``patch`` and ``patch.object``rT7hKhQhXhBhYh›h5}rU7(h7]rV7hD]rW7h<]rX7h:]rY7hF]rZ7uhbNhchhd]r[7h£)r\7}r]7(h4jT7hKjR7hXhBhYh§h5}r^7(h7]r_7hD]r`7h<]ra7h:]rb7hF]rc7uhbM hd]rd7(hrX Addition of re7…rf7}rg7(h4X Addition of rh7hKj\7ubjå )ri7}rj7(h4X``mocksignature``rk7h5}rl7(h7]rm7hD]rn7h<]ro7h:]rp7hF]rq7uhKj\7hd]rr7hrX mocksignaturers7…rt7}ru7(h4UhKji7ubahYjô ubhrX argument to rv7…rw7}rx7(h4X argument to ry7hKj\7ubjå )rz7}r{7(h4X ``patch``r|7h5}r}7(h7]r~7hD]r7h<]r€7h:]r7hF]r‚7uhKj\7hd]rƒ7hrXpatchr„7…r…7}r†7(h4UhKjz7ubahYjô ubhrX and r‡7…rˆ7}r‰7(h4X and rŠ7hKj\7ubjå )r‹7}rŒ7(h4X``patch.object``r7h5}rŽ7(h7]r7hD]r7h<]r‘7h:]r’7hF]r“7uhKj\7hd]r”7hrX patch.objectr•7…r–7}r—7(h4UhKj‹7ubahYjô ubeubaubhL)r˜7}r™7(h4XŸ``help(mock)`` works now (on the module). Can no longer use ``__bases__`` as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this)rš7hKhQhXhBhYh›h5}r›7(h7]rœ7hD]r7h<]rž7h:]rŸ7hF]r 7uhbNhchhd]r¡7h£)r¢7}r£7(h4XŸ``help(mock)`` works now (on the module). Can no longer use ``__bases__`` as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this)r¤7hKj˜7hXhBhYh§h5}r¥7(h7]r¦7hD]r§7h<]r¨7h:]r©7hF]rª7uhbM!hd]r«7(jå )r¬7}r­7(h4X``help(mock)``r®7h5}r¯7(h7]r°7hD]r±7h<]r²7h:]r³7hF]r´7uhKj¢7hd]rµ7hrX help(mock)r¶7…r·7}r¸7(h4UhKj¬7ubahYjô ubhrX. works now (on the module). Can no longer use r¹7…rº7}r»7(h4X. works now (on the module). Can no longer use r¼7hKj¢7ubjå )r½7}r¾7(h4X ``__bases__``r¿7h5}rÀ7(h7]rÁ7hD]rÂ7h<]rÃ7h:]rÄ7hF]rÅ7uhKj¢7hd]rÆ7hrX __bases__rÇ7…rÈ7}rÉ7(h4UhKj½7ubahYjô ubhrXV as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this)rÊ7…rË7}rÌ7(h4XV as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this)rÍ7hKj¢7ubeubaubhL)rÎ7}rÏ7(h4X«Addition of soft comparisons: `call_args`, `call_args_list` and `method_calls` now return tuple-like objects which compare equal even when empty args or kwargs are skippedrÐ7hKhQhXhBhYh›h5}rÑ7(h7]rÒ7hD]rÓ7h<]rÔ7h:]rÕ7hF]rÖ7uhbNhchhd]r×7h£)rØ7}rÙ7(h4X«Addition of soft comparisons: `call_args`, `call_args_list` and `method_calls` now return tuple-like objects which compare equal even when empty args or kwargs are skippedrÚ7hKjÎ7hXhBhYh§h5}rÛ7(h7]rÜ7hD]rÝ7h<]rÞ7h:]rß7hF]rà7uhbM$hd]rá7(hrXAddition of soft comparisons: râ7…rã7}rä7(h4XAddition of soft comparisons: rå7hKjØ7ubh³)ræ7}rç7(h4X `call_args`rè7h5}ré7(h7]rê7hD]rë7h<]rì7h:]rí7hF]rî7uhKjØ7hd]rï7hrX call_argsrð7…rñ7}rò7(h4UhKjæ7ubahYhÁubhrX, ró7…rô7}rõ7(h4X, rö7hKjØ7ubh³)r÷7}rø7(h4X`call_args_list`rù7h5}rú7(h7]rû7hD]rü7h<]rý7h:]rþ7hF]rÿ7uhKjØ7hd]r8hrXcall_args_listr8…r8}r8(h4UhKj÷7ubahYhÁubhrX and r8…r8}r8(h4X and r8hKjØ7ubh³)r8}r 8(h4X`method_calls`r 8h5}r 8(h7]r 8hD]r 8h<]r8h:]r8hF]r8uhKjØ7hd]r8hrX method_callsr8…r8}r8(h4UhKj8ubahYhÁubhrX] now return tuple-like objects which compare equal even when empty args or kwargs are skippedr8…r8}r8(h4X] now return tuple-like objects which compare equal even when empty args or kwargs are skippedr8hKjØ7ubeubaubhL)r8}r8(h4XAdded docstrings.r8hKhQhXhBhYh›h5}r8(h7]r8hD]r8h<]r8h:]r 8hF]r!8uhbNhchhd]r"8h£)r#8}r$8(h4j8hKj8hXhBhYh§h5}r%8(h7]r&8hD]r'8h<]r(8h:]r)8hF]r*8uhbM'hd]r+8hrXAdded docstrings.r,8…r-8}r.8(h4j8hKj#8ubaubaubhL)r/8}r08(h4X^BUGFIX: ``side_effect`` now works with ``BaseException`` exceptions like ``KeyboardInterrupt``r18hKhQhXhBhYh›h5}r28(h7]r38hD]r48h<]r58h:]r68hF]r78uhbNhchhd]r88h£)r98}r:8(h4X^BUGFIX: ``side_effect`` now works with ``BaseException`` exceptions like ``KeyboardInterrupt``r;8hKj/8hXhBhYh§h5}r<8(h7]r=8hD]r>8h<]r?8h:]r@8hF]rA8uhbM(hd]rB8(hrXBUGFIX: rC8…rD8}rE8(h4XBUGFIX: rF8hKj98ubjå )rG8}rH8(h4X``side_effect``rI8h5}rJ8(h7]rK8hD]rL8h<]rM8h:]rN8hF]rO8uhKj98hd]rP8hrX side_effectrQ8…rR8}rS8(h4UhKjG8ubahYjô ubhrX now works with rT8…rU8}rV8(h4X now works with rW8hKj98ubjå )rX8}rY8(h4X``BaseException``rZ8h5}r[8(h7]r\8hD]r]8h<]r^8h:]r_8hF]r`8uhKj98hd]ra8hrX BaseExceptionrb8…rc8}rd8(h4UhKjX8ubahYjô ubhrX exceptions like re8…rf8}rg8(h4X exceptions like rh8hKj98ubjå )ri8}rj8(h4X``KeyboardInterrupt``rk8h5}rl8(h7]rm8hD]rn8h<]ro8h:]rp8hF]rq8uhKj98hd]rr8hrXKeyboardInterruptrs8…rt8}ru8(h4UhKji8ubahYjô ubeubaubhL)rv8}rw8(h4XIBUGFIX: patching the same object twice now restores the patches correctlyrx8hKhQhXhBhYh›h5}ry8(h7]rz8hD]r{8h<]r|8h:]r}8hF]r~8uhbNhchhd]r8h£)r€8}r8(h4jx8hKjv8hXhBhYh§h5}r‚8(h7]rƒ8hD]r„8h<]r…8h:]r†8hF]r‡8uhbM*hd]rˆ8hrXIBUGFIX: patching the same object twice now restores the patches correctlyr‰8…rŠ8}r‹8(h4jx8hKj€8ubaubaubhL)rŒ8}r8(h4XQThe tests now require `unittest2 `_ to runrŽ8hKhQhXhBhYh›h5}r8(h7]r8hD]r‘8h<]r’8h:]r“8hF]r”8uhbNhchhd]r•8h£)r–8}r—8(h4XQThe tests now require `unittest2 `_ to runr˜8hKjŒ8hXhBhYh§h5}r™8(h7]rš8hD]r›8h<]rœ8h:]r8hF]rž8uhbM+hd]rŸ8(hrXThe tests now require r 8…r¡8}r¢8(h4XThe tests now require r£8hKj–8ubj=)r¤8}r¥8(h4X4`unittest2 `_r¦8h5}r§8(Unamer¨8X unittest2r©8jDX%http://pypi.python.org/pypi/unittest2rª8h:]r«8h<]r¬8h7]r­8hD]r®8hF]r¯8uhKj–8hd]r°8hrX unittest2r±8…r²8}r³8(h4UhKj¤8ubahYjOubjP)r´8}rµ8(h4X( r¶8jTKhKj–8hYjUh5}r·8(Urefurir¸8jª8h:]r¹8U unittest2rº8ah<]r»8h7]r¼8hD]r½8hF]r¾8hauhd]r¿8ubhrX to runrÀ8…rÁ8}rÂ8(h4X to runrÃ8hKj–8ubeubaubhMeubhXhBhYh›h5}rÄ8(h7]rÅ8hD]rÆ8h<]rÇ8h:]rÈ8hF]rÉ8uhbNhchhd]rÊ8h£)rË8}rÌ8(h4XE`Konrad Delong `_ added as co-maintainerrÍ8hKhMhXhBhYh§h5}rÎ8(h7]rÏ8hD]rÐ8h<]rÑ8h:]rÒ8hF]rÓ8uhbM-hd]rÔ8(j=)rÕ8}rÖ8(h4X.`Konrad Delong `_r×8h5}rØ8(UnamerÙ8X Konrad DelongrÚ8jDXhttp://konryd.blogspot.com/rÛ8h:]rÜ8h<]rÝ8h7]rÞ8hD]rß8hF]rà8uhKjË8hd]rá8hrX Konrad Delongrâ8…rã8}rä8(h4UhKjÕ8ubahYjOubjP)rå8}ræ8(h4X rç8jTKhKjË8hYjUh5}rè8(Urefuriré8jÛ8h:]rê8h>ah<]rë8h7]rì8X konrad delongrí8ahD]rî8hF]rï8uhd]rð8ubhrX added as co-maintainerrñ8…rò8}ró8(h4X added as co-maintainerrô8hKjË8ubeubaubhd]rõ8h£)rö8}r÷8(h4Uh5}rø8(h7]rù8hD]rú8h<]rû8h:]rü8hF]rý8uhKh2hd]rþ8hrX0Duplicate explicit target name: "konrad delong".rÿ8…r9}r9(h4UhKjö8ubahYh§ubahYUsystem_messager9ubaUcurrent_sourcer9NU decorationr9NUautofootnote_startr9KUnameidsr9}r9(hj4hjÌ4hj9h j5h jh jÑ)h Utodo-and-limitationsr9h jÙ#hjYhjÉhj½2hj“$hj¤hj•hjÖ5hjhj+hjÞhjº8hj1hj_$hjC*hjì/hjŽ0hj·hjP-h j\#h!j h"j2*h#jh$jíh%j(h&h}h'h`h(Umock-issue-trackerr 9h)jŠh*jf4h+jðh,j´5uhd]r 9(hVhS)r 9}r 9(h4UhKhhXhBhYhZh5}r 9(h7]r9hD]r9h<]r9h:]r9j9ahF]r9h auhbMžhchhd]r9(hf)r9}r9(h4XTODO and Limitationsr9hKj 9hXhBhYhjh5}r9(h7]r9hD]r9h<]r9h:]r9hF]r9uhbMžhchhd]r9hrXTODO and Limitationsr9…r9}r 9(h4j9hKj9ubaubh£)r!9}r"9(h4X1Contributions, bug reports and comments welcomed!r#9hKj 9hXhBhYh§h5}r$9(h7]r%9hD]r&9h<]r'9h:]r(9hF]r)9uhbM hchhd]r*9hrX1Contributions, bug reports and comments welcomed!r+9…r,9}r-9(h4j#9hKj!9ubaubh£)r.9}r/9(h4XBFeature requests and bug reports are handled on the issue tracker:r09hKj 9hXhBhYh§h5}r19(h7]r29hD]r39h<]r49h:]r59hF]r69uhbM¢hchhd]r79hrXBFeature requests and bug reports are handled on the issue tracker:r89…r99}r:9(h4j09hKj.9ubaubjE3)r;9}r<9(h4UhKj 9hXNhYj¢3h5}r=9(h7]r>9hD]r?9h<]r@9h:]rA9hF]rB9uhbNhchhd]rC9hP)rD9}rE9(h4Uh5}rF9(h‘X*h:]rG9h<]rH9h7]rI9hD]rJ9hF]rK9uhKj;9hd]rL9hL)rM9}rN9(h4XB`mock issue tracker `_ rO9h5}rP9(h7]rQ9hD]rR9h<]rS9h:]rT9hF]rU9uhKjD9hd]rV9h£)rW9}rX9(h4XA`mock issue tracker `_rY9hKjM9hXhBhYh§h5}rZ9(h7]r[9hD]r\9h<]r]9h:]r^9hF]r_9uhbM¤hd]r`9(j=)ra9}rb9(h4jY9h5}rc9(Unamerd9Xmock issue trackerre9jDX)http://code.google.com/p/mock/issues/listrf9h:]rg9h<]rh9h7]ri9hD]rj9hF]rk9uhKjW9hd]rl9hrXmock issue trackerrm9…rn9}ro9(h4UhKja9ubahYjOubjP)rp9}rq9(h4X, rr9jTKhKjW9hYjUh5}rs9(Urefurirt9jf9h:]ru9j 9ah<]rv9h7]rw9hD]rx9hF]ry9h(auhd]rz9ubeubahYh›ubahYhubaubh£)r{9}r|9(h4X-`wraps` is not integrated with magic methods.r}9hKj 9hXhBhYh§h5}r~9(h7]r9hD]r€9h<]r9h:]r‚9hF]rƒ9uhbM¦hchhd]r„9(h³)r…9}r†9(h4X`wraps`r‡9h5}rˆ9(h7]r‰9hD]rŠ9h<]r‹9h:]rŒ9hF]r9uhKj{9hd]rŽ9hrXwrapsr9…r9}r‘9(h4UhKj…9ubahYhÁubhrX& is not integrated with magic methods.r’9…r“9}r”9(h4X& is not integrated with magic methods.r•9hKj{9ubeubh£)r–9}r—9(h4X``patch` could auto-do the patching in the constructor and unpatch in the destructor. This would be useful in itself, but violates TOOWTDI and would be unsafe for IronPython & PyPy (non-deterministic calling of destructors). Destructors aren't called in CPython where there are cycles, but a weak reference with a callback can be used to get round this.r˜9hKj 9hXhBhYh§h5}r™9(h7]rš9hD]r›9h<]rœ9h:]r9hF]rž9uhbM¨hchhd]rŸ9(h³)r 9}r¡9(h4X`patch`r¢9h5}r£9(h7]r¤9hD]r¥9h<]r¦9h:]r§9hF]r¨9uhKj–9hd]r©9hrXpatchrª9…r«9}r¬9(h4UhKj 9ubahYhÁubhrXY could auto-do the patching in the constructor and unpatch in the destructor. This would be useful in itself, but violates TOOWTDI and would be unsafe for IronPython & PyPy (non-deterministic calling of destructors). Destructors aren't called in CPython where there are cycles, but a weak reference with a callback can be used to get round this.r­9…r®9}r¯9(h4XY could auto-do the patching in the constructor and unpatch in the destructor. This would be useful in itself, but violates TOOWTDI and would be unsafe for IronPython & PyPy (non-deterministic calling of destructors). Destructors aren't called in CPython where there are cycles, but a weak reference with a callback can be used to get round this.r°9hKj–9ubeubh£)r±9}r²9(h4X›`Mock` has several attributes. This makes it unsuitable for mocking objects that use these attribute names. A way round this would be to provide methods that *hide* these attributes when needed. In 0.8 many, but not all, of these attributes are renamed to gain a `_mock` prefix, making it less likely that they will clash. Any outstanding attributes that haven't been modified with the prefix should be changed.r³9hKj 9hXhBhYh§h5}r´9(h7]rµ9hD]r¶9h<]r·9h:]r¸9hF]r¹9uhbM®hchhd]rº9(h³)r»9}r¼9(h4X`Mock`r½9h5}r¾9(h7]r¿9hD]rÀ9h<]rÁ9h:]rÂ9hF]rÃ9uhKj±9hd]rÄ9hrXMockrÅ9…rÆ9}rÇ9(h4UhKj»9ubahYhÁubhrX˜ has several attributes. This makes it unsuitable for mocking objects that use these attribute names. A way round this would be to provide methods that rÈ9…rÉ9}rÊ9(h4X˜ has several attributes. This makes it unsuitable for mocking objects that use these attribute names. A way round this would be to provide methods that rË9hKj±9ubjd)rÌ9}rÍ9(h4X*hide*rÎ9h5}rÏ9(h7]rÐ9hD]rÑ9h<]rÒ9h:]rÓ9hF]rÔ9uhKj±9hd]rÕ9hrXhiderÖ9…r×9}rØ9(h4UhKjÌ9ubahYjrubhrXc these attributes when needed. In 0.8 many, but not all, of these attributes are renamed to gain a rÙ9…rÚ9}rÛ9(h4Xc these attributes when needed. In 0.8 many, but not all, of these attributes are renamed to gain a rÜ9hKj±9ubh³)rÝ9}rÞ9(h4X`_mock`rß9h5}rà9(h7]rá9hD]râ9h<]rã9h:]rä9hF]rå9uhKj±9hd]ræ9hrX_mockrç9…rè9}ré9(h4UhKjÝ9ubahYhÁubhrX prefix, making it less likely that they will clash. Any outstanding attributes that haven't been modified with the prefix should be changed.rê9…rë9}rì9(h4X prefix, making it less likely that they will clash. Any outstanding attributes that haven't been modified with the prefix should be changed.rí9hKj±9ubeubh£)rî9}rï9(h4XIf a patch is started using `patch.start` and then not stopped correctly then the unpatching is not done. Using weak references it would be possible to detect and fix this when the patch object itself is garbage collected. This would be tricky to get right though.rð9hKj 9hXhBhYh§h5}rñ9(h7]rò9hD]ró9h<]rô9h:]rõ9hF]rö9uhbMµhchhd]r÷9(hrXIf a patch is started using rø9…rù9}rú9(h4XIf a patch is started using rû9hKjî9ubh³)rü9}rý9(h4X `patch.start`rþ9h5}rÿ9(h7]r:hD]r:h<]r:h:]r:hF]r:uhKjî9hd]r:hrX patch.startr:…r:}r:(h4UhKjü9ubahYhÁubhrXß and then not stopped correctly then the unpatching is not done. Using weak references it would be possible to detect and fix this when the patch object itself is garbage collected. This would be tricky to get right though.r :…r :}r :(h4Xß and then not stopped correctly then the unpatching is not done. Using weak references it would be possible to detect and fix this when the patch object itself is garbage collected. This would be tricky to get right though.r :hKjî9ubeubh£)r :}r:(h4XWhen a `Mock` is created by `patch`, arbitrary keywords can be used to set attributes. If `patch` is created with a `spec`, and is replacing a class, then a `return_value` mock is created. The keyword arguments are not applied to the child mock, but could be.r:hKj 9hXhBhYh§h5}r:(h7]r:hD]r:h<]r:h:]r:hF]r:uhbMºhchhd]r:(hrXWhen a r:…r:}r:(h4XWhen a r:hKj :ubh³)r:}r:(h4X`Mock`r:h5}r:(h7]r:hD]r :h<]r!:h:]r":hF]r#:uhKj :hd]r$:hrXMockr%:…r&:}r':(h4UhKj:ubahYhÁubhrX is created by r(:…r):}r*:(h4X is created by r+:hKj :ubh³)r,:}r-:(h4X`patch`r.:h5}r/:(h7]r0:hD]r1:h<]r2:h:]r3:hF]r4:uhKj :hd]r5:hrXpatchr6:…r7:}r8:(h4UhKj,:ubahYhÁubhrX7, arbitrary keywords can be used to set attributes. If r9:…r::}r;:(h4X7, arbitrary keywords can be used to set attributes. If r<:hKj :ubh³)r=:}r>:(h4X`patch`r?:h5}r@:(h7]rA:hD]rB:h<]rC:h:]rD:hF]rE:uhKj :hd]rF:hrXpatchrG:…rH:}rI:(h4UhKj=:ubahYhÁubhrX is created with a rJ:…rK:}rL:(h4X is created with a rM:hKj :ubh³)rN:}rO:(h4X`spec`rP:h5}rQ:(h7]rR:hD]rS:h<]rT:h:]rU:hF]rV:uhKj :hd]rW:hrXspecrX:…rY:}rZ:(h4UhKjN:ubahYhÁubhrX#, and is replacing a class, then a r[:…r\:}r]:(h4X#, and is replacing a class, then a r^:hKj :ubh³)r_:}r`:(h4X`return_value`ra:h5}rb:(h7]rc:hD]rd:h<]re:h:]rf:hF]rg:uhKj :hd]rh:hrX return_valueri:…rj:}rk:(h4UhKj_:ubahYhÁubhrXX mock is created. The keyword arguments are not applied to the child mock, but could be.rl:…rm:}rn:(h4XX mock is created. The keyword arguments are not applied to the child mock, but could be.ro:hKj :ubeubh£)rp:}rq:(h4X¼When mocking a class with `patch`, passing in `spec=True` or `autospec=True`, the mock class has an instance created from the same spec. Should this be the default behaviour for mocks anyway (mock return values inheriting the spec from their parent), or should it be controlled by an additional keyword argument (`inherit`) to the Mock constructor? `create_autospec` does this, so an additional keyword argument to Mock is probably unnecessary.rr:hKj 9hXhBhYh§h5}rs:(h7]rt:hD]ru:h<]rv:h:]rw:hF]rx:uhbM¿hchhd]ry:(hrXWhen mocking a class with rz:…r{:}r|:(h4XWhen mocking a class with r}:hKjp:ubh³)r~:}r:(h4X`patch`r€:h5}r:(h7]r‚:hD]rƒ:h<]r„:h:]r…:hF]r†:uhKjp:hd]r‡:hrXpatchrˆ:…r‰:}rŠ:(h4UhKj~:ubahYhÁubhrX , passing in r‹:…rŒ:}r:(h4X , passing in rŽ:hKjp:ubh³)r:}r:(h4X `spec=True`r‘:h5}r’:(h7]r“:hD]r”:h<]r•:h:]r–:hF]r—:uhKjp:hd]r˜:hrX spec=Truer™:…rš:}r›:(h4UhKj:ubahYhÁubhrX or rœ:…r:}rž:(h4X or rŸ:hKjp:ubh³)r :}r¡:(h4X`autospec=True`r¢:h5}r£:(h7]r¤:hD]r¥:h<]r¦:h:]r§:hF]r¨:uhKjp:hd]r©:hrX autospec=Truerª:…r«:}r¬:(h4UhKj :ubahYhÁubhrXí, the mock class has an instance created from the same spec. Should this be the default behaviour for mocks anyway (mock return values inheriting the spec from their parent), or should it be controlled by an additional keyword argument (r­:…r®:}r¯:(h4Xí, the mock class has an instance created from the same spec. Should this be the default behaviour for mocks anyway (mock return values inheriting the spec from their parent), or should it be controlled by an additional keyword argument (r°:hKjp:ubh³)r±:}r²:(h4X `inherit`r³:h5}r´:(h7]rµ:hD]r¶:h<]r·:h:]r¸:hF]r¹:uhKjp:hd]rº:hrXinheritr»:…r¼:}r½:(h4UhKj±:ubahYhÁubhrX) to the Mock constructor? r¾:…r¿:}rÀ:(h4X) to the Mock constructor? rÁ:hKjp:ubh³)rÂ:}rÃ:(h4X`create_autospec`rÄ:h5}rÅ:(h7]rÆ:hD]rÇ:h<]rÈ:h:]rÉ:hF]rÊ:uhKjp:hd]rË:hrXcreate_autospecrÌ:…rÍ:}rÎ:(h4UhKjÂ:ubahYhÁubhrXN does this, so an additional keyword argument to Mock is probably unnecessary.rÏ:…rÐ:}rÑ:(h4XN does this, so an additional keyword argument to Mock is probably unnecessary.rÒ:hKjp:ubeubh£)rÓ:}rÔ:(h4XThe `mocksignature` argument to `patch` with a non `Mock` passed into `new_callable` will *probably* cause an error. Should it just be invalid?rÕ:hKj 9hXhBhYh§h5}rÖ:(h7]r×:hD]rØ:h<]rÙ:h:]rÚ:hF]rÛ:uhbMÆhchhd]rÜ:(hrXThe rÝ:…rÞ:}rß:(h4XThe rà:hKjÓ:ubh³)rá:}râ:(h4X`mocksignature`rã:h5}rä:(h7]rå:hD]ræ:h<]rç:h:]rè:hF]ré:uhKjÓ:hd]rê:hrX mocksignaturerë:…rì:}rí:(h4UhKjá:ubahYhÁubhrX argument to rî:…rï:}rð:(h4X argument to rñ:hKjÓ:ubh³)rò:}ró:(h4X`patch`rô:h5}rõ:(h7]rö:hD]r÷:h<]rø:h:]rù:hF]rú:uhKjÓ:hd]rû:hrXpatchrü:…rý:}rþ:(h4UhKjò:ubahYhÁubhrX with a non rÿ:…r;}r;(h4X with a non r;hKjÓ:ubh³)r;}r;(h4X`Mock`r;h5}r;(h7]r;hD]r;h<]r ;h:]r ;hF]r ;uhKjÓ:hd]r ;hrXMockr ;…r;}r;(h4UhKj;ubahYhÁubhrX passed into r;…r;}r;(h4X passed into r;hKjÓ:ubh³)r;}r;(h4X`new_callable`r;h5}r;(h7]r;hD]r;h<]r;h:]r;hF]r;uhKjÓ:hd]r;hrX new_callabler;…r;}r ;(h4UhKj;ubahYhÁubhrX will r!;…r";}r#;(h4X will r$;hKjÓ:ubjd)r%;}r&;(h4X *probably*r';h5}r(;(h7]r);hD]r*;h<]r+;h:]r,;hF]r-;uhKjÓ:hd]r.;hrXprobablyr/;…r0;}r1;(h4UhKj%;ubahYjrubhrX+ cause an error. Should it just be invalid?r2;…r3;}r4;(h4X+ cause an error. Should it just be invalid?r5;hKjÓ:ubeubh£)r6;}r7;(h4X¹Note that `NonCallableMock` and `NonCallableMagicMock` still have the unused (and unusable) attributes: `return_value`, `side_effect`, `call_count`, `call_args` and `call_args_list`. These could be removed or raise errors on getting / setting. They also have the `assert_called_with` and `assert_called_once_with` methods. Removing these would be pointless as fetching them would create a mock (attribute) that could be called without error.r8;hKj 9hXhBhYh§h5}r9;(h7]r:;hD]r;;h<]r<;h:]r=;hF]r>;uhbMÉhchhd]r?;(hrX Note that r@;…rA;}rB;(h4X Note that rC;hKj6;ubh³)rD;}rE;(h4X`NonCallableMock`rF;h5}rG;(h7]rH;hD]rI;h<]rJ;h:]rK;hF]rL;uhKj6;hd]rM;hrXNonCallableMockrN;…rO;}rP;(h4UhKjD;ubahYhÁubhrX and rQ;…rR;}rS;(h4X and rT;hKj6;ubh³)rU;}rV;(h4X`NonCallableMagicMock`rW;h5}rX;(h7]rY;hD]rZ;h<]r[;h:]r\;hF]r];uhKj6;hd]r^;hrXNonCallableMagicMockr_;…r`;}ra;(h4UhKjU;ubahYhÁubhrX2 still have the unused (and unusable) attributes: rb;…rc;}rd;(h4X2 still have the unused (and unusable) attributes: re;hKj6;ubh³)rf;}rg;(h4X`return_value`rh;h5}ri;(h7]rj;hD]rk;h<]rl;h:]rm;hF]rn;uhKj6;hd]ro;hrX return_valuerp;…rq;}rr;(h4UhKjf;ubahYhÁubhrX, rs;…rt;}ru;(h4X, rv;hKj6;ubh³)rw;}rx;(h4X `side_effect`ry;h5}rz;(h7]r{;hD]r|;h<]r};h:]r~;hF]r;uhKj6;hd]r€;hrX side_effectr;…r‚;}rƒ;(h4UhKjw;ubahYhÁubhrX, r„;…r…;}r†;(h4X, r‡;hKj6;ubh³)rˆ;}r‰;(h4X `call_count`rŠ;h5}r‹;(h7]rŒ;hD]r;h<]rŽ;h:]r;hF]r;uhKj6;hd]r‘;hrX call_countr’;…r“;}r”;(h4UhKjˆ;ubahYhÁubhrX, r•;…r–;}r—;(h4X, r˜;hKj6;ubh³)r™;}rš;(h4X `call_args`r›;h5}rœ;(h7]r;hD]rž;h<]rŸ;h:]r ;hF]r¡;uhKj6;hd]r¢;hrX call_argsr£;…r¤;}r¥;(h4UhKj™;ubahYhÁubhrX and r¦;…r§;}r¨;(h4X and r©;hKj6;ubh³)rª;}r«;(h4X`call_args_list`r¬;h5}r­;(h7]r®;hD]r¯;h<]r°;h:]r±;hF]r²;uhKj6;hd]r³;hrXcall_args_listr´;…rµ;}r¶;(h4UhKjª;ubahYhÁubhrXR. These could be removed or raise errors on getting / setting. They also have the r·;…r¸;}r¹;(h4XR. These could be removed or raise errors on getting / setting. They also have the rº;hKj6;ubh³)r»;}r¼;(h4X`assert_called_with`r½;h5}r¾;(h7]r¿;hD]rÀ;h<]rÁ;h:]rÂ;hF]rÃ;uhKj6;hd]rÄ;hrXassert_called_withrÅ;…rÆ;}rÇ;(h4UhKj»;ubahYhÁubhrX and rÈ;…rÉ;}rÊ;(h4X and rË;hKj6;ubh³)rÌ;}rÍ;(h4X`assert_called_once_with`rÎ;h5}rÏ;(h7]rÐ;hD]rÑ;h<]rÒ;h:]rÓ;hF]rÔ;uhKj6;hd]rÕ;hrXassert_called_once_withrÖ;…r×;}rØ;(h4UhKjÌ;ubahYhÁubhrX€ methods. Removing these would be pointless as fetching them would create a mock (attribute) that could be called without error.rÙ;…rÚ;}rÛ;(h4X€ methods. Removing these would be pointless as fetching them would create a mock (attribute) that could be called without error.rÜ;hKj6;ubeubh£)rÝ;}rÞ;(h4XÂSome outstanding technical debt. The way autospeccing mocks function signatures was copied and modified from `mocksignature`. This could all be refactored into one set of functions instead of two. The way we tell if patchers are started and if a patcher is being used for a `patch.multiple` call are both horrible. There are now a host of helper functions that should be rationalised. (Probably time to split mock into a package instead of a module.)rß;hKj 9hXhBhYh§h5}rà;(h7]rá;hD]râ;h<]rã;h:]rä;hF]rå;uhbMÑhchhd]ræ;(hrXmSome outstanding technical debt. The way autospeccing mocks function signatures was copied and modified from rç;…rè;}ré;(h4XmSome outstanding technical debt. The way autospeccing mocks function signatures was copied and modified from rê;hKjÝ;ubh³)rë;}rì;(h4X`mocksignature`rí;h5}rî;(h7]rï;hD]rð;h<]rñ;h:]rò;hF]ró;uhKjÝ;hd]rô;hrX mocksignaturerõ;…rö;}r÷;(h4UhKjë;ubahYhÁubhrX–. This could all be refactored into one set of functions instead of two. The way we tell if patchers are started and if a patcher is being used for a rø;…rù;}rú;(h4X–. This could all be refactored into one set of functions instead of two. The way we tell if patchers are started and if a patcher is being used for a rû;hKjÝ;ubh³)rü;}rý;(h4X`patch.multiple`rþ;h5}rÿ;(h7]r<hD]r<h<]r<h:]r<hF]r<uhKjÝ;hd]r<hrXpatch.multipler<…r<}r<(h4UhKjü;ubahYhÁubhrX  call are both horrible. There are now a host of helper functions that should be rationalised. (Probably time to split mock into a package instead of a module.)r <…r <}r <(h4X  call are both horrible. There are now a host of helper functions that should be rationalised. (Probably time to split mock into a package instead of a module.)r <hKjÝ;ubeubh£)r <}r<(h4X‡Passing arbitrary keyword arguments to `create_autospec`, or `patch` with `autospec`, when mocking a *function* works fine. However, the arbitrary attributes are set on the created mock - but `create_autospec` returns a real function (which doesn't have those attributes). However, what is the use case for using autospec to create functions with attributes that don't exist on the original?r<hKj 9hXhBhYh§h5}r<(h7]r<hD]r<h<]r<h:]r<hF]r<uhbMÙhchhd]r<(hrX'Passing arbitrary keyword arguments to r<…r<}r<(h4X'Passing arbitrary keyword arguments to r<hKj <ubh³)r<}r<(h4X`create_autospec`r<h5}r<(h7]r<hD]r <h<]r!<h:]r"<hF]r#<uhKj <hd]r$<hrXcreate_autospecr%<…r&<}r'<(h4UhKj<ubahYhÁubhrX, or r(<…r)<}r*<(h4X, or r+<hKj <ubh³)r,<}r-<(h4X`patch`r.<h5}r/<(h7]r0<hD]r1<h<]r2<h:]r3<hF]r4<uhKj <hd]r5<hrXpatchr6<…r7<}r8<(h4UhKj,<ubahYhÁubhrX with r9<…r:<}r;<(h4X with r<<hKj <ubh³)r=<}r><(h4X `autospec`r?<h5}r@<(h7]rA<hD]rB<h<]rC<h:]rD<hF]rE<uhKj <hd]rF<hrXautospecrG<…rH<}rI<(h4UhKj=<ubahYhÁubhrX, when mocking a rJ<…rK<}rL<(h4X, when mocking a rM<hKj <ubjd)rN<}rO<(h4X *function*rP<h5}rQ<(h7]rR<hD]rS<h<]rT<h:]rU<hF]rV<uhKj <hd]rW<hrXfunctionrX<…rY<}rZ<(h4UhKjN<ubahYjrubhrXQ works fine. However, the arbitrary attributes are set on the created mock - but r[<…r\<}r]<(h4XQ works fine. However, the arbitrary attributes are set on the created mock - but r^<hKj <ubh³)r_<}r`<(h4X`create_autospec`ra<h5}rb<(h7]rc<hD]rd<h<]re<h:]rf<hF]rg<uhKj <hd]rh<hrXcreate_autospecri<…rj<}rk<(h4UhKj_<ubahYhÁubhrX¶ returns a real function (which doesn't have those attributes). However, what is the use case for using autospec to create functions with attributes that don't exist on the original?rl<…rm<}rn<(h4X¶ returns a real function (which doesn't have those attributes). However, what is the use case for using autospec to create functions with attributes that don't exist on the original?ro<hKj <ubeubh£)rp<}rq<(h4Xk`mocksignature`, plus the `call_args_list` and `method_calls` attributes of `Mock` could all be deprecated.rr<hKj 9hXhBhYh§h5}rs<(h7]rt<hD]ru<h<]rv<h:]rw<hF]rx<uhbMàhchhd]ry<(h³)rz<}r{<(h4X`mocksignature`r|<h5}r}<(h7]r~<hD]r<h<]r€<h:]r<hF]r‚<uhKjp<hd]rƒ<hrX mocksignaturer„<…r…<}r†<(h4UhKjz<ubahYhÁubhrX , plus the r‡<…rˆ<}r‰<(h4X , plus the rŠ<hKjp<ubh³)r‹<}rŒ<(h4X`call_args_list`r<h5}rŽ<(h7]r<hD]r<h<]r‘<h:]r’<hF]r“<uhKjp<hd]r”<hrXcall_args_listr•<…r–<}r—<(h4UhKj‹<ubahYhÁubhrX and r˜<…r™<}rš<(h4X and r›<hKjp<ubh³)rœ<}r<(h4X`method_calls`rž<h5}rŸ<(h7]r <hD]r¡<h<]r¢<h:]r£<hF]r¤<uhKjp<hd]r¥<hrX method_callsr¦<…r§<}r¨<(h4UhKjœ<ubahYhÁubhrX attributes of r©<…rª<}r«<(h4X attributes of r¬<hKjp<ubh³)r­<}r®<(h4X`Mock`r¯<h5}r°<(h7]r±<hD]r²<h<]r³<h:]r´<hF]rµ<uhKjp<hd]r¶<hrXMockr·<…r¸<}r¹<(h4UhKj­<ubahYhÁubhrX could all be deprecated.rº<…r»<}r¼<(h4X could all be deprecated.r½<hKjp<ubeubeubeh4UU transformerr¾<NU footnote_refsr¿<}rÀ<UrefnamesrÁ<}rÂ<Usymbol_footnotesrÃ<]rÄ<Uautofootnote_refsrÅ<]rÆ<Usymbol_footnote_refsrÇ<]rÈ<U citationsrÉ<]rÊ<hchU current_linerË<NUtransform_messagesrÌ<]rÍ<UreporterrÎ<NUid_startrÏ<KU autofootnotesrÐ<]rÑ<U citation_refsrÒ<}rÓ<Uindirect_targetsrÔ<]rÕ<UsettingsrÖ<(cdocutils.frontend Values r×<orØ<}rÙ<(Ufootnote_backlinksrÚ<KUrecord_dependenciesrÛ<NU rfc_base_urlrÜ<Uhttp://tools.ietf.org/html/rÝ<U tracebackrÞ<ˆUpep_referencesrß<NUstrip_commentsrà<NU toc_backlinksrá<Uentryrâ<U language_coderã<Uenrä<U datestamprå<NU report_levelræ<KU _destinationrç<NU halt_levelrè<KU strip_classesré<NhjNUerror_encoding_error_handlerrê<Ubackslashreplacerë<Udebugrì<NUembed_stylesheetrí<‰Uoutput_encoding_error_handlerrî<Ustrictrï<U sectnum_xformrð<KUdump_transformsrñ<NU docinfo_xformrò<KUwarning_streamró<NUpep_file_url_templaterô<Upep-%04drõ<Uexit_status_levelrö<KUconfigr÷<NUstrict_visitorrø<NUcloak_email_addressesrù<ˆUtrim_footnote_reference_spacerú<‰Uenvrû<NUdump_pseudo_xmlrü<NUexpose_internalsrý<NUsectsubtitle_xformrþ<‰U source_linkrÿ<NUrfc_referencesr=NUoutput_encodingr=Uutf-8r=U source_urlr=NUinput_encodingr=U utf-8-sigr=U_disable_configr=NU id_prefixr=UU tab_widthr=KUerror_encodingr =U mac-romanr =U_sourcer =U /compile/mock/docs/changelog.txtr =Ugettext_compactr =ˆU generatorr=NUdump_internalsr=NU pep_base_urlr=Uhttp://www.python.org/dev/peps/r=Usyntax_highlightr=Ushortr=Uinput_encoding_error_handlerr=jï<Uauto_id_prefixr=Uidr=Udoctitle_xformr=‰Ustrip_elements_with_classesr=NU _config_filesr=]r=Ufile_insertion_enabledr=KU raw_enabledr=KU dump_settingsr=NubUsymbol_footnote_startr=KUidsr=}r =(jíjæj 9jp9jj j4j4jf4j_4jðjéjÉjÂj1j1j9j 9jÑ)jË)jÌ4jÅ4h`hVj jˆ h>jå8j2*j,*j½2j¶2j´5j­5jŽ0j‡0jº8j´8jYjQj“$j$jC*j<*jÞjØj9j2jÖ5hTjì/jå/jP-jI-j+jú*h}hvjjjÙ#jÒ#j_$jX$j\#jU#j(j!jjj5j 5j·j°j•jŽjŠjƒj¤juUsubstitution_namesr!=}r"=hYhch5}r#=(h7]r$=h:]r%=h<]r&=Usourcer'=hBhD]r(=hF]r)=uU footnotesr*=]r+=Urefidsr,=}r-=ub.mock-1.0.1/html/.doctrees/compare.doctree0000644000076500001200000015712312046030506021005 0ustar michaeladmin00000000000000€cdocutils.nodes document q)q}q(U nametypesq}q(XflexmockqˆX#call the same method multiple timesqNX gary bernhadtqˆX'ensure calls are made in specific orderq NX simple mockq NX!override new instances of a classq NXflexmock and mockq ˆXmocking a context managerq NXpmockqˆXraising exceptionsqNXmock chained methodsqNXfudgeqˆX python-mockqˆXmoxqˆX2mocking the builtin open used as a context managerqNXminimockqˆXmockerqˆX mox projectqˆXcreating partial mocksqNXdingusqˆXsimple fake objectqNXpython mock library comparisonqˆXkumar mcmillanqˆXmock issue trackerqˆXmock library comparisonqNuUsubstitution_defsq}q Uparse_messagesq!]q"Ucurrent_sourceq#NU decorationq$NUautofootnote_startq%KUnameidsq&}q'(hUflexmockq(hU#call-the-same-method-multiple-timesq)hU gary-bernhadtq*h U'ensure-calls-are-made-in-specific-orderq+h U simple-mockq,h U!override-new-instances-of-a-classq-h Uflexmock-and-mockq.h Umocking-a-context-managerq/hUpmockq0hUraising-exceptionsq1hUmock-chained-methodsq2hUfudgeq3hU python-mockq4hUmoxq5hU2mocking-the-builtin-open-used-as-a-context-managerq6hUminimockq7hUmockerq8hU mox-projectq9hUcreating-partial-mocksq:hUdingusq;hUsimple-fake-objectqhUmock-issue-trackerq?hUmock-library-comparisonq@uUchildrenqA]qBcdocutils.nodes section qC)qD}qE(U rawsourceqFUUparentqGhUsourceqHcdocutils.nodes reprunicode qIX/compile/mock/docs/compare.txtqJ…qK}qLbUtagnameqMUsectionqNU attributesqO}qP(UdupnamesqQ]qRUclassesqS]qTUbackrefsqU]qVUidsqW]qXh@aUnamesqY]qZhauUlineq[KUdocumentq\hhA]q](cdocutils.nodes title q^)q_}q`(hFXMock Library ComparisonqahGhDhHhKhMUtitleqbhO}qc(hQ]qdhS]qehU]qfhW]qghY]qhuh[Kh\hhA]qicdocutils.nodes Text qjXMock Library Comparisonqk…ql}qm(hFhahGh_ubaubcdocutils.nodes comment qn)qo}qp(hFXdef assertEqual(a, b): assert a == b, ("%r != %r" % (a, b)) def assertRaises(Exc, func): try: func() except Exc: return assert False, ("%s not raised" % Exc) sys.modules['somemodule'] = somemodule = mock.Mock(name='somemodule') class SomeException(Exception): some_method = method1 = method2 = None some_other_object = SomeObject = SomeExceptionqqhGhDhHhKhMUcommentqrhO}qs(U testnodetypeqtX testsetupquU xml:spaceqvUpreserveqwhW]qxhU]qyhQ]qzhS]q{hY]q|Ugroupsq}]q~UdefaultqaUoptionsq€}quh[Kh\hhA]q‚hjXdef assertEqual(a, b): assert a == b, ("%r != %r" % (a, b)) def assertRaises(Exc, func): try: func() except Exc: return assert False, ("%s not raised" % Exc) sys.modules['somemodule'] = somemodule = mock.Mock(name='somemodule') class SomeException(Exception): some_method = method1 = method2 = None some_other_object = SomeObject = SomeExceptionqƒ…q„}q…(hFUhGhoubaubcdocutils.nodes paragraph q†)q‡}qˆ(hFX‰A side-by-side comparison of how to accomplish some basic tasks with mock and some other popular Python mocking libraries and frameworks.q‰hGhDhHhKhMU paragraphqŠhO}q‹(hQ]qŒhS]qhU]qŽhW]qhY]quh[Kh\hhA]q‘hjX‰A side-by-side comparison of how to accomplish some basic tasks with mock and some other popular Python mocking libraries and frameworks.q’…q“}q”(hFh‰hGh‡ubaubh†)q•}q–(hFX These are:q—hGhDhHhKhMhŠhO}q˜(hQ]q™hS]qšhU]q›hW]qœhY]quh[Kh\hhA]qžhjX These are:qŸ…q }q¡(hFh—hGh•ubaubcdocutils.nodes bullet_list q¢)q£}q¤(hFUhGhDhHhKhMU bullet_listq¥hO}q¦(Ubulletq§X*hW]q¨hU]q©hQ]qªhS]q«hY]q¬uh[Kh\hhA]q­(cdocutils.nodes list_item q®)q¯}q°(hFX2`flexmock `_q±hGh£hHhKhMU list_itemq²hO}q³(hQ]q´hS]qµhU]q¶hW]q·hY]q¸uh[Nh\hhA]q¹h†)qº}q»(hFh±hGh¯hHhKhMhŠhO}q¼(hQ]q½hS]q¾hU]q¿hW]qÀhY]qÁuh[KhA]qÂ(cdocutils.nodes reference qÃ)qÄ}qÅ(hFh±hO}qÆ(UnameqÇXflexmockqÈUrefuriqÉX$http://pypi.python.org/pypi/flexmockqÊhW]qËhU]qÌhQ]qÍhS]qÎhY]qÏuhGhºhA]qÐhjXflexmockqÑ…qÒ}qÓ(hFUhGhÄubahMU referenceqÔubcdocutils.nodes target qÕ)qÖ}q×(hFX' qØU referencedqÙKhGhºhMUtargetqÚhO}qÛ(UrefuriqÜhÊhW]qÝh(ahU]qÞhQ]qßhS]qàhY]qáhauhA]qâubeubaubh®)qã}qä(hFX(`mox `_qåhGh£hHhKhMh²hO}qæ(hQ]qçhS]qèhU]qéhW]qêhY]qëuh[Nh\hhA]qìh†)qí}qî(hFhåhGhãhHhKhMhŠhO}qï(hQ]qðhS]qñhU]qòhW]qóhY]qôuh[KhA]qõ(hÃ)qö}q÷(hFhåhO}qø(UnameqùXmoxqúhÉXhttp://pypi.python.org/pypi/moxqûhW]qühU]qýhQ]qþhS]qÿhY]ruhGhíhA]rhjXmoxr…r}r(hFUhGhöubahMhÔubhÕ)r}r(hFX" rhÙKhGhíhMhÚhO}r(Urefurir hûhW]r h5ahU]r hQ]r hS]r hY]rhauhA]rubeubaubh®)r}r(hFX&`Mocker `_rhGh£hHhKhMh²hO}r(hQ]rhS]rhU]rhW]rhY]ruh[Nh\hhA]rh†)r}r(hFjhGjhHhKhMhŠhO}r(hQ]rhS]rhU]rhW]r hY]r!uh[KhA]r"(hÃ)r#}r$(hFjhO}r%(Unamer&XMockerr'hÉXhttp://niemeyer.net/mockerr(hW]r)hU]r*hQ]r+hS]r,hY]r-uhGjhA]r.hjXMockerr/…r0}r1(hFUhGj#ubahMhÔubhÕ)r2}r3(hFX r4hÙKhGjhMhÚhO}r5(Urefurir6j(hW]r7h8ahU]r8hQ]r9hS]r:hY]r;hauhA]r<ubeubaubh®)r=}r>(hFX.`dingus `_r?hGh£hHhKhMh²hO}r@(hQ]rAhS]rBhU]rChW]rDhY]rEuh[Nh\hhA]rFh†)rG}rH(hFj?hGj=hHhKhMhŠhO}rI(hQ]rJhS]rKhU]rLhW]rMhY]rNuh[K hA]rO(hÃ)rP}rQ(hFj?hO}rR(UnamerSXdingusrThÉX"http://pypi.python.org/pypi/dingusrUhW]rVhU]rWhQ]rXhS]rYhY]rZuhGjGhA]r[hjXdingusr\…r]}r^(hFUhGjPubahMhÔubhÕ)r_}r`(hFX% rahÙKhGjGhMhÚhO}rb(UrefurircjUhW]rdh;ahU]rehQ]rfhS]rghY]rhhauhA]riubeubaubh®)rj}rk(hFX-`fudge `_ rlhGh£hHhKhMh²hO}rm(hQ]rnhS]rohU]rphW]rqhY]rruh[Nh\hhA]rsh†)rt}ru(hFX,`fudge `_rvhGjjhHhKhMhŠhO}rw(hQ]rxhS]ryhU]rzhW]r{hY]r|uh[K!hA]r}(hÃ)r~}r(hFjvhO}r€(UnamerXfudger‚hÉX!http://pypi.python.org/pypi/fudgerƒhW]r„hU]r…hQ]r†hS]r‡hY]rˆuhGjthA]r‰hjXfudgerŠ…r‹}rŒ(hFUhGj~ubahMhÔubhÕ)r}rŽ(hFX$ rhÙKhGjthMhÚhO}r(Urefurir‘jƒhW]r’h3ahU]r“hQ]r”hS]r•hY]r–hauhA]r—ubeubaubeubh†)r˜}r™(hFXvPopular python mocking frameworks not yet represented here include `MiniMock `_.ršhGhDhHhKhMhŠhO}r›(hQ]rœhS]rhU]ržhW]rŸhY]r uh[K#h\hhA]r¡(hjXCPopular python mocking frameworks not yet represented here include r¢…r£}r¤(hFXCPopular python mocking frameworks not yet represented here include r¥hGj˜ubhÃ)r¦}r§(hFX2`MiniMock `_r¨hO}r©(UnamerªXMiniMockr«hÉX$http://pypi.python.org/pypi/MiniMockr¬hW]r­hU]r®hQ]r¯hS]r°hY]r±uhGj˜hA]r²hjXMiniMockr³…r´}rµ(hFUhGj¦ubahMhÔubhÕ)r¶}r·(hFX' r¸hÙKhGj˜hMhÚhO}r¹(Urefurirºj¬hW]r»h7ahU]r¼hQ]r½hS]r¾hY]r¿hauhA]rÀubhjX.…rÁ}rÂ(hFX.hGj˜ubeubh†)rÃ}rÄ(hFXÔ`pMock `_ (last release 2004 and doesn't import in recent versions of Python) and `python-mock `_ (last release 2005) are intentionally omitted.rÅhGhDhHhKhMhŠhO}rÆ(hQ]rÇhS]rÈhU]rÉhW]rÊhY]rËuh[K&h\hhA]rÌ(hÃ)rÍ}rÎ(hFX(`pMock `_rÏhO}rÐ(UnamerÑXpMockrÒhÉXhttp://pmock.sourceforge.net/rÓhW]rÔhU]rÕhQ]rÖhS]r×hY]rØuhGjÃhA]rÙhjXpMockrÚ…rÛ}rÜ(hFUhGjÍubahMhÔubhÕ)rÝ}rÞ(hFX rßhÙKhGjÃhMhÚhO}rà(UrefurirájÓhW]râh0ahU]rãhQ]rähS]råhY]ræhauhA]rçubhjXI (last release 2004 and doesn't import in recent versions of Python) and rè…ré}rê(hFXI (last release 2004 and doesn't import in recent versions of Python) and rëhGjÃubhÃ)rì}rí(hFX4`python-mock `_rîhO}rï(UnamerðX python-mockrñhÉX#http://python-mock.sourceforge.net/ròhW]róhU]rôhQ]rõhS]röhY]r÷uhGjÃhA]røhjX python-mockrù…rú}rû(hFUhGjìubahMhÔubhÕ)rü}rý(hFX& rþhÙKhGjÃhMhÚhO}rÿ(UrefurirjòhW]rh4ahU]rhQ]rhS]rhY]rhauhA]rubhjX/ (last release 2005) are intentionally omitted.r…r}r (hFX/ (last release 2005) are intentionally omitted.r hGjÃubeubcdocutils.nodes note r )r }r (hFXA more up to date, and tested for all mock libraries (only the mock examples on this page can be executed as doctests) version of this comparison is maintained by Gary Bernhardt: * `Python Mock Library Comparison `_rhGhDhHNhMUnoterhO}r(hQ]rhS]rhU]rhW]rhY]ruh[Nh\hhA]r(h†)r}r(hFX²A more up to date, and tested for all mock libraries (only the mock examples on this page can be executed as doctests) version of this comparison is maintained by Gary Bernhardt:rhGj hHhKhMhŠhO}r(hQ]rhS]rhU]rhW]rhY]ruh[K-hA]r hjX²A more up to date, and tested for all mock libraries (only the mock examples on this page can be executed as doctests) version of this comparison is maintained by Gary Bernhardt:r!…r"}r#(hFjhGjubaubh¢)r$}r%(hFUhO}r&(h§X*hW]r'hU]r(hQ]r)hS]r*hY]r+uhGj hA]r,h®)r-}r.(hFX[`Python Mock Library Comparison `_r/hO}r0(hQ]r1hS]r2hU]r3hW]r4hY]r5uhGj$hA]r6h†)r7}r8(hFX[`Python Mock Library Comparison `_r9hGj-hHhKhMhŠhO}r:(hQ]r;hS]r<hU]r=hW]r>hY]r?uh[K1hA]r@(hÃ)rA}rB(hFj9hO}rC(UnamerDXPython Mock Library ComparisonrEhÉX7http://garybernhardt.github.com/python-mock-comparison/rFhW]rGhU]rHhQ]rIhS]rJhY]rKuhGj7hA]rLhjXPython Mock Library ComparisonrM…rN}rO(hFUhGjAubahMhÔubhÕ)rP}rQ(hFX: rRhÙKhGj7hMhÚhO}rS(UrefurirTjFhW]rUh=ahU]rVhQ]rWhS]rXhY]rYhauhA]rZubeubahMh²ubahMh¥ubeubh†)r[}r\(hFXThis comparison is by no means complete, and also may not be fully idiomatic for all the libraries represented. *Please* contribute corrections, missing comparisons, or comparisons for additional libraries to the `mock issue tracker `_.r]hGhDhHhKhMhŠhO}r^(hQ]r_hS]r`hU]rahW]rbhY]rcuh[K4h\hhA]rd(hjXpThis comparison is by no means complete, and also may not be fully idiomatic for all the libraries represented. re…rf}rg(hFXpThis comparison is by no means complete, and also may not be fully idiomatic for all the libraries represented. rhhGj[ubcdocutils.nodes emphasis ri)rj}rk(hFX*Please*rlhO}rm(hQ]rnhS]rohU]rphW]rqhY]rruhGj[hA]rshjXPleasert…ru}rv(hFUhGjjubahMUemphasisrwubhjX] contribute corrections, missing comparisons, or comparisons for additional libraries to the rx…ry}rz(hFX] contribute corrections, missing comparisons, or comparisons for additional libraries to the r{hGj[ubhÃ)r|}r}(hFXB`mock issue tracker `_r~hO}r(Unamer€Xmock issue trackerrhÉX*https://code.google.com/p/mock/issues/listr‚hW]rƒhU]r„hQ]r…hS]r†hY]r‡uhGj[hA]rˆhjXmock issue trackerr‰…rŠ}r‹(hFUhGj|ubahMhÔubhÕ)rŒ}r(hFX- rŽhÙKhGj[hMhÚhO}r(Urefurirj‚hW]r‘h?ahU]r’hQ]r“hS]r”hY]r•hauhA]r–ubhjX.…r—}r˜(hFX.hGj[ubeubh†)r™}rš(hFX”This comparison page was originally created by the `Mox project `_ and then extended for `flexmock and mock `_ by Herman Sheremetyev. Dingus examples written by `Gary Bernhadt `_. fudge examples provided by `Kumar McMillan `_.r›hGhDhHhKhMhŠhO}rœ(hQ]rhS]ržhU]rŸhW]r hY]r¡uh[K9h\hhA]r¢(hjX3This comparison page was originally created by the r£…r¤}r¥(hFX3This comparison page was originally created by the r¦hGj™ubhÃ)r§}r¨(hFXC`Mox project `_r©hO}rª(Unamer«X Mox projectr¬hÉX2https://code.google.com/p/pymox/wiki/MoxComparisonr­hW]r®hU]r¯hQ]r°hS]r±hY]r²uhGj™hA]r³hjX Mox projectr´…rµ}r¶(hFUhGj§ubahMhÔubhÕ)r·}r¸(hFX5 r¹hÙKhGj™hMhÚhO}rº(Urefurir»j­hW]r¼h9ahU]r½hQ]r¾hS]r¿hY]rÀhauhA]rÁubhjX and then extended for rÂ…rÃ}rÄ(hFX and then extended for rÅhGj™ubhÃ)rÆ}rÇ(hFXE`flexmock and mock `_rÈhO}rÉ(UnamerÊXflexmock and mockrËhÉX.http://has207.github.com/flexmock/compare.htmlrÌhW]rÍhU]rÎhQ]rÏhS]rÐhY]rÑuhGj™hA]rÒhjXflexmock and mockrÓ…rÔ}rÕ(hFUhGjÆubahMhÔubhÕ)rÖ}r×(hFX1 rØhÙKhGj™hMhÚhO}rÙ(UrefurirÚjÌhW]rÛh.ahU]rÜhQ]rÝhS]rÞhY]rßh auhA]ràubhjX3 by Herman Sheremetyev. Dingus examples written by rá…râ}rã(hFX3 by Herman Sheremetyev. Dingus examples written by rähGj™ubhÃ)rå}ræ(hFXJ`Gary Bernhadt `_rçhO}rè(UnameréX Gary BernhadtrêhÉX7http://garybernhardt.github.com/python-mock-comparison/rëhW]rìhU]ríhQ]rîhS]rïhY]rðuhGj™hA]rñhjX Gary Bernhadtrò…ró}rô(hFUhGjåubahMhÔubhÕ)rõ}rö(hFX: r÷hÙKhGj™hMhÚhO}rø(UrefurirùjëhW]rúh*ahU]rûhQ]rühS]rýhY]rþhauhA]rÿubhjX. fudge examples provided by r…r}r(hFX. fudge examples provided by rhGj™ubhÃ)r}r(hFX'`Kumar McMillan `_rhO}r(UnamerXKumar McMillanr hÉXhttp://farmdev.com/r hW]r hU]r hQ]r hS]rhY]ruhGj™hA]rhjXKumar McMillanr…r}r(hFUhGjubahMhÔubhÕ)r}r(hFX rhÙKhGj™hMhÚhO}r(Urefurirj hW]rh>ahU]rhQ]rhS]rhY]rhauhA]rubhjX.…r}r (hFX.hGj™ubeubj )r!}r"(hFX¬The examples tasks here were originally created by Mox which is a mocking *framework* rather than a library like mock. The tasks shown naturally exemplify tasks that frameworks are good at and not the ones they make harder. In particular you can take a `Mock` or `MagicMock` object and use it in any way you want with no up-front configuration. The same is also true for Dingus. The examples for mock here assume version 0.7.0.r#hGhDhHhKhMjhO}r$(hQ]r%hS]r&hU]r'hW]r(hY]r)uh[Nh\hhA]r*(h†)r+}r,(hFXzThe examples tasks here were originally created by Mox which is a mocking *framework* rather than a library like mock. The tasks shown naturally exemplify tasks that frameworks are good at and not the ones they make harder. In particular you can take a `Mock` or `MagicMock` object and use it in any way you want with no up-front configuration. The same is also true for Dingus.r-hGj!hHhKhMhŠhO}r.(hQ]r/hS]r0hU]r1hW]r2hY]r3uh[KBhA]r4(hjXJThe examples tasks here were originally created by Mox which is a mocking r5…r6}r7(hFXJThe examples tasks here were originally created by Mox which is a mocking r8hGj+ubji)r9}r:(hFX *framework*r;hO}r<(hQ]r=hS]r>hU]r?hW]r@hY]rAuhGj+hA]rBhjX frameworkrC…rD}rE(hFUhGj9ubahMjwubhjX¨ rather than a library like mock. The tasks shown naturally exemplify tasks that frameworks are good at and not the ones they make harder. In particular you can take a rF…rG}rH(hFX¨ rather than a library like mock. The tasks shown naturally exemplify tasks that frameworks are good at and not the ones they make harder. In particular you can take a rIhGj+ubcdocutils.nodes title_reference rJ)rK}rL(hFX`Mock`rMhO}rN(hQ]rOhS]rPhU]rQhW]rRhY]rSuhGj+hA]rThjXMockrU…rV}rW(hFUhGjKubahMUtitle_referencerXubhjX or rY…rZ}r[(hFX or r\hGj+ubjJ)r]}r^(hFX `MagicMock`r_hO}r`(hQ]rahS]rbhU]rchW]rdhY]reuhGj+hA]rfhjX MagicMockrg…rh}ri(hFUhGj]ubahMjXubhjXh object and use it in any way you want with no up-front configuration. The same is also true for Dingus.rj…rk}rl(hFXh object and use it in any way you want with no up-front configuration. The same is also true for Dingus.rmhGj+ubeubh†)rn}ro(hFX0The examples for mock here assume version 0.7.0.rphGj!hHhKhMhŠhO}rq(hQ]rrhS]rshU]rthW]ruhY]rvuh[KIhA]rwhjX0The examples for mock here assume version 0.7.0.rx…ry}rz(hFjphGjnubaubeubhC)r{}r|(hFUhGhDhHhKhMhNhO}r}(hQ]r~hS]rhU]r€hW]rh>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.return_value = "calculated value" >>> my_mock.some_attribute = "value" >>> assertEqual("calculated value", my_mock.some_method()) >>> assertEqual("value", my_mock.some_attribute)r”hGj{hHhKhMU literal_blockr•hO}r–(U testnodetyper—Xdoctestr˜hvhwhW]r™hU]ršhQ]r›hS]rœhY]rUgroupsrž]rŸhah€}r uh[KOh\hhA]r¡hjXï>>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.return_value = "calculated value" >>> my_mock.some_attribute = "value" >>> assertEqual("calculated value", my_mock.some_method()) >>> assertEqual("value", my_mock.some_attribute)r¢…r£}r¤(hFUhGj’ubaubj‘)r¥}r¦(hFXw# Flexmock mock = flexmock(some_method=lambda: "calculated value", some_attribute="value") assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) # Mox mock = mox.MockAnything() mock.some_method().AndReturn("calculated value") mock.some_attribute = "value" mox.Replay(mock) assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) # Mocker mock = mocker.mock() mock.some_method() mocker.result("calculated value") mocker.replay() mock.some_attribute = "value" assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute)r§hGj{hHhKhMj•hO}r¨(hvhwhW]r©hU]rªhQ]r«hS]r¬hY]r­uh[KZh\hhA]r®hjXw# Flexmock mock = flexmock(some_method=lambda: "calculated value", some_attribute="value") assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) # Mox mock = mox.MockAnything() mock.some_method().AndReturn("calculated value") mock.some_attribute = "value" mox.Replay(mock) assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) # Mocker mock = mocker.mock() mock.some_method() mocker.result("calculated value") mocker.replay() mock.some_attribute = "value" assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute)r¯…r°}r±(hFUhGj¥ubaubj‘)r²}r³(hFXù>>> # Dingus >>> my_dingus = dingus.Dingus(some_attribute="value", ... some_method__returns="calculated value") >>> assertEqual("calculated value", my_dingus.some_method()) >>> assertEqual("value", my_dingus.some_attribute)r´hGj{hHhKhMj•hO}rµ(hvhwhW]r¶hU]r·hQ]r¸hS]r¹hY]rºuh[Krh\hhA]r»hjXù>>> # Dingus >>> my_dingus = dingus.Dingus(some_attribute="value", ... some_method__returns="calculated value") >>> assertEqual("calculated value", my_dingus.some_method()) >>> assertEqual("value", my_dingus.some_attribute)r¼…r½}r¾(hFUhGj²ubaubj‘)r¿}rÀ(hFX>>> # fudge >>> my_fake = (fudge.Fake() ... .provides('some_method') ... .returns("calculated value") ... .has_attr(some_attribute="value")) ... >>> assertEqual("calculated value", my_fake.some_method()) >>> assertEqual("value", my_fake.some_attribute)rÁhGj{hHhKhMj•hO}rÂ(hvhwhW]rÃhU]rÄhQ]rÅhS]rÆhY]rÇuh[Kzh\hhA]rÈhjX>>> # fudge >>> my_fake = (fudge.Fake() ... .provides('some_method') ... .returns("calculated value") ... .has_attr(some_attribute="value")) ... >>> assertEqual("calculated value", my_fake.some_method()) >>> assertEqual("value", my_fake.some_attribute)rÉ…rÊ}rË(hFUhGj¿ubaubeubhC)rÌ}rÍ(hFUhGhDhHhKhMhNhO}rÎ(hQ]rÏhS]rÐhU]rÑhW]rÒh,ahY]rÓh auh[K…h\hhA]rÔ(h^)rÕ}rÖ(hFX Simple mockr×hGjÌhHhKhMhbhO}rØ(hQ]rÙhS]rÚhU]rÛhW]rÜhY]rÝuh[K…h\hhA]rÞhjX Simple mockrß…rà}rá(hFj×hGjÕubaubj‘)râ}rã(hFXµ>>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.return_value = "value" >>> assertEqual("value", my_mock.some_method()) >>> my_mock.some_method.assert_called_once_with()rähGjÌhHhKhMj•hO}rå(U testnodetyperæXdoctestrçhvhwhW]rèhU]réhQ]rêhS]rëhY]rìUgroupsrí]rîhah€}rïuh[K‡h\hhA]rðhjXµ>>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.return_value = "value" >>> assertEqual("value", my_mock.some_method()) >>> my_mock.some_method.assert_called_once_with()rñ…rò}ró(hFUhGjâubaubj‘)rô}rõ(hFX¥# Flexmock mock = flexmock() mock.should_receive("some_method").and_return("value").once assertEqual("value", mock.some_method()) # Mox mock = mox.MockAnything() mock.some_method().AndReturn("value") mox.Replay(mock) assertEqual("value", mock.some_method()) mox.Verify(mock) # Mocker mock = mocker.mock() mock.some_method() mocker.result("value") mocker.replay() assertEqual("value", mock.some_method()) mocker.verify()röhGjÌhHhKhMj•hO}r÷(hvhwhW]røhU]rùhQ]rúhS]rûhY]rüuh[K‘h\hhA]rýhjX¥# Flexmock mock = flexmock() mock.should_receive("some_method").and_return("value").once assertEqual("value", mock.some_method()) # Mox mock = mox.MockAnything() mock.some_method().AndReturn("value") mox.Replay(mock) assertEqual("value", mock.some_method()) mox.Verify(mock) # Mocker mock = mocker.mock() mock.some_method() mocker.result("value") mocker.replay() assertEqual("value", mock.some_method()) mocker.verify()rþ…rÿ}r(hFUhGjôubaubj‘)r}r(hFXª>>> # Dingus >>> my_dingus = dingus.Dingus(some_method__returns="value") >>> assertEqual("value", my_dingus.some_method()) >>> assert my_dingus.some_method.calls().once()rhGjÌhHhKhMj•hO}r(hvhwhW]rhU]rhQ]rhS]rhY]r uh[K§h\hhA]r hjXª>>> # Dingus >>> my_dingus = dingus.Dingus(some_method__returns="value") >>> assertEqual("value", my_dingus.some_method()) >>> assert my_dingus.some_method.calls().once()r …r }r (hFUhGjubaubj‘)r}r(hFX0>>> # fudge >>> @fudge.test ... def test(): ... my_fake = (fudge.Fake() ... .expects('some_method') ... .returns("value") ... .times_called(1)) ... >>> test() Traceback (most recent call last): ... AssertionError: fake:my_fake.some_method() was not calledrhGjÌhHhKhMj•hO}r(hvhwhW]rhU]rhQ]rhS]rhY]ruh[K®h\hhA]rhjX0>>> # fudge >>> @fudge.test ... def test(): ... my_fake = (fudge.Fake() ... .expects('some_method') ... .returns("value") ... .times_called(1)) ... >>> test() Traceback (most recent call last): ... AssertionError: fake:my_fake.some_method() was not calledr…r}r(hFUhGjubaubeubhC)r}r(hFUhGhDhHhKhMhNhO}r(hQ]rhS]rhU]r hW]r!h:ahY]r"hauh[K½h\hhA]r#(h^)r$}r%(hFXCreating partial mocksr&hGjhHhKhMhbhO}r'(hQ]r(hS]r)hU]r*hW]r+hY]r,uh[K½h\hhA]r-hjXCreating partial mocksr.…r/}r0(hFj&hGj$ubaubj‘)r1}r2(hFXz>>> # mock >>> SomeObject.some_method = mock.Mock(return_value='value') >>> assertEqual("value", SomeObject.some_method())r3hGjhHhKhMj•hO}r4(U testnodetyper5Xdoctestr6hvhwhW]r7hU]r8hQ]r9hS]r:hY]r;Ugroupsr<]r=hah€}r>uh[K¿h\hhA]r?hjXz>>> # mock >>> SomeObject.some_method = mock.Mock(return_value='value') >>> assertEqual("value", SomeObject.some_method())r@…rA}rB(hFUhGj1ubaubj‘)rC}rD(hFX¨# Flexmock flexmock(SomeObject).should_receive("some_method").and_return('value') assertEqual("value", mock.some_method()) # Mox mock = mox.MockObject(SomeObject) mock.some_method().AndReturn("value") mox.Replay(mock) assertEqual("value", mock.some_method()) mox.Verify(mock) # Mocker mock = mocker.mock(SomeObject) mock.Get() mocker.result("value") mocker.replay() assertEqual("value", mock.some_method()) mocker.verify()rEhGjhHhKhMj•hO}rF(hvhwhW]rGhU]rHhQ]rIhS]rJhY]rKuh[KÇh\hhA]rLhjX¨# Flexmock flexmock(SomeObject).should_receive("some_method").and_return('value') assertEqual("value", mock.some_method()) # Mox mock = mox.MockObject(SomeObject) mock.some_method().AndReturn("value") mox.Replay(mock) assertEqual("value", mock.some_method()) mox.Verify(mock) # Mocker mock = mocker.mock(SomeObject) mock.Get() mocker.result("value") mocker.replay() assertEqual("value", mock.some_method()) mocker.verify()rM…rN}rO(hFUhGjCubaubj‘)rP}rQ(hFX>>> # Dingus >>> object = SomeObject >>> object.some_method = dingus.Dingus(return_value="value") >>> assertEqual("value", object.some_method())rRhGjhHhKhMj•hO}rS(hvhwhW]rThU]rUhQ]rVhS]rWhY]rXuh[KÜh\hhA]rYhjX>>> # Dingus >>> object = SomeObject >>> object.some_method = dingus.Dingus(return_value="value") >>> assertEqual("value", object.some_method())rZ…r[}r\(hFUhGjPubaubj‘)r]}r^(hFXÞ>>> # fudge >>> fake = fudge.Fake().is_callable().returns("") >>> with fudge.patched_context(SomeObject, 'some_method', fake): ... s = SomeObject() ... assertEqual("", s.some_method()) ...r_hGjhHhKhMj•hO}r`(hvhwhW]rahU]rbhQ]rchS]rdhY]reuh[Kãh\hhA]rfhjXÞ>>> # fudge >>> fake = fudge.Fake().is_callable().returns("") >>> with fudge.patched_context(SomeObject, 'some_method', fake): ... s = SomeObject() ... assertEqual("", s.some_method()) ...rg…rh}ri(hFUhGj]ubaubeubhC)rj}rk(hFUhGhDhHhKhMhNhO}rl(hQ]rmhS]rnhU]rohW]rph+ahY]rqh auh[Kìh\hhA]rr(h^)rs}rt(hFX'Ensure calls are made in specific orderruhGjjhHhKhMhbhO}rv(hQ]rwhS]rxhU]ryhW]rzhY]r{uh[Kìh\hhA]r|hjX'Ensure calls are made in specific orderr}…r~}r(hFjuhGjsubaubj‘)r€}r(hFXñ>>> # mock >>> my_mock = mock.Mock(spec=SomeObject) >>> my_mock.method1() >>> my_mock.method2() >>> assertEqual(my_mock.mock_calls, [call.method1(), call.method2()])r‚hGjjhHhKhMj•hO}rƒ(U testnodetyper„Xdoctestr…hvhwhW]r†hU]r‡hQ]rˆhS]r‰hY]rŠUgroupsr‹]rŒhah€}ruh[Kîh\hhA]rŽhjXñ>>> # mock >>> my_mock = mock.Mock(spec=SomeObject) >>> my_mock.method1() >>> my_mock.method2() >>> assertEqual(my_mock.mock_calls, [call.method1(), call.method2()])r…r}r‘(hFUhGj€ubaubj‘)r’}r“(hFX# Flexmock mock = flexmock(SomeObject) mock.should_receive('method1').once.ordered.and_return('first thing') mock.should_receive('method2').once.ordered.and_return('second thing') # Mox mock = mox.MockObject(SomeObject) mock.method1().AndReturn('first thing') mock.method2().AndReturn('second thing') mox.Replay(mock) mox.Verify(mock) # Mocker mock = mocker.mock() with mocker.order(): mock.method1() mocker.result('first thing') mock.method2() mocker.result('second thing') mocker.replay() mocker.verify()r”hGjjhHhKhMj•hO}r•(hvhwhW]r–hU]r—hQ]r˜hS]r™hY]ršuh[Kúh\hhA]r›hjX# Flexmock mock = flexmock(SomeObject) mock.should_receive('method1').once.ordered.and_return('first thing') mock.should_receive('method2').once.ordered.and_return('second thing') # Mox mock = mox.MockObject(SomeObject) mock.method1().AndReturn('first thing') mock.method2().AndReturn('second thing') mox.Replay(mock) mox.Verify(mock) # Mocker mock = mocker.mock() with mocker.order(): mock.method1() mocker.result('first thing') mock.method2() mocker.result('second thing') mocker.replay() mocker.verify()rœ…r}rž(hFUhGj’ubaubj‘)rŸ}r (hFXÇ>>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.method1() >>> my_dingus.method2() >>> assertEqual(['method1', 'method2'], [call.name for call in my_dingus.calls])r¡hGjjhHhKhMj•hO}r¢(hvhwhW]r£hU]r¤hQ]r¥hS]r¦hY]r§uh[Mh\hhA]r¨hjXÇ>>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.method1() >>> my_dingus.method2() >>> assertEqual(['method1', 'method2'], [call.name for call in my_dingus.calls])r©…rª}r«(hFUhGjŸubaubj‘)r¬}r­(hFX¡>>> # fudge >>> @fudge.test ... def test(): ... my_fake = (fudge.Fake() ... .remember_order() ... .expects('method1') ... .expects('method2')) ... my_fake.method2() ... my_fake.method1() ... >>> test() Traceback (most recent call last): ... AssertionError: Call #1 was fake:my_fake.method2(); Expected: #1 fake:my_fake.method1(), #2 fake:my_fake.method2(), endr®hGjjhHhKhMj•hO}r¯(hvhwhW]r°hU]r±hQ]r²hS]r³hY]r´uh[Mh\hhA]rµhjX¡>>> # fudge >>> @fudge.test ... def test(): ... my_fake = (fudge.Fake() ... .remember_order() ... .expects('method1') ... .expects('method2')) ... my_fake.method2() ... my_fake.method1() ... >>> test() Traceback (most recent call last): ... AssertionError: Call #1 was fake:my_fake.method2(); Expected: #1 fake:my_fake.method1(), #2 fake:my_fake.method2(), endr¶…r·}r¸(hFUhGj¬ubaubeubhC)r¹}rº(hFUhGhDhHhKhMhNhO}r»(hQ]r¼hS]r½hU]r¾hW]r¿h1ahY]rÀhauh[M-h\hhA]rÁ(h^)rÂ}rÃ(hFXRaising exceptionsrÄhGj¹hHhKhMhbhO}rÅ(hQ]rÆhS]rÇhU]rÈhW]rÉhY]rÊuh[M-h\hhA]rËhjXRaising exceptionsrÌ…rÍ}rÎ(hFjÄhGjÂubaubj‘)rÏ}rÐ(hFX˜>>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.side_effect = SomeException("message") >>> assertRaises(SomeException, my_mock.some_method)rÑhGj¹hHhKhMj•hO}rÒ(U testnodetyperÓXdoctestrÔhvhwhW]rÕhU]rÖhQ]r×hS]rØhY]rÙUgroupsrÚ]rÛhah€}rÜuh[M/h\hhA]rÝhjX˜>>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.side_effect = SomeException("message") >>> assertRaises(SomeException, my_mock.some_method)rÞ…rß}rà(hFUhGjÏubaubj‘)rá}râ(hFXß# Flexmock mock = flexmock() mock.should_receive("some_method").and_raise(SomeException("message")) assertRaises(SomeException, mock.some_method) # Mox mock = mox.MockAnything() mock.some_method().AndRaise(SomeException("message")) mox.Replay(mock) assertRaises(SomeException, mock.some_method) mox.Verify(mock) # Mocker mock = mocker.mock() mock.some_method() mocker.throw(SomeException("message")) mocker.replay() assertRaises(SomeException, mock.some_method) mocker.verify()rãhGj¹hHhKhMj•hO}rä(hvhwhW]råhU]ræhQ]rçhS]rèhY]réuh[M8h\hhA]rêhjXß# Flexmock mock = flexmock() mock.should_receive("some_method").and_raise(SomeException("message")) assertRaises(SomeException, mock.some_method) # Mox mock = mox.MockAnything() mock.some_method().AndRaise(SomeException("message")) mox.Replay(mock) assertRaises(SomeException, mock.some_method) mox.Verify(mock) # Mocker mock = mocker.mock() mock.some_method() mocker.throw(SomeException("message")) mocker.replay() assertRaises(SomeException, mock.some_method) mocker.verify()rë…rì}rí(hFUhGjáubaubj‘)rî}rï(hFX¦>>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.some_method = dingus.exception_raiser(SomeException) >>> assertRaises(SomeException, my_dingus.some_method)rðhGj¹hHhKhMj•hO}rñ(hvhwhW]ròhU]róhQ]rôhS]rõhY]röuh[MNh\hhA]r÷hjX¦>>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.some_method = dingus.exception_raiser(SomeException) >>> assertRaises(SomeException, my_dingus.some_method)rø…rù}rú(hFUhGjîubaubj‘)rû}rü(hFXÇ>>> # fudge >>> my_fake = (fudge.Fake() ... .is_callable() ... .raises(SomeException("message"))) ... >>> my_fake() Traceback (most recent call last): ... SomeException: messagerýhGj¹hHhKhMj•hO}rþ(hvhwhW]rÿhU]rhQ]rhS]rhY]ruh[MUh\hhA]rhjXÇ>>> # fudge >>> my_fake = (fudge.Fake() ... .is_callable() ... .raises(SomeException("message"))) ... >>> my_fake() Traceback (most recent call last): ... SomeException: messager…r}r(hFUhGjûubaubeubhC)r}r (hFUhGhDhHhKhMhNhO}r (hQ]r hS]r hU]r hW]rh-ahY]rh auh[Mah\hhA]r(h^)r}r(hFX!Override new instances of a classrhGjhHhKhMhbhO}r(hQ]rhS]rhU]rhW]rhY]ruh[Mah\hhA]rhjX!Override new instances of a classr…r}r(hFjhGjubaubj‘)r}r(hFXº>>> # mock >>> with mock.patch('somemodule.Someclass') as MockClass: ... MockClass.return_value = some_other_object ... assertEqual(some_other_object, somemodule.Someclass()) ...r hGjhHhKhMj•hO}r!(U testnodetyper"Xdoctestr#hvhwhW]r$hU]r%hQ]r&hS]r'hY]r(Ugroupsr)]r*hah€}r+uh[Mch\hhA]r,hjXº>>> # mock >>> with mock.patch('somemodule.Someclass') as MockClass: ... MockClass.return_value = some_other_object ... assertEqual(some_other_object, somemodule.Someclass()) ...r-…r.}r/(hFUhGjubaubj‘)r0}r1(hFX# Flexmock flexmock(some_module.SomeClass, new_instances=some_other_object) assertEqual(some_other_object, some_module.SomeClass()) # Mox # (you will probably have mox.Mox() available as self.mox in a real test) mox.Mox().StubOutWithMock(some_module, 'SomeClass', use_mock_anything=True) some_module.SomeClass().AndReturn(some_other_object) mox.ReplayAll() assertEqual(some_other_object, some_module.SomeClass()) # Mocker instance = mocker.mock() klass = mocker.replace(SomeClass, spec=None) klass('expected', 'args') mocker.result(instance)r2hGjhHhKhMj•hO}r3(hvhwhW]r4hU]r5hQ]r6hS]r7hY]r8uh[Mnh\hhA]r9hjX# Flexmock flexmock(some_module.SomeClass, new_instances=some_other_object) assertEqual(some_other_object, some_module.SomeClass()) # Mox # (you will probably have mox.Mox() available as self.mox in a real test) mox.Mox().StubOutWithMock(some_module, 'SomeClass', use_mock_anything=True) some_module.SomeClass().AndReturn(some_other_object) mox.ReplayAll() assertEqual(some_other_object, some_module.SomeClass()) # Mocker instance = mocker.mock() klass = mocker.replace(SomeClass, spec=None) klass('expected', 'args') mocker.result(instance)r:…r;}r<(hFUhGj0ubaubj‘)r=}r>(hFXÇ>>> # Dingus >>> MockClass = dingus.Dingus(return_value=some_other_object) >>> with dingus.patch('somemodule.SomeClass', MockClass): ... assertEqual(some_other_object, somemodule.SomeClass()) ...r?hGjhHhKhMj•hO}r@(hvhwhW]rAhU]rBhQ]rChS]rDhY]rEuh[Mh\hhA]rFhjXÇ>>> # Dingus >>> MockClass = dingus.Dingus(return_value=some_other_object) >>> with dingus.patch('somemodule.SomeClass', MockClass): ... assertEqual(some_other_object, somemodule.SomeClass()) ...rG…rH}rI(hFUhGj=ubaubj‘)rJ}rK(hFXÖ>>> # fudge >>> @fudge.patch('somemodule.SomeClass') ... def test(FakeClass): ... FakeClass.is_callable().returns(some_other_object) ... assertEqual(some_other_object, somemodule.SomeClass()) ... >>> test()rLhGjhHhKhMj•hO}rM(hvhwhW]rNhU]rOhQ]rPhS]rQhY]rRuh[M‰h\hhA]rShjXÖ>>> # fudge >>> @fudge.patch('somemodule.SomeClass') ... def test(FakeClass): ... FakeClass.is_callable().returns(some_other_object) ... assertEqual(some_other_object, somemodule.SomeClass()) ... >>> test()rT…rU}rV(hFUhGjJubaubeubhC)rW}rX(hFUhGhDhHhKhMhNhO}rY(hQ]rZhS]r[hU]r\hW]r]h)ahY]r^hauh[M“h\hhA]r_(h^)r`}ra(hFX#Call the same method multiple timesrbhGjWhHhKhMhbhO}rc(hQ]rdhS]rehU]rfhW]rghY]rhuh[M“h\hhA]rihjX#Call the same method multiple timesrj…rk}rl(hFjbhGj`ubaubj )rm}rn(hFXéYou don't need to do *any* configuration to call `mock.Mock()` methods multiple times. Attributes like `call_count`, `call_args_list` and `method_calls` provide various different ways of making assertions about how the mock was used.rohGjWhHhKhMjhO}rp(hQ]rqhS]rrhU]rshW]rthY]ruuh[Nh\hhA]rvh†)rw}rx(hFXéYou don't need to do *any* configuration to call `mock.Mock()` methods multiple times. Attributes like `call_count`, `call_args_list` and `method_calls` provide various different ways of making assertions about how the mock was used.ryhGjmhHhKhMhŠhO}rz(hQ]r{hS]r|hU]r}hW]r~hY]ruh[M—hA]r€(hjXYou don't need to do r…r‚}rƒ(hFXYou don't need to do r„hGjwubji)r…}r†(hFX*any*r‡hO}rˆ(hQ]r‰hS]rŠhU]r‹hW]rŒhY]ruhGjwhA]rŽhjXanyr…r}r‘(hFUhGj…ubahMjwubhjX configuration to call r’…r“}r”(hFX configuration to call r•hGjwubjJ)r–}r—(hFX `mock.Mock()`r˜hO}r™(hQ]ršhS]r›hU]rœhW]rhY]ržuhGjwhA]rŸhjX mock.Mock()r …r¡}r¢(hFUhGj–ubahMjXubhjX) methods multiple times. Attributes like r£…r¤}r¥(hFX) methods multiple times. Attributes like r¦hGjwubjJ)r§}r¨(hFX `call_count`r©hO}rª(hQ]r«hS]r¬hU]r­hW]r®hY]r¯uhGjwhA]r°hjX call_countr±…r²}r³(hFUhGj§ubahMjXubhjX, r´…rµ}r¶(hFX, r·hGjwubjJ)r¸}r¹(hFX`call_args_list`rºhO}r»(hQ]r¼hS]r½hU]r¾hW]r¿hY]rÀuhGjwhA]rÁhjXcall_args_listrÂ…rÃ}rÄ(hFUhGj¸ubahMjXubhjX and rÅ…rÆ}rÇ(hFX and rÈhGjwubjJ)rÉ}rÊ(hFX`method_calls`rËhO}rÌ(hQ]rÍhS]rÎhU]rÏhW]rÐhY]rÑuhGjwhA]rÒhjX method_callsrÓ…rÔ}rÕ(hFUhGjÉubahMjXubhjXQ provide various different ways of making assertions about how the mock was used.rÖ…r×}rØ(hFXQ provide various different ways of making assertions about how the mock was used.rÙhGjwubeubaubj‘)rÚ}rÛ(hFXÛ>>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method() >>> my_mock.some_method() >>> assert my_mock.some_method.call_count >= 2rÜhGjWhHhKhMj•hO}rÝ(U testnodetyperÞXdoctestrßhvhwhW]ràhU]ráhQ]râhS]rãhY]räUgroupsrå]ræhah€}rçuh[Mœh\hhA]rèhjXÛ>>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method() >>> my_mock.some_method() >>> assert my_mock.some_method.call_count >= 2ré…rê}rë(hFUhGjÚubaubj‘)rì}rí(hFX²# Flexmock # (verifies that the method gets called at least twice) flexmock(some_object).should_receive('some_method').at_least.twice # Mox # (does not support variable number of calls, so you need to create a new entry for each explicit call) mock = mox.MockObject(some_object) mock.some_method(mox.IgnoreArg(), mox.IgnoreArg()) mock.some_method(mox.IgnoreArg(), mox.IgnoreArg()) mox.Replay(mock) mox.Verify(mock) # Mocker # (TODO)rîhGjWhHhKhMj•hO}rï(hvhwhW]rðhU]rñhQ]ròhS]róhY]rôuh[M¨h\hhA]rõhjX²# Flexmock # (verifies that the method gets called at least twice) flexmock(some_object).should_receive('some_method').at_least.twice # Mox # (does not support variable number of calls, so you need to create a new entry for each explicit call) mock = mox.MockObject(some_object) mock.some_method(mox.IgnoreArg(), mox.IgnoreArg()) mock.some_method(mox.IgnoreArg(), mox.IgnoreArg()) mox.Replay(mock) mox.Verify(mock) # Mocker # (TODO)rö…r÷}rø(hFUhGjìubaubj‘)rù}rú(hFX²>>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.some_method() >>> my_dingus.some_method() >>> assert len(my_dingus.calls('some_method')) == 2rûhGjWhHhKhMj•hO}rü(hvhwhW]rýhU]rþhQ]rÿhS]rhY]ruh[M¸h\hhA]rhjX²>>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.some_method() >>> my_dingus.some_method() >>> assert len(my_dingus.calls('some_method')) == 2r…r}r(hFUhGjùubaubj‘)r}r(hFX>>> # fudge >>> @fudge.test ... def test(): ... my_fake = fudge.Fake().expects('some_method').times_called(2) ... my_fake.some_method() ... >>> test() Traceback (most recent call last): ... AssertionError: fake:my_fake.some_method() was called 1 time(s). Expected 2.rhGjWhHhKhMj•hO}r (hvhwhW]r hU]r hQ]r hS]r hY]ruh[MÂh\hhA]rhjX>>> # fudge >>> @fudge.test ... def test(): ... my_fake = fudge.Fake().expects('some_method').times_called(2) ... my_fake.some_method() ... >>> test() Traceback (most recent call last): ... AssertionError: fake:my_fake.some_method() was called 1 time(s). Expected 2.r…r}r(hFUhGjubaubeubhC)r}r(hFUhGhDhHhKhMhNhO}r(hQ]rhS]rhU]rhW]rh2ahY]rhauh[MÏh\hhA]r(h^)r}r(hFXMock chained methodsrhGjhHhKhMhbhO}r(hQ]r hS]r!hU]r"hW]r#hY]r$uh[MÏh\hhA]r%hjXMock chained methodsr&…r'}r((hFjhGjubaubj‘)r)}r*(hFX>>> # mock >>> my_mock = mock.Mock() >>> method3 = my_mock.method1.return_value.method2.return_value.method3 >>> method3.return_value = 'some value' >>> assertEqual('some value', my_mock.method1().method2().method3(1, 2)) >>> method3.assert_called_once_with(1, 2)r+hGjhHhKhMj•hO}r,(U testnodetyper-Xdoctestr.hvhwhW]r/hU]r0hQ]r1hS]r2hY]r3Ugroupsr4]r5hah€}r6uh[MÑh\hhA]r7hjX>>> # mock >>> my_mock = mock.Mock() >>> method3 = my_mock.method1.return_value.method2.return_value.method3 >>> method3.return_value = 'some value' >>> assertEqual('some value', my_mock.method1().method2().method3(1, 2)) >>> method3.assert_called_once_with(1, 2)r8…r9}r:(hFUhGj)ubaubj‘)r;}r<(hFXH# Flexmock # (intermediate method calls are automatically assigned to temporary fake objects # and can be called with any arguments) flexmock(some_object).should_receive( 'method1.method2.method3' ).with_args(arg1, arg2).and_return('some value') assertEqual('some_value', some_object.method1().method2().method3(arg1, arg2))r=hGjhHhKhMj•hO}r>(hvhwhW]r?hU]r@hQ]rAhS]rBhY]rCuh[MÜh\hhA]rDhjXH# Flexmock # (intermediate method calls are automatically assigned to temporary fake objects # and can be called with any arguments) flexmock(some_object).should_receive( 'method1.method2.method3' ).with_args(arg1, arg2).and_return('some value') assertEqual('some_value', some_object.method1().method2().method3(arg1, arg2))rE…rF}rG(hFUhGj;ubaubj‘)rH}rI(hFX]# Mox mock = mox.MockObject(some_object) mock2 = mox.MockAnything() mock3 = mox.MockAnything() mock.method1().AndReturn(mock1) mock2.method2().AndReturn(mock2) mock3.method3(arg1, arg2).AndReturn('some_value') self.mox.ReplayAll() assertEqual("some_value", some_object.method1().method2().method3(arg1, arg2)) self.mox.VerifyAll() # Mocker # (TODO)rJhGjhHhKhMj•hO}rK(hvhwhW]rLhU]rMhQ]rNhS]rOhY]rPuh[Mæh\hhA]rQhjX]# Mox mock = mox.MockObject(some_object) mock2 = mox.MockAnything() mock3 = mox.MockAnything() mock.method1().AndReturn(mock1) mock2.method2().AndReturn(mock2) mock3.method3(arg1, arg2).AndReturn('some_value') self.mox.ReplayAll() assertEqual("some_value", some_object.method1().method2().method3(arg1, arg2)) self.mox.VerifyAll() # Mocker # (TODO)rR…rS}rT(hFUhGjHubaubj‘)rU}rV(hFX>>> # Dingus >>> my_dingus = dingus.Dingus() >>> method3 = my_dingus.method1.return_value.method2.return_value.method3 >>> method3.return_value = 'some value' >>> assertEqual('some value', my_dingus.method1().method2().method3(1, 2)) >>> assert method3.calls('()', 1, 2).once()rWhGjhHhKhMj•hO}rX(hvhwhW]rYhU]rZhQ]r[hS]r\hY]r]uh[Möh\hhA]r^hjX>>> # Dingus >>> my_dingus = dingus.Dingus() >>> method3 = my_dingus.method1.return_value.method2.return_value.method3 >>> method3.return_value = 'some value' >>> assertEqual('some value', my_dingus.method1().method2().method3(1, 2)) >>> assert method3.calls('()', 1, 2).once()r_…r`}ra(hFUhGjUubaubj‘)rb}rc(hFX{>>> # fudge >>> @fudge.test ... def test(): ... my_fake = fudge.Fake() ... (my_fake ... .expects('method1') ... .returns_fake() ... .expects('method2') ... .returns_fake() ... .expects('method3') ... .with_args(1, 2) ... .returns('some value')) ... assertEqual('some value', my_fake.method1().method2().method3(1, 2)) ... >>> test()rdhGjhHhKhMj•hO}re(hvhwhW]rfhU]rghQ]rhhS]rihY]rjuh[Mÿh\hhA]rkhjX{>>> # fudge >>> @fudge.test ... def test(): ... my_fake = fudge.Fake() ... (my_fake ... .expects('method1') ... .returns_fake() ... .expects('method2') ... .returns_fake() ... .expects('method3') ... .with_args(1, 2) ... .returns('some value')) ... assertEqual('some value', my_fake.method1().method2().method3(1, 2)) ... >>> test()rl…rm}rn(hFUhGjbubaubeubhC)ro}rp(hFUhGhDhHhKhMhNhO}rq(hQ]rrhS]rshU]rthW]ruh/ahY]rvh auh[Mh\hhA]rw(h^)rx}ry(hFXMocking a context managerrzhGjohHhKhMhbhO}r{(hQ]r|hS]r}hU]r~hW]rhY]r€uh[Mh\hhA]rhjXMocking a context managerr‚…rƒ}r„(hFjzhGjxubaubh†)r…}r†(hFX2Examples for mock, Dingus and fudge only (so far):r‡hGjohHhKhMhŠhO}rˆ(hQ]r‰hS]rŠhU]r‹hW]rŒhY]ruh[Mh\hhA]rŽhjX2Examples for mock, Dingus and fudge only (so far):r…r}r‘(hFj‡hGj…ubaubj‘)r’}r“(hFX±>>> # mock >>> my_mock = mock.MagicMock() >>> with my_mock: ... pass ... >>> my_mock.__enter__.assert_called_with() >>> my_mock.__exit__.assert_called_with(None, None, None)r”hGjohHhKhMj•hO}r•(U testnodetyper–Xdoctestr—hvhwhW]r˜hU]r™hQ]ršhS]r›hY]rœUgroupsr]ržhah€}rŸuh[Mh\hhA]r hjX±>>> # mock >>> my_mock = mock.MagicMock() >>> with my_mock: ... pass ... >>> my_mock.__enter__.assert_called_with() >>> my_mock.__exit__.assert_called_with(None, None, None)r¡…r¢}r£(hFUhGj’ubaubj‘)r¤}r¥(hFXë>>> # Dingus (nothing special here; all dinguses are "magic mocks") >>> my_dingus = dingus.Dingus() >>> with my_dingus: ... pass ... >>> assert my_dingus.__enter__.calls() >>> assert my_dingus.__exit__.calls('()', None, None, None)r¦hGjohHhKhMj•hO}r§(hvhwhW]r¨hU]r©hQ]rªhS]r«hY]r¬uh[M"h\hhA]r­hjXë>>> # Dingus (nothing special here; all dinguses are "magic mocks") >>> my_dingus = dingus.Dingus() >>> with my_dingus: ... pass ... >>> assert my_dingus.__enter__.calls() >>> assert my_dingus.__exit__.calls('()', None, None, None)r®…r¯}r°(hFUhGj¤ubaubj‘)r±}r²(hFXt>>> # fudge >>> my_fake = fudge.Fake().provides('__enter__').provides('__exit__') >>> with my_fake: ... pass ...r³hGjohHhKhMj•hO}r´(hvhwhW]rµhU]r¶hQ]r·hS]r¸hY]r¹uh[M,h\hhA]rºhjXt>>> # fudge >>> my_fake = fudge.Fake().provides('__enter__').provides('__exit__') >>> with my_fake: ... pass ...r»…r¼}r½(hFUhGj±ubaubeubhC)r¾}r¿(hFUhGhDhHhKhMhNhO}rÀ(hQ]rÁhS]rÂhU]rÃhW]rÄh6ahY]rÅhauh[M4h\hhA]rÆ(h^)rÇ}rÈ(hFX2Mocking the builtin open used as a context managerrÉhGj¾hHhKhMhbhO}rÊ(hQ]rËhS]rÌhU]rÍhW]rÎhY]rÏuh[M4h\hhA]rÐhjX2Mocking the builtin open used as a context managerrÑ…rÒ}rÓ(hFjÉhGjÇubaubh†)rÔ}rÕ(hFXExample for mock only (so far):rÖhGj¾hHhKhMhŠhO}r×(hQ]rØhS]rÙhU]rÚhW]rÛhY]rÜuh[M6h\hhA]rÝhjXExample for mock only (so far):rÞ…rß}rà(hFjÖhGjÔubaubj‘)rá}râ(hFXH>>> # mock >>> my_mock = mock.MagicMock() >>> with mock.patch('__builtin__.open', my_mock): ... manager = my_mock.return_value.__enter__.return_value ... manager.read.return_value = 'some data' ... with open('foo') as h: ... data = h.read() ... >>> data 'some data' >>> my_mock.assert_called_once_with('foo')rãhGj¾hHhKhMj•hO}rä(U testnodetyperåXdoctestræhvhwhW]rçhU]rèhQ]réhS]rêhY]rëUgroupsrì]ríhah€}rîuh[M8h\hhA]rïhjXH>>> # mock >>> my_mock = mock.MagicMock() >>> with mock.patch('__builtin__.open', my_mock): ... manager = my_mock.return_value.__enter__.return_value ... manager.read.return_value = 'some data' ... with open('foo') as h: ... data = h.read() ... >>> data 'some data' >>> my_mock.assert_called_once_with('foo')rð…rñ}rò(hFUhGjáubaubh†)ró}rô(hFX*or*:rõhGj¾hHhKhMhŠhO}rö(hQ]r÷hS]røhU]rùhW]rúhY]rûuh[MFh\hhA]rü(ji)rý}rþ(hFX*or*rÿhO}r(hQ]rhS]rhU]rhW]rhY]ruhGjóhA]rhjXorr…r}r (hFUhGjýubahMjwubhjX:…r }r (hFX:hGjóubeubj‘)r }r (hFXc>>> # mock >>> with mock.patch('__builtin__.open') as my_mock: ... my_mock.return_value.__enter__ = lambda s: s ... my_mock.return_value.__exit__ = mock.Mock() ... my_mock.return_value.read.return_value = 'some data' ... with open('foo') as h: ... data = h.read() ... >>> data 'some data' >>> my_mock.assert_called_once_with('foo')rhGj¾hHhKhMj•hO}r(U testnodetyperXdoctestrhvhwhW]rhU]rhQ]rhS]rhY]rUgroupsr]rhah€}ruh[MHh\hhA]rhjXc>>> # mock >>> with mock.patch('__builtin__.open') as my_mock: ... my_mock.return_value.__enter__ = lambda s: s ... my_mock.return_value.__exit__ = mock.Mock() ... my_mock.return_value.read.return_value = 'some data' ... with open('foo') as h: ... data = h.read() ... >>> data 'some data' >>> my_mock.assert_called_once_with('foo')r…r}r(hFUhGj ubaubj‘)r}r(hFXL>>> # Dingus >>> my_dingus = dingus.Dingus() >>> with dingus.patch('__builtin__.open', my_dingus): ... file_ = open.return_value.__enter__.return_value ... file_.read.return_value = 'some data' ... with open('foo') as h: ... data = f.read() ... >>> data 'some data' >>> assert my_dingus.calls('()', 'foo').once()r hGj¾hHhKhMj•hO}r!(hvhwhW]r"hU]r#hQ]r$hS]r%hY]r&uh[MXh\hhA]r'hjXL>>> # Dingus >>> my_dingus = dingus.Dingus() >>> with dingus.patch('__builtin__.open', my_dingus): ... file_ = open.return_value.__enter__.return_value ... file_.read.return_value = 'some data' ... with open('foo') as h: ... data = f.read() ... >>> data 'some data' >>> assert my_dingus.calls('()', 'foo').once()r(…r)}r*(hFUhGjubaubj‘)r+}r,(hFXˆ>>> # fudge >>> from contextlib import contextmanager >>> from StringIO import StringIO >>> @contextmanager ... def fake_file(filename): ... yield StringIO('sekrets') ... >>> with fudge.patch('__builtin__.open') as fake_open: ... fake_open.is_callable().calls(fake_file) ... with open('/etc/password') as f: ... data = f.read() ... fake:__builtin__.open >>> data 'sekrets'r-hGj¾hHhKhMj•hO}r.(hvhwhW]r/hU]r0hQ]r1hS]r2hY]r3uh[Mfh\hhA]r4hjXˆ>>> # fudge >>> from contextlib import contextmanager >>> from StringIO import StringIO >>> @contextmanager ... def fake_file(filename): ... yield StringIO('sekrets') ... >>> with fudge.patch('__builtin__.open') as fake_open: ... fake_open.is_callable().calls(fake_file) ... with open('/etc/password') as f: ... data = f.read() ... fake:__builtin__.open >>> data 'sekrets'r5…r6}r7(hFUhGj+ubaubeubeubahFUU transformerr8NU footnote_refsr9}r:Urefnamesr;}r<Usymbol_footnotesr=]r>Uautofootnote_refsr?]r@Usymbol_footnote_refsrA]rBU citationsrC]rDh\hU current_linerENUtransform_messagesrF]rGUreporterrHNUid_startrIKU autofootnotesrJ]rKU citation_refsrL}rMUindirect_targetsrN]rOUsettingsrP(cdocutils.frontend Values rQorR}rS(Ufootnote_backlinksrTKUrecord_dependenciesrUNU rfc_base_urlrVUhttp://tools.ietf.org/html/rWU tracebackrXˆUpep_referencesrYNUstrip_commentsrZNU toc_backlinksr[Uentryr\U language_coder]Uenr^U datestampr_NU report_levelr`KU _destinationraNU halt_levelrbKU strip_classesrcNhbNUerror_encoding_error_handlerrdUbackslashreplacereUdebugrfNUembed_stylesheetrg‰Uoutput_encoding_error_handlerrhUstrictriU sectnum_xformrjKUdump_transformsrkNU docinfo_xformrlKUwarning_streamrmNUpep_file_url_templaternUpep-%04droUexit_status_levelrpKUconfigrqNUstrict_visitorrrNUcloak_email_addressesrsˆUtrim_footnote_reference_spacert‰UenvruNUdump_pseudo_xmlrvNUexpose_internalsrwNUsectsubtitle_xformrx‰U source_linkryNUrfc_referencesrzNUoutput_encodingr{Uutf-8r|U source_urlr}NUinput_encodingr~U utf-8-sigrU_disable_configr€NU id_prefixrUU tab_widthr‚KUerror_encodingrƒU mac-romanr„U_sourcer…U/compile/mock/docs/compare.txtr†Ugettext_compactr‡ˆU generatorrˆNUdump_internalsr‰NU pep_base_urlrŠUhttp://www.python.org/dev/peps/r‹Usyntax_highlightrŒUshortrUinput_encoding_error_handlerrŽjiUauto_id_prefixrUidrUdoctitle_xformr‘‰Ustrip_elements_with_classesr’NU _config_filesr“]r”Ufile_insertion_enabledr•KU raw_enabledr–KU dump_settingsr—NubUsymbol_footnote_startr˜KUidsr™}rš(h>jh,jÌh?jŒh9j·h-jh(hÖh/joh*jõh0jÝh@hDh3jh:jh4jüh5jh1j¹h7j¶h+jjhhU+hamcrest-library-integration-match-equalityq?hU unittest2q@hUthis-blog-entryqAhU%multiple-calls-with-different-effectsqBhUdatetime-date-todayqChU advanced-usesqDhUmocking-unbound-methodsqEhUiterqFU2Uid5qGhUmore-complex-argument-matchingqHhUfurther-examplesqIhUmocking-propertiesqJhU8tracking-order-of-calls-and-less-verbose-call-assertionsqKhU(generator-tricks-for-systems-programmersqLh Upartial-mockingqMh!U#mocking-a-dictionary-with-magicmockqNh"U&raising-exceptions-on-attribute-accessqOh#U,applying-the-same-patch-to-every-test-methodqPh$Umocks-without-some-attributesqQh%Unesting-patchesqRh&Uone-userqSh'Umocking-imports-with-patch-dictqTuUchildrenqU]qV(cdocutils.nodes target qW)qX}qY(U rawsourceqZX.. _further-examples:q[Uparentq\hUsourceq]cdocutils.nodes reprunicode q^X/compile/mock/docs/examples.txtq_…q`}qabUtagnameqbUtargetqcU attributesqd}qe(Uidsqf]qgUbackrefsqh]qiUdupnamesqj]qkUclassesql]qmUnamesqn]qoUrefidqphIuUlineqqKUdocumentqrhhU]qsubcdocutils.nodes section qt)qu}qv(hZUh\hh]h`Uexpect_referenced_by_nameqw}qxhhXshbUsectionqyhd}qz(hj]q{hl]q|hh]q}hf]q~(hIh;ehn]q(hheuhqKhrhUexpect_referenced_by_idq€}qhIhXshU]q‚(cdocutils.nodes title qƒ)q„}q…(hZXFurther Examplesq†h\huh]h`hbUtitleq‡hd}qˆ(hj]q‰hl]qŠhh]q‹hf]qŒhn]quhqKhrhhU]qŽcdocutils.nodes Text qXFurther Examplesq…q‘}q’(hZh†h\h„ubaubcdocutils.nodes comment q“)q”}q•(hZXæfrom datetime import date BackendProvider = Mock() sys.modules['mymodule'] = mymodule = Mock(name='mymodule') def grob(val): "First frob and then clear val" mymodule.frob(val) val.clear() mymodule.frob = lambda val: val mymodule.grob = grob mymodule.date = date class TestCase(unittest2.TestCase): def run(self): result = unittest2.TestResult() out = unittest2.TestCase.run(self, result) assert result.wasSuccessful() from mock import inPy3kq–h\huh]h`hbUcommentq—hd}q˜(U testnodetypeq™X testsetupqšU xml:spaceq›Upreserveqœhf]qhh]qžhj]qŸhl]q hn]q¡Ugroupsq¢]q£Udefaultq¤aUoptionsq¥}q¦uhqK hrhhU]q§hXæfrom datetime import date BackendProvider = Mock() sys.modules['mymodule'] = mymodule = Mock(name='mymodule') def grob(val): "First frob and then clear val" mymodule.frob(val) val.clear() mymodule.frob = lambda val: val mymodule.grob = grob mymodule.date = date class TestCase(unittest2.TestCase): def run(self): result = unittest2.TestResult() out = unittest2.TestCase.run(self, result) assert result.wasSuccessful() from mock import inPy3kq¨…q©}qª(hZUh\h”ubaubcdocutils.nodes paragraph q«)q¬}q­(hZXXFor comprehensive examples, see the unit tests included in the full source distribution.q®h\huh]h`hbU paragraphq¯hd}q°(hj]q±hl]q²hh]q³hf]q´hn]qµuhqK#hrhhU]q¶hXXFor comprehensive examples, see the unit tests included in the full source distribution.q·…q¸}q¹(hZh®h\h¬ubaubh«)qº}q»(hZXHere are some more examples for some slightly more advanced scenarios than in the :ref:`getting started ` guide.q¼h\huh]h`hbh¯hd}q½(hj]q¾hl]q¿hh]qÀhf]qÁhn]qÂuhqK&hrhhU]qÃ(hXRHere are some more examples for some slightly more advanced scenarios than in the qÄ…qÅ}qÆ(hZXRHere are some more examples for some slightly more advanced scenarios than in the qÇh\hºubcsphinx.addnodes pending_xref qÈ)qÉ}qÊ(hZX(:ref:`getting started `qËh\hºh]h`hbU pending_xrefqÌhd}qÍ(UreftypeqÎXrefqÏUrefwarnqЈU reftargetqÑXgetting-startedqÒU refdomainqÓXstdqÔhf]qÕhh]qÖU refexplicitq׈hj]qØhl]qÙhn]qÚUrefdocqÛUexamplesqÜuhqK&hU]qÝcdocutils.nodes emphasis qÞ)qß}qà(hZhËhd}qá(hj]qâhl]qã(UxrefqähÔXstd-refqåehh]qæhf]qçhn]qèuh\hÉhU]qéhXgetting startedqê…që}qì(hZUh\hßubahbUemphasisqíubaubhX guide.qî…qï}qð(hZX guide.qñh\hºubeubht)qò}qó(hZUh\huh]h`hbhyhd}qô(hj]qõhl]qöhh]q÷hf]qøh4ahn]qùh auhqK+hrhhU]qú(hƒ)qû}qü(hZXMocking chained callsqýh\hòh]h`hbh‡hd}qþ(hj]qÿhl]rhh]rhf]rhn]ruhqK+hrhhU]rhXMocking chained callsr…r}r(hZhýh\hûubaubh«)r}r (hZX÷Mocking chained calls is actually straightforward with mock once you understand the :attr:`~Mock.return_value` attribute. When a mock is called for the first time, or you fetch its `return_value` before it has been called, a new `Mock` is created.r h\hòh]h`hbh¯hd}r (hj]r hl]r hh]rhf]rhn]ruhqK-hrhhU]r(hXTMocking chained calls is actually straightforward with mock once you understand the r…r}r(hZXTMocking chained calls is actually straightforward with mock once you understand the rh\jubhÈ)r}r(hZX:attr:`~Mock.return_value`rh\jh]h`hbhÌhd}r(UreftyperXattrrhЉhÑXMock.return_valuerU refdomainrXpyrhf]rhh]r U refexplicitr!‰hj]r"hl]r#hn]r$hÛhÜUpy:classr%NU py:moduler&Xmockr'uhqK-hU]r(cdocutils.nodes literal r))r*}r+(hZjhd}r,(hj]r-hl]r.(häjXpy-attrr/ehh]r0hf]r1hn]r2uh\jhU]r3hX return_valuer4…r5}r6(hZUh\j*ubahbUliteralr7ubaubhXG attribute. When a mock is called for the first time, or you fetch its r8…r9}r:(hZXG attribute. When a mock is called for the first time, or you fetch its r;h\jubcdocutils.nodes title_reference r<)r=}r>(hZX`return_value`r?hd}r@(hj]rAhl]rBhh]rChf]rDhn]rEuh\jhU]rFhX return_valuerG…rH}rI(hZUh\j=ubahbUtitle_referencerJubhX" before it has been called, a new rK…rL}rM(hZX" before it has been called, a new rNh\jubj<)rO}rP(hZX`Mock`rQhd}rR(hj]rShl]rThh]rUhf]rVhn]rWuh\jhU]rXhXMockrY…rZ}r[(hZUh\jOubahbjJubhX is created.r\…r]}r^(hZX is created.r_h\jubeubh«)r`}ra(hZXŠThis means that you can see how the object returned from a call to a mocked object has been used by interrogating the `return_value` mock:rbh\hòh]h`hbh¯hd}rc(hj]rdhl]rehh]rfhf]rghn]rhuhqK2hrhhU]ri(hXvThis means that you can see how the object returned from a call to a mocked object has been used by interrogating the rj…rk}rl(hZXvThis means that you can see how the object returned from a call to a mocked object has been used by interrogating the rmh\j`ubj<)rn}ro(hZX`return_value`rphd}rq(hj]rrhl]rshh]rthf]ruhn]rvuh\j`hU]rwhX return_valuerx…ry}rz(hZUh\jnubahbjJubhX mock:r{…r|}r}(hZX mock:r~h\j`ubeubcdocutils.nodes literal_block r)r€}r(hZX…>>> mock = Mock() >>> mock().foo(a=2, b=3) >>> mock.return_value.foo.assert_called_with(a=2, b=3)r‚h\hòh]h`hbU literal_blockrƒhd}r„(U testnodetyper…Xdoctestr†h›hœhf]r‡hh]rˆhj]r‰hl]rŠhn]r‹UgroupsrŒ]rh¤ah¥}rŽuhqK5hrhhU]rhX…>>> mock = Mock() >>> mock().foo(a=2, b=3) >>> mock.return_value.foo.assert_called_with(a=2, b=3)r…r‘}r’(hZUh\j€ubaubh«)r“}r”(hZX¸From here it is a simple step to configure and then make assertions about chained calls. Of course another alternative is writing your code in a more testable way in the first place...r•h\hòh]h`hbh¯hd}r–(hj]r—hl]r˜hh]r™hf]ršhn]r›uhqK>> class Something(object): ... def __init__(self): ... self.backend = BackendProvider() ... def method(self): ... response = self.backend.get_endpoint('foobar').create_call('spam', 'eggs').start_call() ... # more coder¯h\hòh]h`hbjƒhd}r°(U testnodetyper±Xdoctestr²h›hœhf]r³hh]r´hj]rµhl]r¶hn]r·Ugroupsr¸]r¹h¤ah¥}rºuhqKBhrhhU]r»hXû>>> class Something(object): ... def __init__(self): ... self.backend = BackendProvider() ... def method(self): ... response = self.backend.get_endpoint('foobar').create_call('spam', 'eggs').start_call() ... # more coder¼…r½}r¾(hZUh\j­ubaubh«)r¿}rÀ(hZXÁAssuming that `BackendProvider` is already well tested, how do we test `method()`? Specifically, we want to test that the code section `# more code` uses the response object in the correct way.rÁh\hòh]h`hbh¯hd}rÂ(hj]rÃhl]rÄhh]rÅhf]rÆhn]rÇuhqKKhrhhU]rÈ(hXAssuming that rÉ…rÊ}rË(hZXAssuming that rÌh\j¿ubj<)rÍ}rÎ(hZX`BackendProvider`rÏhd}rÐ(hj]rÑhl]rÒhh]rÓhf]rÔhn]rÕuh\j¿hU]rÖhXBackendProviderr×…rØ}rÙ(hZUh\jÍubahbjJubhX( is already well tested, how do we test rÚ…rÛ}rÜ(hZX( is already well tested, how do we test rÝh\j¿ubj<)rÞ}rß(hZX `method()`ràhd}rá(hj]râhl]rãhh]rähf]råhn]ræuh\j¿hU]rçhXmethod()rè…ré}rê(hZUh\jÞubahbjJubhX6? Specifically, we want to test that the code section rë…rì}rí(hZX6? Specifically, we want to test that the code section rîh\j¿ubj<)rï}rð(hZX `# more code`rñhd}rò(hj]róhl]rôhh]rõhf]röhn]r÷uh\j¿hU]røhX # more coderù…rú}rû(hZUh\jïubahbjJubhX- uses the response object in the correct way.rü…rý}rþ(hZX- uses the response object in the correct way.rÿh\j¿ubeubh«)r}r(hZX•As this chain of calls is made from an instance attribute we can monkey patch the `backend` attribute on a `Something` instance. In this particular case we are only interested in the return value from the final call to `start_call` so we don't have much configuration to do. Let's assume the object it returns is 'file-like', so we'll ensure that our response object uses the builtin `file` as its `spec`.rh\hòh]h`hbh¯hd}r(hj]rhl]rhh]rhf]rhn]ruhqKOhrhhU]r (hXRAs this chain of calls is made from an instance attribute we can monkey patch the r …r }r (hZXRAs this chain of calls is made from an instance attribute we can monkey patch the r h\jubj<)r}r(hZX `backend`rhd}r(hj]rhl]rhh]rhf]rhn]ruh\jhU]rhXbackendr…r}r(hZUh\jubahbjJubhX attribute on a r…r}r(hZX attribute on a rh\jubj<)r}r (hZX `Something`r!hd}r"(hj]r#hl]r$hh]r%hf]r&hn]r'uh\jhU]r(hX Somethingr)…r*}r+(hZUh\jubahbjJubhXe instance. In this particular case we are only interested in the return value from the final call to r,…r-}r.(hZXe instance. In this particular case we are only interested in the return value from the final call to r/h\jubj<)r0}r1(hZX `start_call`r2hd}r3(hj]r4hl]r5hh]r6hf]r7hn]r8uh\jhU]r9hX start_callr:…r;}r<(hZUh\j0ubahbjJubhX™ so we don't have much configuration to do. Let's assume the object it returns is 'file-like', so we'll ensure that our response object uses the builtin r=…r>}r?(hZX™ so we don't have much configuration to do. Let's assume the object it returns is 'file-like', so we'll ensure that our response object uses the builtin r@h\jubj<)rA}rB(hZX`file`rChd}rD(hj]rEhl]rFhh]rGhf]rHhn]rIuh\jhU]rJhXfilerK…rL}rM(hZUh\jAubahbjJubhX as its rN…rO}rP(hZX as its rQh\jubj<)rR}rS(hZX`spec`rThd}rU(hj]rVhl]rWhh]rXhf]rYhn]rZuh\jhU]r[hXspecr\…r]}r^(hZUh\jRubahbjJubhX.…r_}r`(hZX.h\jubeubh«)ra}rb(hZX¸To do this we create a mock instance as our mock backend and create a mock response object for it. To set the response as the return value for that final `start_call` we could do this:rch\hòh]h`hbh¯hd}rd(hj]rehl]rfhh]rghf]rhhn]riuhqKVhrhhU]rj(hXšTo do this we create a mock instance as our mock backend and create a mock response object for it. To set the response as the return value for that final rk…rl}rm(hZXšTo do this we create a mock instance as our mock backend and create a mock response object for it. To set the response as the return value for that final rnh\jaubj<)ro}rp(hZX `start_call`rqhd}rr(hj]rshl]rthh]ruhf]rvhn]rwuh\jahU]rxhX start_callry…rz}r{(hZUh\joubahbjJubhX we could do this:r|…r}}r~(hZX we could do this:rh\jaubeubcdocutils.nodes block_quote r€)r}r‚(hZUh\hòh]h`hbU block_quoterƒhd}r„(hj]r…hl]r†hh]r‡hf]rˆhn]r‰uhqNhrhhU]rŠh«)r‹}rŒ(hZXj`mock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value = mock_response`.rh\jh]h`hbh¯hd}rŽ(hj]rhl]rhh]r‘hf]r’hn]r“uhqKZhU]r”(j<)r•}r–(hZXi`mock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value = mock_response`r—hd}r˜(hj]r™hl]ršhh]r›hf]rœhn]ruh\j‹hU]ržhXgmock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value = mock_responserŸ…r }r¡(hZUh\j•ubahbjJubhX.…r¢}r£(hZX.h\j‹ubeubaubh«)r¤}r¥(hZX}We can do that in a slightly nicer way using the :meth:`~Mock.configure_mock` method to directly set the return value for us:r¦h\hòh]h`hbh¯hd}r§(hj]r¨hl]r©hh]rªhf]r«hn]r¬uhqK\hrhhU]r­(hX1We can do that in a slightly nicer way using the r®…r¯}r°(hZX1We can do that in a slightly nicer way using the r±h\j¤ubhÈ)r²}r³(hZX:meth:`~Mock.configure_mock`r´h\j¤h]h`hbhÌhd}rµ(Ureftyper¶Xmethr·hЉhÑXMock.configure_mockr¸U refdomainr¹Xpyrºhf]r»hh]r¼U refexplicitr½‰hj]r¾hl]r¿hn]rÀhÛhÜj%Nj&j'uhqK\hU]rÁj))rÂ}rÃ(hZj´hd}rÄ(hj]rÅhl]rÆ(häjºXpy-methrÇehh]rÈhf]rÉhn]rÊuh\j²hU]rËhXconfigure_mock()rÌ…rÍ}rÎ(hZUh\jÂubahbj7ubaubhX0 method to directly set the return value for us:rÏ…rÐ}rÑ(hZX0 method to directly set the return value for us:rÒh\j¤ubeubj)rÓ}rÔ(hZXî>>> something = Something() >>> mock_response = Mock(spec=file) >>> mock_backend = Mock() >>> config = {'get_endpoint.return_value.create_call.return_value.start_call.return_value': mock_response} >>> mock_backend.configure_mock(**config)rÕh\hòh]h`hbjƒhd}rÖ(U testnodetyper×XdoctestrØh›hœhf]rÙhh]rÚhj]rÛhl]rÜhn]rÝUgroupsrÞ]rßh¤ah¥}ràuhqK_hrhhU]ráhXî>>> something = Something() >>> mock_response = Mock(spec=file) >>> mock_backend = Mock() >>> config = {'get_endpoint.return_value.create_call.return_value.start_call.return_value': mock_response} >>> mock_backend.configure_mock(**config)râ…rã}rä(hZUh\jÓubaubh«)rå}ræ(hZXRWith these we monkey patch the "mock backend" in place and can make the real call:rçh\hòh]h`hbh¯hd}rè(hj]réhl]rêhh]rëhf]rìhn]ríuhqKghrhhU]rîhXRWith these we monkey patch the "mock backend" in place and can make the real call:rï…rð}rñ(hZjçh\jåubaubj)rò}ró(hZX;>>> something.backend = mock_backend >>> something.method()rôh\hòh]h`hbjƒhd}rõ(U testnodetyperöXdoctestr÷h›hœhf]røhh]rùhj]rúhl]rûhn]rüUgroupsrý]rþh¤ah¥}rÿuhqKjhrhhU]rhX;>>> something.backend = mock_backend >>> something.method()r…r}r(hZUh\jòubaubh«)r}r(hZXUsing :attr:`~Mock.mock_calls` we can check the chained call with a single assert. A chained call is several calls in one line of code, so there will be several entries in `mock_calls`. We can use :meth:`call.call_list` to create this list of calls for us:rh\hòh]h`hbh¯hd}r(hj]rhl]r hh]r hf]r hn]r uhqKohrhhU]r (hXUsing r…r}r(hZXUsing rh\jubhÈ)r}r(hZX:attr:`~Mock.mock_calls`rh\jh]h`hbhÌhd}r(UreftyperXattrrhЉhÑXMock.mock_callsrU refdomainrXpyrhf]rhh]rU refexplicitr‰hj]rhl]rhn]r hÛhÜj%Nj&j'uhqKohU]r!j))r"}r#(hZjhd}r$(hj]r%hl]r&(häjXpy-attrr'ehh]r(hf]r)hn]r*uh\jhU]r+hX mock_callsr,…r-}r.(hZUh\j"ubahbj7ubaubhXŽ we can check the chained call with a single assert. A chained call is several calls in one line of code, so there will be several entries in r/…r0}r1(hZXŽ we can check the chained call with a single assert. A chained call is several calls in one line of code, so there will be several entries in r2h\jubj<)r3}r4(hZX `mock_calls`r5hd}r6(hj]r7hl]r8hh]r9hf]r:hn]r;uh\jhU]r<hX mock_callsr=…r>}r?(hZUh\j3ubahbjJubhX . We can use r@…rA}rB(hZX . We can use rCh\jubhÈ)rD}rE(hZX:meth:`call.call_list`rFh\jh]h`hbhÌhd}rG(UreftyperHXmethrIhЉhÑXcall.call_listrJU refdomainrKXpyrLhf]rMhh]rNU refexplicitrO‰hj]rPhl]rQhn]rRhÛhÜj%Nj&j'uhqKohU]rSj))rT}rU(hZjFhd}rV(hj]rWhl]rX(häjLXpy-methrYehh]rZhf]r[hn]r\uh\jDhU]r]hXcall.call_list()r^…r_}r`(hZUh\jTubahbj7ubaubhX% to create this list of calls for us:ra…rb}rc(hZX% to create this list of calls for us:rdh\jubeubj)re}rf(hZX¦>>> chained = call.get_endpoint('foobar').create_call('spam', 'eggs').start_call() >>> call_list = chained.call_list() >>> assert mock_backend.mock_calls == call_listrgh\hòh]h`hbjƒhd}rh(U testnodetyperiXdoctestrjh›hœhf]rkhh]rlhj]rmhl]rnhn]roUgroupsrp]rqh¤ah¥}rruhqKthrhhU]rshX¦>>> chained = call.get_endpoint('foobar').create_call('spam', 'eggs').start_call() >>> call_list = chained.call_list() >>> assert mock_backend.mock_calls == call_listrt…ru}rv(hZUh\jeubaubeubht)rw}rx(hZUh\huh]h`hbhyhd}ry(hj]rzhl]r{hh]r|hf]r}hMahn]r~h auhqK|hrhhU]r(hƒ)r€}r(hZXPartial mockingr‚h\jwh]h`hbh‡hd}rƒ(hj]r„hl]r…hh]r†hf]r‡hn]rˆuhqK|hrhhU]r‰hXPartial mockingrŠ…r‹}rŒ(hZj‚h\j€ubaubh«)r}rŽ(hZXhIn some tests I wanted to mock out a call to `datetime.date.today() `_ to return a known date, but I didn't want to prevent the code under test from creating new date objects. Unfortunately `datetime.date` is written in C, and so I couldn't just monkey-patch out the static `date.today` method.rh\jwh]h`hbh¯hd}r(hj]r‘hl]r’hh]r“hf]r”hn]r•uhqK~hrhhU]r–(hX-In some tests I wanted to mock out a call to r—…r˜}r™(hZX-In some tests I wanted to mock out a call to ršh\jubcdocutils.nodes reference r›)rœ}r(hZX[`datetime.date.today() `_ržhd}rŸ(Unamer Xdatetime.date.today()r¡Urefurir¢X@http://docs.python.org/library/datetime.html#datetime.date.todayr£hf]r¤hh]r¥hj]r¦hl]r§hn]r¨uh\jhU]r©hXdatetime.date.today()rª…r«}r¬(hZUh\jœubahbU referencer­ubhW)r®}r¯(hZXC r°U referencedr±Kh\jhbhchd}r²(Urefurir³j£hf]r´hCahh]rµhj]r¶hl]r·hn]r¸hauhU]r¹ubhXx to return a known date, but I didn't want to prevent the code under test from creating new date objects. Unfortunately rº…r»}r¼(hZXx to return a known date, but I didn't want to prevent the code under test from creating new date objects. Unfortunately r½h\jubj<)r¾}r¿(hZX`datetime.date`rÀhd}rÁ(hj]rÂhl]rÃhh]rÄhf]rÅhn]rÆuh\jhU]rÇhX datetime.daterÈ…rÉ}rÊ(hZUh\j¾ubahbjJubhXE is written in C, and so I couldn't just monkey-patch out the static rË…rÌ}rÍ(hZXE is written in C, and so I couldn't just monkey-patch out the static rÎh\jubj<)rÏ}rÐ(hZX `date.today`rÑhd}rÒ(hj]rÓhl]rÔhh]rÕhf]rÖhn]r×uh\jhU]rØhX date.todayrÙ…rÚ}rÛ(hZUh\jÏubahbjJubhX method.rÜ…rÝ}rÞ(hZX method.rßh\jubeubh«)rà}rá(hZXÀI found a simple way of doing this that involved effectively wrapping the date class with a mock, but passing through calls to the constructor to the real class (and returning real instances).râh\jwh]h`hbh¯hd}rã(hj]rähl]råhh]ræhf]rçhn]rèuhqK„hrhhU]réhXÀI found a simple way of doing this that involved effectively wrapping the date class with a mock, but passing through calls to the constructor to the real class (and returning real instances).rê…rë}rì(hZjâh\jàubaubh«)rí}rî(hZX=The :func:`patch decorator ` is used here to mock out the `date` class in the module under test. The :attr:`side_effect` attribute on the mock date class is then set to a lambda function that returns a real date. When the mock date class is called a real date will be constructed and returned by `side_effect`.rïh\jwh]h`hbh¯hd}rð(hj]rñhl]ròhh]róhf]rôhn]rõuhqKˆhrhhU]rö(hXThe r÷…rø}rù(hZXThe rúh\jíubhÈ)rû}rü(hZX:func:`patch decorator `rýh\jíh]h`hbhÌhd}rþ(UreftyperÿXfuncrhЉhÑXpatchrU refdomainrXpyrhf]rhh]rU refexplicitrˆhj]rhl]rhn]r hÛhÜj%Nj&j'uhqKˆhU]r j))r }r (hZjýhd}r (hj]rhl]r(häjXpy-funcrehh]rhf]rhn]ruh\jûhU]rhXpatch decoratorr…r}r(hZUh\j ubahbj7ubaubhX is used here to mock out the r…r}r(hZX is used here to mock out the rh\jíubj<)r}r(hZX`date`rhd}r(hj]r hl]r!hh]r"hf]r#hn]r$uh\jíhU]r%hXdater&…r'}r((hZUh\jubahbjJubhX% class in the module under test. The r)…r*}r+(hZX% class in the module under test. The r,h\jíubhÈ)r-}r.(hZX:attr:`side_effect`r/h\jíh]h`hbhÌhd}r0(Ureftyper1Xattrr2hЉhÑX side_effectr3U refdomainr4Xpyr5hf]r6hh]r7U refexplicitr8‰hj]r9hl]r:hn]r;hÛhÜj%Nj&j'uhqKˆhU]r<j))r=}r>(hZj/hd}r?(hj]r@hl]rA(häj5Xpy-attrrBehh]rChf]rDhn]rEuh\j-hU]rFhX side_effectrG…rH}rI(hZUh\j=ubahbj7ubaubhX° attribute on the mock date class is then set to a lambda function that returns a real date. When the mock date class is called a real date will be constructed and returned by rJ…rK}rL(hZX° attribute on the mock date class is then set to a lambda function that returns a real date. When the mock date class is called a real date will be constructed and returned by rMh\jíubj<)rN}rO(hZX `side_effect`rPhd}rQ(hj]rRhl]rShh]rThf]rUhn]rVuh\jíhU]rWhX side_effectrX…rY}rZ(hZUh\jNubahbjJubhX.…r[}r\(hZX.h\jíubeubj)r]}r^(hZXI>>> from datetime import date >>> with patch('mymodule.date') as mock_date: ... mock_date.today.return_value = date(2010, 10, 8) ... mock_date.side_effect = lambda *args, **kw: date(*args, **kw) ... ... assert mymodule.date.today() == date(2010, 10, 8) ... assert mymodule.date(2009, 6, 8) == date(2009, 6, 8) ...r_h\jwh]h`hbjƒhd}r`(U testnodetyperaXdoctestrbh›hœhf]rchh]rdhj]rehl]rfhn]rgUgroupsrh]rih¤ah¥}rjuhqKŽhrhhU]rkhXI>>> from datetime import date >>> with patch('mymodule.date') as mock_date: ... mock_date.today.return_value = date(2010, 10, 8) ... mock_date.side_effect = lambda *args, **kw: date(*args, **kw) ... ... assert mymodule.date.today() == date(2010, 10, 8) ... assert mymodule.date(2009, 6, 8) == date(2009, 6, 8) ...rl…rm}rn(hZUh\j]ubaubh«)ro}rp(hZXŒNote that we don't patch `datetime.date` globally, we patch `date` in the module that *uses* it. See :ref:`where to patch `.rqh\jwh]h`hbh¯hd}rr(hj]rshl]rthh]ruhf]rvhn]rwuhqK™hrhhU]rx(hXNote that we don't patch ry…rz}r{(hZXNote that we don't patch r|h\joubj<)r}}r~(hZX`datetime.date`rhd}r€(hj]rhl]r‚hh]rƒhf]r„hn]r…uh\johU]r†hX datetime.dater‡…rˆ}r‰(hZUh\j}ubahbjJubhX globally, we patch rŠ…r‹}rŒ(hZX globally, we patch rh\joubj<)rŽ}r(hZX`date`rhd}r‘(hj]r’hl]r“hh]r”hf]r•hn]r–uh\johU]r—hXdater˜…r™}rš(hZUh\jŽubahbjJubhX in the module that r›…rœ}r(hZX in the module that ržh\joubhÞ)rŸ}r (hZX*uses*r¡hd}r¢(hj]r£hl]r¤hh]r¥hf]r¦hn]r§uh\johU]r¨hXusesr©…rª}r«(hZUh\jŸubahbhíubhX it. See r¬…r­}r®(hZX it. See r¯h\joubhÈ)r°}r±(hZX&:ref:`where to patch `r²h\joh]h`hbhÌhd}r³(Ureftyper´XrefrµhЈhÑXwhere-to-patchr¶U refdomainr·Xstdr¸hf]r¹hh]rºU refexplicitr»ˆhj]r¼hl]r½hn]r¾hÛhÜuhqK™hU]r¿hÞ)rÀ}rÁ(hZj²hd}rÂ(hj]rÃhl]rÄ(häj¸Xstd-refrÅehh]rÆhf]rÇhn]rÈuh\j°hU]rÉhXwhere to patchrÊ…rË}rÌ(hZUh\jÀubahbhíubaubhX.…rÍ}rÎ(hZX.h\joubeubh«)rÏ}rÐ(hZX'When `date.today()` is called a known date is returned, but calls to the `date(...)` constructor still return normal dates. Without this you can find yourself having to calculate an expected result using exactly the same algorithm as the code under test, which is a classic testing anti-pattern.rÑh\jwh]h`hbh¯hd}rÒ(hj]rÓhl]rÔhh]rÕhf]rÖhn]r×uhqKœhrhhU]rØ(hXWhen rÙ…rÚ}rÛ(hZXWhen rÜh\jÏubj<)rÝ}rÞ(hZX`date.today()`rßhd}rà(hj]ráhl]râhh]rãhf]rähn]råuh\jÏhU]ræhX date.today()rç…rè}ré(hZUh\jÝubahbjJubhX6 is called a known date is returned, but calls to the rê…rë}rì(hZX6 is called a known date is returned, but calls to the ríh\jÏubj<)rî}rï(hZX `date(...)`rðhd}rñ(hj]ròhl]róhh]rôhf]rõhn]röuh\jÏhU]r÷hX date(...)rø…rù}rú(hZUh\jîubahbjJubhXÓ constructor still return normal dates. Without this you can find yourself having to calculate an expected result using exactly the same algorithm as the code under test, which is a classic testing anti-pattern.rû…rü}rý(hZXÓ constructor still return normal dates. Without this you can find yourself having to calculate an expected result using exactly the same algorithm as the code under test, which is a classic testing anti-pattern.rþh\jÏubeubh«)rÿ}r(hZXŒCalls to the date constructor are recorded in the `mock_date` attributes (`call_count` and friends) which may also be useful for your tests.rh\jwh]h`hbh¯hd}r(hj]rhl]rhh]rhf]rhn]ruhqK¡hrhhU]r(hX2Calls to the date constructor are recorded in the r …r }r (hZX2Calls to the date constructor are recorded in the r h\jÿubj<)r }r(hZX `mock_date`rhd}r(hj]rhl]rhh]rhf]rhn]ruh\jÿhU]rhX mock_dater…r}r(hZUh\j ubahbjJubhX attributes (r…r}r(hZX attributes (rh\jÿubj<)r}r(hZX `call_count`r hd}r!(hj]r"hl]r#hh]r$hf]r%hn]r&uh\jÿhU]r'hX call_countr(…r)}r*(hZUh\jubahbjJubhX6 and friends) which may also be useful for your tests.r+…r,}r-(hZX6 and friends) which may also be useful for your tests.r.h\jÿubeubh«)r/}r0(hZXÍAn alternative way of dealing with mocking dates, or other builtin classes, is discussed in `this blog entry `_.r1h\jwh]h`hbh¯hd}r2(hj]r3hl]r4hh]r5hf]r6hn]r7uhqK¤hrhhU]r8(hX\An alternative way of dealing with mocking dates, or other builtin classes, is discussed in r9…r:}r;(hZX\An alternative way of dealing with mocking dates, or other builtin classes, is discussed in r<h\j/ubj›)r=}r>(hZXp`this blog entry `_r?hd}r@(UnamerAXthis blog entryrBj¢X[http://williamjohnbert.com/2011/07/how-to-unit-testing-in-django-with-mocking-and-patching/rChf]rDhh]rEhj]rFhl]rGhn]rHuh\j/hU]rIhXthis blog entryrJ…rK}rL(hZUh\j=ubahbj­ubhW)rM}rN(hZX^ rOj±Kh\j/hbhchd}rP(UrefurirQjChf]rRhAahh]rShj]rThl]rUhn]rVhauhU]rWubhX.…rX}rY(hZX.h\j/ubeubeubht)rZ}r[(hZUh\huh]h`hbhyhd}r\(hj]r]hl]r^hh]r_hf]r`h1ahn]rahauhqKªhrhhU]rb(hƒ)rc}rd(hZXMocking a Generator Methodreh\jZh]h`hbh‡hd}rf(hj]rghl]rhhh]rihf]rjhn]rkuhqKªhrhhU]rlhXMocking a Generator Methodrm…rn}ro(hZjeh\jcubaubh«)rp}rq(hZXÊA Python generator is a function or method that uses the `yield statement `_ to return a series of values when iterated over [#]_.rrh\jZh]h`hbh¯hd}rs(hj]rthl]ruhh]rvhf]rwhn]rxuhqK¬hrhhU]ry(hX9A Python generator is a function or method that uses the rz…r{}r|(hZX9A Python generator is a function or method that uses the r}h\jpubj›)r~}r(hZX[`yield statement `_r€hd}r(Unamer‚Xyield statementrƒj¢XFhttp://docs.python.org/reference/simple_stmts.html#the-yield-statementr„hf]r…hh]r†hj]r‡hl]rˆhn]r‰uh\jphU]rŠhXyield statementr‹…rŒ}r(hZUh\j~ubahbj­ubhW)rŽ}r(hZXI rj±Kh\jphbhchd}r‘(Urefurir’j„hf]r“h7ahh]r”hj]r•hl]r–hn]r—h auhU]r˜ubhX1 to return a series of values when iterated over r™…rš}r›(hZX1 to return a series of values when iterated over rœh\jpubcdocutils.nodes footnote_reference r)rž}rŸ(hZX[#]_r Uresolvedr¡Kh\jphbUfootnote_referencer¢hd}r£(Uautor¤Khf]r¥Uid2r¦ahh]r§hj]r¨hl]r©hn]rªhph:uhU]r«hX1…r¬}r­(hZUh\jžubaubhX.…r®}r¯(hZX.h\jpubeubh«)r°}r±(hZXA generator method / function is called to return the generator object. It is the generator object that is then iterated over. The protocol method for iteration is `__iter__ `_, so we can mock this using a `MagicMock`.r²h\jZh]h`hbh¯hd}r³(hj]r´hl]rµhh]r¶hf]r·hn]r¸uhqK°hrhhU]r¹(hX¤A generator method / function is called to return the generator object. It is the generator object that is then iterated over. The protocol method for iteration is rº…r»}r¼(hZX¤A generator method / function is called to return the generator object. It is the generator object that is then iterated over. The protocol method for iteration is r½h\j°ubj›)r¾}r¿(hZXM`__iter__ `_rÀhd}rÁ(UnamerÂX__iter__rÃj¢X?http://docs.python.org/library/stdtypes.html#container.__iter__rÄhf]rÅhh]rÆhj]rÇhl]rÈhn]rÉuh\j°hU]rÊhX__iter__rË…rÌ}rÍ(hZUh\j¾ubahbj­ubhW)rÎ}rÏ(hZXB rÐj±Kh\j°hbhchd}rÑ(UrefurirÒjÄhf]rÓhFahh]rÔhj]rÕhl]rÖhn]r×hauhU]rØubhX, so we can mock this using a rÙ…rÚ}rÛ(hZX, so we can mock this using a rÜh\j°ubj<)rÝ}rÞ(hZX `MagicMock`rßhd}rà(hj]ráhl]râhh]rãhf]rähn]råuh\j°hU]ræhX MagicMockrç…rè}ré(hZUh\jÝubahbjJubhX.…rê}rë(hZX.h\j°ubeubh«)rì}rí(hZXIHere's an example class with an "iter" method implemented as a generator:rîh\jZh]h`hbh¯hd}rï(hj]rðhl]rñhh]ròhf]róhn]rôuhqK¶hrhhU]rõhXIHere's an example class with an "iter" method implemented as a generator:rö…r÷}rø(hZjîh\jìubaubj)rù}rú(hZX™>>> class Foo(object): ... def iter(self): ... for i in [1, 2, 3]: ... yield i ... >>> foo = Foo() >>> list(foo.iter()) [1, 2, 3]rûh\jZh]h`hbjƒhd}rü(U testnodetyperýXdoctestrþh›hœhf]rÿhh]rhj]rhl]rhn]rUgroupsr]rh¤ah¥}ruhqK¸hrhhU]rhX™>>> class Foo(object): ... def iter(self): ... for i in [1, 2, 3]: ... yield i ... >>> foo = Foo() >>> list(foo.iter()) [1, 2, 3]r…r }r (hZUh\jùubaubh«)r }r (hZXBHow would we mock this class, and in particular its "iter" method?r h\jZh]h`hbh¯hd}r(hj]rhl]rhh]rhf]rhn]ruhqKÄhrhhU]rhXBHow would we mock this class, and in particular its "iter" method?r…r}r(hZj h\j ubaubh«)r}r(hZX›To configure the values returned from the iteration (implicit in the call to `list`), we need to configure the object returned by the call to `foo.iter()`.rh\jZh]h`hbh¯hd}r(hj]rhl]rhh]rhf]rhn]r uhqKÆhrhhU]r!(hXMTo configure the values returned from the iteration (implicit in the call to r"…r#}r$(hZXMTo configure the values returned from the iteration (implicit in the call to r%h\jubj<)r&}r'(hZX`list`r(hd}r)(hj]r*hl]r+hh]r,hf]r-hn]r.uh\jhU]r/hXlistr0…r1}r2(hZUh\j&ubahbjJubhX;), we need to configure the object returned by the call to r3…r4}r5(hZX;), we need to configure the object returned by the call to r6h\jubj<)r7}r8(hZX `foo.iter()`r9hd}r:(hj]r;hl]r<hh]r=hf]r>hn]r?uh\jhU]r@hX foo.iter()rA…rB}rC(hZUh\j7ubahbjJubhX.…rD}rE(hZX.h\jubeubj)rF}rG(hZXo>>> mock_foo = MagicMock() >>> mock_foo.iter.return_value = iter([1, 2, 3]) >>> list(mock_foo.iter()) [1, 2, 3]rHh\jZh]h`hbjƒhd}rI(U testnodetyperJXdoctestrKh›hœhf]rLhh]rMhj]rNhl]rOhn]rPUgroupsrQ]rRh¤ah¥}rSuhqKÉhrhhU]rThXo>>> mock_foo = MagicMock() >>> mock_foo.iter.return_value = iter([1, 2, 3]) >>> list(mock_foo.iter()) [1, 2, 3]rU…rV}rW(hZUh\jFubaubcdocutils.nodes footnote rX)rY}rZ(hZX<There are also generator expressions and more `advanced uses `_ of generators, but we aren't concerned about them here. A very good introduction to generators and how powerful they are is: `Generator Tricks for Systems Programmers `_. r[h\jZh]h`hbUfootnoter\hd}r](j¤Khf]r^h:ahh]r_j¦ahj]r`hl]rahn]rbU1auhqKÐhrhhU]rc(cdocutils.nodes label rd)re}rf(hZUh\jYh]NhbUlabelrghd}rh(hj]rihl]rjhh]rkhf]rlhn]rmuhqNhrhhU]rnhX1…ro}rp(hZUh\jeubaubh«)rq}rr(hZX:There are also generator expressions and more `advanced uses `_ of generators, but we aren't concerned about them here. A very good introduction to generators and how powerful they are is: `Generator Tricks for Systems Programmers `_.rsh\jYh]h`hbh¯hd}rt(hj]ruhl]rvhh]rwhf]rxhn]ryuhqKÐhU]rz(hX.There are also generator expressions and more r{…r|}r}(hZX.There are also generator expressions and more r~h\jqubj›)r}r€(hZX>`advanced uses `_rhd}r‚(UnamerƒX advanced usesr„j¢X+http://www.dabeaz.com/coroutines/index.htmlr…hf]r†hh]r‡hj]rˆhl]r‰hn]rŠuh\jqhU]r‹hX advanced usesrŒ…r}rŽ(hZUh\jubahbj­ubhW)r}r(hZX. r‘j±Kh\jqhbhchd}r’(Urefurir“j…hf]r”hDahh]r•hj]r–hl]r—hn]r˜hauhU]r™ubhX~ of generators, but we aren't concerned about them here. A very good introduction to generators and how powerful they are is: rš…r›}rœ(hZX~ of generators, but we aren't concerned about them here. A very good introduction to generators and how powerful they are is: rh\jqubj›)rž}rŸ(hZXO`Generator Tricks for Systems Programmers `_r hd}r¡(Unamer¢X(Generator Tricks for Systems Programmersr£j¢X!http://www.dabeaz.com/generators/r¤hf]r¥hh]r¦hj]r§hl]r¨hn]r©uh\jqhU]rªhX(Generator Tricks for Systems Programmersr«…r¬}r­(hZUh\jžubahbj­ubhW)r®}r¯(hZX$ r°j±Kh\jqhbhchd}r±(Urefurir²j¤hf]r³hLahh]r´hj]rµhl]r¶hn]r·hauhU]r¸ubhX.…r¹}rº(hZX.h\jqubeubeubeubht)r»}r¼(hZUh\huh]h`hbhyhd}r½(hj]r¾hl]r¿hh]rÀhf]rÁhPahn]rÂh#auhqKØhrhhU]rÃ(hƒ)rÄ}rÅ(hZX,Applying the same patch to every test methodrÆh\j»h]h`hbh‡hd}rÇ(hj]rÈhl]rÉhh]rÊhf]rËhn]rÌuhqKØhrhhU]rÍhX,Applying the same patch to every test methodrÎ…rÏ}rÐ(hZjÆh\jÄubaubh«)rÑ}rÒ(hZXIf you want several patches in place for multiple test methods the obvious way is to apply the patch decorators to every method. This can feel like unnecessary repetition. For Python 2.6 or more recent you can use `patch` (in all its various forms) as a class decorator. This applies the patches to all test methods on the class. A test method is identified by methods whose names start with `test`:rÓh\j»h]h`hbh¯hd}rÔ(hj]rÕhl]rÖhh]r×hf]rØhn]rÙuhqKÚhrhhU]rÚ(hXÖIf you want several patches in place for multiple test methods the obvious way is to apply the patch decorators to every method. This can feel like unnecessary repetition. For Python 2.6 or more recent you can use rÛ…rÜ}rÝ(hZXÖIf you want several patches in place for multiple test methods the obvious way is to apply the patch decorators to every method. This can feel like unnecessary repetition. For Python 2.6 or more recent you can use rÞh\jÑubj<)rß}rà(hZX`patch`ráhd}râ(hj]rãhl]rähh]råhf]ræhn]rçuh\jÑhU]rèhXpatchré…rê}rë(hZUh\jßubahbjJubhX« (in all its various forms) as a class decorator. This applies the patches to all test methods on the class. A test method is identified by methods whose names start with rì…rí}rî(hZX« (in all its various forms) as a class decorator. This applies the patches to all test methods on the class. A test method is identified by methods whose names start with rïh\jÑubj<)rð}rñ(hZX`test`ròhd}ró(hj]rôhl]rõhh]röhf]r÷hn]røuh\jÑhU]rùhXtestrú…rû}rü(hZUh\jðubahbjJubhX:…rý}rþ(hZX:h\jÑubeubj)rÿ}r(hZXÕ>>> @patch('mymodule.SomeClass') ... class MyTest(TestCase): ... ... def test_one(self, MockSomeClass): ... self.assertTrue(mymodule.SomeClass is MockSomeClass) ... ... def test_two(self, MockSomeClass): ... self.assertTrue(mymodule.SomeClass is MockSomeClass) ... ... def not_a_test(self): ... return 'something' ... >>> MyTest('test_one').test_one() >>> MyTest('test_two').test_two() >>> MyTest('test_two').not_a_test() 'something'rh\j»h]h`hbjƒhd}r(U testnodetyperXdoctestrh›hœhf]rhh]rhj]rhl]rhn]r Ugroupsr ]r h¤ah¥}r uhqKáhrhhU]r hXÕ>>> @patch('mymodule.SomeClass') ... class MyTest(TestCase): ... ... def test_one(self, MockSomeClass): ... self.assertTrue(mymodule.SomeClass is MockSomeClass) ... ... def test_two(self, MockSomeClass): ... self.assertTrue(mymodule.SomeClass is MockSomeClass) ... ... def not_a_test(self): ... return 'something' ... >>> MyTest('test_one').test_one() >>> MyTest('test_two').test_two() >>> MyTest('test_two').not_a_test() 'something'r…r}r(hZUh\jÿubaubh«)r}r(hZXšAn alternative way of managing patches is to use the :ref:`start-and-stop`. These allow you to move the patching into your `setUp` and `tearDown` methods.rh\j»h]h`hbh¯hd}r(hj]rhl]rhh]rhf]rhn]ruhqKôhrhhU]r(hX5An alternative way of managing patches is to use the r…r}r(hZX5An alternative way of managing patches is to use the rh\jubhÈ)r}r (hZX:ref:`start-and-stop`r!h\jh]h`hbhÌhd}r"(Ureftyper#Xrefr$hЈhÑXstart-and-stopr%U refdomainr&Xstdr'hf]r(hh]r)U refexplicitr*‰hj]r+hl]r,hn]r-hÛhÜuhqKôhU]r.hÞ)r/}r0(hZj!hd}r1(hj]r2hl]r3(häj'Xstd-refr4ehh]r5hf]r6hn]r7uh\jhU]r8hXstart-and-stopr9…r:}r;(hZUh\j/ubahbhíubaubhX1. These allow you to move the patching into your r<…r=}r>(hZX1. These allow you to move the patching into your r?h\jubj<)r@}rA(hZX`setUp`rBhd}rC(hj]rDhl]rEhh]rFhf]rGhn]rHuh\jhU]rIhXsetUprJ…rK}rL(hZUh\j@ubahbjJubhX and rM…rN}rO(hZX and rPh\jubj<)rQ}rR(hZX `tearDown`rShd}rT(hj]rUhl]rVhh]rWhf]rXhn]rYuh\jhU]rZhXtearDownr[…r\}r](hZUh\jQubahbjJubhX methods.r^…r_}r`(hZX methods.rah\jubeubj)rb}rc(hZXR>>> class MyTest(TestCase): ... def setUp(self): ... self.patcher = patch('mymodule.foo') ... self.mock_foo = self.patcher.start() ... ... def test_foo(self): ... self.assertTrue(mymodule.foo is self.mock_foo) ... ... def tearDown(self): ... self.patcher.stop() ... >>> MyTest('test_foo').run()rdh\j»h]h`hbjƒhd}re(U testnodetyperfXdoctestrgh›hœhf]rhhh]rihj]rjhl]rkhn]rlUgroupsrm]rnh¤ah¥}rouhqK÷hrhhU]rphXR>>> class MyTest(TestCase): ... def setUp(self): ... self.patcher = patch('mymodule.foo') ... self.mock_foo = self.patcher.start() ... ... def test_foo(self): ... self.assertTrue(mymodule.foo is self.mock_foo) ... ... def tearDown(self): ... self.patcher.stop() ... >>> MyTest('test_foo').run()rq…rr}rs(hZUh\jbubaubh«)rt}ru(hZX+If you use this technique you must ensure that the patching is "undone" by calling `stop`. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. `unittest2 `_ cleanup functions make this simpler:rvh\j»h]h`hbh¯hd}rw(hj]rxhl]ryhh]rzhf]r{hn]r|uhqMhrhhU]r}(hXSIf you use this technique you must ensure that the patching is "undone" by calling r~…r}r€(hZXSIf you use this technique you must ensure that the patching is "undone" by calling rh\jtubj<)r‚}rƒ(hZX`stop`r„hd}r…(hj]r†hl]r‡hh]rˆhf]r‰hn]rŠuh\jthU]r‹hXstoprŒ…r}rŽ(hZUh\j‚ubahbjJubhXy. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. r…r}r‘(hZXy. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. r’h\jtubj›)r“}r”(hZX4`unittest2 `_r•hd}r–(Unamer—X unittest2r˜j¢X%http://pypi.python.org/pypi/unittest2r™hf]ršhh]r›hj]rœhl]rhn]ržuh\jthU]rŸhX unittest2r …r¡}r¢(hZUh\j“ubahbj­ubhW)r£}r¤(hZX( r¥j±Kh\jthbhchd}r¦(Urefurir§j™hf]r¨h@ahh]r©hj]rªhl]r«hn]r¬hauhU]r­ubhX% cleanup functions make this simpler:r®…r¯}r°(hZX% cleanup functions make this simpler:r±h\jtubeubj)r²}r³(hZX2>>> class MyTest(TestCase): ... def setUp(self): ... patcher = patch('mymodule.foo') ... self.addCleanup(patcher.stop) ... self.mock_foo = patcher.start() ... ... def test_foo(self): ... self.assertTrue(mymodule.foo is self.mock_foo) ... >>> MyTest('test_foo').run()r´h\j»h]h`hbjƒhd}rµ(U testnodetyper¶Xdoctestr·h›hœhf]r¸hh]r¹hj]rºhl]r»hn]r¼Ugroupsr½]r¾h¤ah¥}r¿uhqM hrhhU]rÀhX2>>> class MyTest(TestCase): ... def setUp(self): ... patcher = patch('mymodule.foo') ... self.addCleanup(patcher.stop) ... self.mock_foo = patcher.start() ... ... def test_foo(self): ... self.assertTrue(mymodule.foo is self.mock_foo) ... >>> MyTest('test_foo').run()rÁ…rÂ}rÃ(hZUh\j²ubaubeubht)rÄ}rÅ(hZUh\huh]h`hbhyhd}rÆ(hj]rÇhl]rÈhh]rÉhf]rÊhEahn]rËhauhqMhrhhU]rÌ(hƒ)rÍ}rÎ(hZXMocking Unbound MethodsrÏh\jÄh]h`hbh‡hd}rÐ(hj]rÑhl]rÒhh]rÓhf]rÔhn]rÕuhqMhrhhU]rÖhXMocking Unbound Methodsr×…rØ}rÙ(hZjÏh\jÍubaubh«)rÚ}rÛ(hZX¶Whilst writing tests today I needed to patch an *unbound method* (patching the method on the class rather than on the instance). I needed self to be passed in as the first argument because I want to make asserts about which objects were calling this particular method. The issue is that you can't patch with a mock for this, because if you replace an unbound method with a mock it doesn't become a bound method when fetched from the instance, and so it doesn't get self passed in. The workaround is to patch the unbound method with a real function instead. The :func:`patch` decorator makes it so simple to patch out methods with a mock that having to create a real function becomes a nuisance.rÜh\jÄh]h`hbh¯hd}rÝ(hj]rÞhl]rßhh]ràhf]ráhn]râuhqMhrhhU]rã(hX0Whilst writing tests today I needed to patch an rä…rå}ræ(hZX0Whilst writing tests today I needed to patch an rçh\jÚubhÞ)rè}ré(hZX*unbound method*rêhd}rë(hj]rìhl]ríhh]rîhf]rïhn]rðuh\jÚhU]rñhXunbound methodrò…ró}rô(hZUh\jèubahbhíubhXñ (patching the method on the class rather than on the instance). I needed self to be passed in as the first argument because I want to make asserts about which objects were calling this particular method. The issue is that you can't patch with a mock for this, because if you replace an unbound method with a mock it doesn't become a bound method when fetched from the instance, and so it doesn't get self passed in. The workaround is to patch the unbound method with a real function instead. The rõ…rö}r÷(hZXñ (patching the method on the class rather than on the instance). I needed self to be passed in as the first argument because I want to make asserts about which objects were calling this particular method. The issue is that you can't patch with a mock for this, because if you replace an unbound method with a mock it doesn't become a bound method when fetched from the instance, and so it doesn't get self passed in. The workaround is to patch the unbound method with a real function instead. The røh\jÚubhÈ)rù}rú(hZX :func:`patch`rûh\jÚh]h`hbhÌhd}rü(UreftyperýXfuncrþhЉhÑXpatchrÿU refdomainrXpyrhf]rhh]rU refexplicitr‰hj]rhl]rhn]rhÛhÜj%Nj&j'uhqMhU]rj))r }r (hZjûhd}r (hj]r hl]r (häjXpy-funcrehh]rhf]rhn]ruh\jùhU]rhXpatch()r…r}r(hZUh\j ubahbj7ubaubhXx decorator makes it so simple to patch out methods with a mock that having to create a real function becomes a nuisance.r…r}r(hZXx decorator makes it so simple to patch out methods with a mock that having to create a real function becomes a nuisance.rh\jÚubeubh«)r}r(hZXIf you pass `autospec=True` to patch then it does the patching with a *real* function object. This function object has the same signature as the one it is replacing, but delegates to a mock under the hood. You still get your mock auto-created in exactly the same way as before. What it means though, is that if you use it to patch out an unbound method on a class the mocked function will be turned into a bound method if it is fetched from an instance. It will have `self` passed in as the first argument, which is exactly what I wanted:rh\jÄh]h`hbh¯hd}r(hj]rhl]rhh]r hf]r!hn]r"uhqM(hrhhU]r#(hX If you pass r$…r%}r&(hZX If you pass r'h\jubj<)r(}r)(hZX`autospec=True`r*hd}r+(hj]r,hl]r-hh]r.hf]r/hn]r0uh\jhU]r1hX autospec=Truer2…r3}r4(hZUh\j(ubahbjJubhX+ to patch then it does the patching with a r5…r6}r7(hZX+ to patch then it does the patching with a r8h\jubhÞ)r9}r:(hZX*real*r;hd}r<(hj]r=hl]r>hh]r?hf]r@hn]rAuh\jhU]rBhXrealrC…rD}rE(hZUh\j9ubahbhíubhX‡ function object. This function object has the same signature as the one it is replacing, but delegates to a mock under the hood. You still get your mock auto-created in exactly the same way as before. What it means though, is that if you use it to patch out an unbound method on a class the mocked function will be turned into a bound method if it is fetched from an instance. It will have rF…rG}rH(hZX‡ function object. This function object has the same signature as the one it is replacing, but delegates to a mock under the hood. You still get your mock auto-created in exactly the same way as before. What it means though, is that if you use it to patch out an unbound method on a class the mocked function will be turned into a bound method if it is fetched from an instance. It will have rIh\jubj<)rJ}rK(hZX`self`rLhd}rM(hj]rNhl]rOhh]rPhf]rQhn]rRuh\jhU]rShXselfrT…rU}rV(hZUh\jJubahbjJubhXA passed in as the first argument, which is exactly what I wanted:rW…rX}rY(hZXA passed in as the first argument, which is exactly what I wanted:rZh\jubeubj)r[}r\(hZXô>>> class Foo(object): ... def foo(self): ... pass ... >>> with patch.object(Foo, 'foo', autospec=True) as mock_foo: ... mock_foo.return_value = 'foo' ... foo = Foo() ... foo.foo() ... 'foo' >>> mock_foo.assert_called_once_with(foo)r]h\jÄh]h`hbjƒhd}r^(U testnodetyper_Xdoctestr`h›hœhf]rahh]rbhj]rchl]rdhn]reUgroupsrf]rgh¤ah¥}rhuhqM1hrhhU]rihXô>>> class Foo(object): ... def foo(self): ... pass ... >>> with patch.object(Foo, 'foo', autospec=True) as mock_foo: ... mock_foo.return_value = 'foo' ... foo = Foo() ... foo.foo() ... 'foo' >>> mock_foo.assert_called_once_with(foo)rj…rk}rl(hZUh\j[ubaubh«)rm}rn(hZX‚If we don't use `autospec=True` then the unbound method is patched out with a Mock instance instead, and isn't called with `self`.roh\jÄh]h`hbh¯hd}rp(hj]rqhl]rrhh]rshf]rthn]ruuhqM?hrhhU]rv(hXIf we don't use rw…rx}ry(hZXIf we don't use rzh\jmubj<)r{}r|(hZX`autospec=True`r}hd}r~(hj]rhl]r€hh]rhf]r‚hn]rƒuh\jmhU]r„hX autospec=Truer……r†}r‡(hZUh\j{ubahbjJubhX\ then the unbound method is patched out with a Mock instance instead, and isn't called with rˆ…r‰}rŠ(hZX\ then the unbound method is patched out with a Mock instance instead, and isn't called with r‹h\jmubj<)rŒ}r(hZX`self`rŽhd}r(hj]rhl]r‘hh]r’hf]r“hn]r”uh\jmhU]r•hXselfr–…r—}r˜(hZUh\jŒubahbjJubhX.…r™}rš(hZX.h\jmubeubeubht)r›}rœ(hZUh\huh]h`hbhyhd}r(hj]ržhl]rŸhh]r hf]r¡h=ahn]r¢hauhqMDhrhhU]r£(hƒ)r¤}r¥(hZX!Checking multiple calls with mockr¦h\j›h]h`hbh‡hd}r§(hj]r¨hl]r©hh]rªhf]r«hn]r¬uhqMDhrhhU]r­hX!Checking multiple calls with mockr®…r¯}r°(hZj¦h\j¤ubaubh«)r±}r²(hZXOmock has a nice API for making assertions about how your mock objects are used.r³h\j›h]h`hbh¯hd}r´(hj]rµhl]r¶hh]r·hf]r¸hn]r¹uhqMFhrhhU]rºhXOmock has a nice API for making assertions about how your mock objects are used.r»…r¼}r½(hZj³h\j±ubaubj)r¾}r¿(hZX“>>> mock = Mock() >>> mock.foo_bar.return_value = None >>> mock.foo_bar('baz', spam='eggs') >>> mock.foo_bar.assert_called_with('baz', spam='eggs')rÀh\j›h]h`hbjƒhd}rÁ(U testnodetyperÂXdoctestrÃh›hœhf]rÄhh]rÅhj]rÆhl]rÇhn]rÈUgroupsrÉ]rÊh¤ah¥}rËuhqMHhrhhU]rÌhX“>>> mock = Mock() >>> mock.foo_bar.return_value = None >>> mock.foo_bar('baz', spam='eggs') >>> mock.foo_bar.assert_called_with('baz', spam='eggs')rÍ…rÎ}rÏ(hZUh\j¾ubaubh«)rÐ}rÑ(hZX“If your mock is only being called once you can use the :meth:`assert_called_once_with` method that also asserts that the :attr:`call_count` is one.rÒh\j›h]h`hbh¯hd}rÓ(hj]rÔhl]rÕhh]rÖhf]r×hn]rØuhqMOhrhhU]rÙ(hX7If your mock is only being called once you can use the rÚ…rÛ}rÜ(hZX7If your mock is only being called once you can use the rÝh\jÐubhÈ)rÞ}rß(hZX:meth:`assert_called_once_with`ràh\jÐh]h`hbhÌhd}rá(UreftyperâXmethrãhЉhÑXassert_called_once_withräU refdomainråXpyræhf]rçhh]rèU refexplicitré‰hj]rêhl]rëhn]rìhÛhÜj%Nj&j'uhqMOhU]ríj))rî}rï(hZjàhd}rð(hj]rñhl]rò(häjæXpy-methróehh]rôhf]rõhn]röuh\jÞhU]r÷hXassert_called_once_with()rø…rù}rú(hZUh\jîubahbj7ubaubhX# method that also asserts that the rû…rü}rý(hZX# method that also asserts that the rþh\jÐubhÈ)rÿ}r (hZX:attr:`call_count`r h\jÐh]h`hbhÌhd}r (Ureftyper Xattrr hЉhÑX call_countr U refdomainr Xpyr hf]r hh]r U refexplicitr ‰hj]r hl]r hn]r hÛhÜj%Nj&j'uhqMOhU]r j))r }r (hZj hd}r (hj]r hl]r (häj Xpy-attrr ehh]r hf]r hn]r uh\jÿhU]r hX call_countr …r }r (hZUh\j ubahbj7ubaubhX is one.r …r }r (hZX is one.r h\jÐubeubj)r }r! (hZXó>>> mock.foo_bar.assert_called_once_with('baz', spam='eggs') >>> mock.foo_bar() >>> mock.foo_bar.assert_called_once_with('baz', spam='eggs') Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times.r" h\j›h]h`hbjƒhd}r# (U testnodetyper$ Xdoctestr% h›hœhf]r& hh]r' hj]r( hl]r) hn]r* Ugroupsr+ ]r, h¤ah¥}r- uhqMShrhhU]r. hXó>>> mock.foo_bar.assert_called_once_with('baz', spam='eggs') >>> mock.foo_bar() >>> mock.foo_bar.assert_called_once_with('baz', spam='eggs') Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times.r/ …r0 }r1 (hZUh\j ubaubh«)r2 }r3 (hZXùBoth `assert_called_with` and `assert_called_once_with` make assertions about the *most recent* call. If your mock is going to be called several times, and you want to make assertions about *all* those calls you can use :attr:`~Mock.call_args_list`:r4 h\j›h]h`hbh¯hd}r5 (hj]r6 hl]r7 hh]r8 hf]r9 hn]r: uhqM\hrhhU]r; (hXBoth r< …r= }r> (hZXBoth r? h\j2 ubj<)r@ }rA (hZX`assert_called_with`rB hd}rC (hj]rD hl]rE hh]rF hf]rG hn]rH uh\j2 hU]rI hXassert_called_withrJ …rK }rL (hZUh\j@ ubahbjJubhX and rM …rN }rO (hZX and rP h\j2 ubj<)rQ }rR (hZX`assert_called_once_with`rS hd}rT (hj]rU hl]rV hh]rW hf]rX hn]rY uh\j2 hU]rZ hXassert_called_once_withr[ …r\ }r] (hZUh\jQ ubahbjJubhX make assertions about the r^ …r_ }r` (hZX make assertions about the ra h\j2 ubhÞ)rb }rc (hZX *most recent*rd hd}re (hj]rf hl]rg hh]rh hf]ri hn]rj uh\j2 hU]rk hX most recentrl …rm }rn (hZUh\jb ubahbhíubhX_ call. If your mock is going to be called several times, and you want to make assertions about ro …rp }rq (hZX_ call. If your mock is going to be called several times, and you want to make assertions about rr h\j2 ubhÞ)rs }rt (hZX*all*ru hd}rv (hj]rw hl]rx hh]ry hf]rz hn]r{ uh\j2 hU]r| hXallr} …r~ }r (hZUh\js ubahbhíubhX those calls you can use r€ …r }r‚ (hZX those calls you can use rƒ h\j2 ubhÈ)r„ }r… (hZX:attr:`~Mock.call_args_list`r† h\j2 h]h`hbhÌhd}r‡ (Ureftyperˆ Xattrr‰ hЉhÑXMock.call_args_listrŠ U refdomainr‹ XpyrŒ hf]r hh]rŽ U refexplicitr ‰hj]r hl]r‘ hn]r’ hÛhÜj%Nj&j'uhqM\hU]r“ j))r” }r• (hZj† hd}r– (hj]r— hl]r˜ (häjŒ Xpy-attrr™ ehh]rš hf]r› hn]rœ uh\j„ hU]r hXcall_args_listrž …rŸ }r  (hZUh\j” ubahbj7ubaubhX:…r¡ }r¢ (hZX:h\j2 ubeubj)r£ }r¤ (hZX>>> mock = Mock(return_value=None) >>> mock(1, 2, 3) >>> mock(4, 5, 6) >>> mock() >>> mock.call_args_list [call(1, 2, 3), call(4, 5, 6), call()]r¥ h\j›h]h`hbjƒhd}r¦ (U testnodetyper§ Xdoctestr¨ h›hœhf]r© hh]rª hj]r« hl]r¬ hn]r­ Ugroupsr® ]r¯ h¤ah¥}r° uhqMahrhhU]r± hX>>> mock = Mock(return_value=None) >>> mock(1, 2, 3) >>> mock(4, 5, 6) >>> mock() >>> mock.call_args_list [call(1, 2, 3), call(4, 5, 6), call()]r² …r³ }r´ (hZUh\j£ ubaubh«)rµ }r¶ (hZXÜThe :data:`call` helper makes it easy to make assertions about these calls. You can build up a list of expected calls and compare it to `call_args_list`. This looks remarkably similar to the repr of the `call_args_list`:r· h\j›h]h`hbh¯hd}r¸ (hj]r¹ hl]rº hh]r» hf]r¼ hn]r½ uhqMjhrhhU]r¾ (hXThe r¿ …rÀ }rÁ (hZXThe r h\jµ ubhÈ)rà }rÄ (hZX :data:`call`rÅ h\jµ h]h`hbhÌhd}rÆ (UreftyperÇ XdatarÈ hЉhÑXcallrÉ U refdomainrÊ XpyrË hf]rÌ hh]rÍ U refexplicitrÎ ‰hj]rÏ hl]rÐ hn]rÑ hÛhÜj%Nj&j'uhqMjhU]rÒ j))rÓ }rÔ (hZjÅ hd}rÕ (hj]rÖ hl]r× (häjË Xpy-datarØ ehh]rÙ hf]rÚ hn]rÛ uh\jà hU]rÜ hXcallrÝ …rÞ }rß (hZUh\jÓ ubahbj7ubaubhXx helper makes it easy to make assertions about these calls. You can build up a list of expected calls and compare it to rà …rá }râ (hZXx helper makes it easy to make assertions about these calls. You can build up a list of expected calls and compare it to rã h\jµ ubj<)rä }rå (hZX`call_args_list`ræ hd}rç (hj]rè hl]ré hh]rê hf]rë hn]rì uh\jµ hU]rí hXcall_args_listrî …rï }rð (hZUh\jä ubahbjJubhX3. This looks remarkably similar to the repr of the rñ …rò }ró (hZX3. This looks remarkably similar to the repr of the rô h\jµ ubj<)rõ }rö (hZX`call_args_list`r÷ hd}rø (hj]rù hl]rú hh]rû hf]rü hn]rý uh\jµ hU]rþ hXcall_args_listrÿ …r }r (hZUh\jõ ubahbjJubhX:…r }r (hZX:h\jµ ubeubj)r }r (hZX^>>> expected = [call(1, 2, 3), call(4, 5, 6), call()] >>> mock.call_args_list == expected Truer h\j›h]h`hbjƒhd}r (U testnodetyper Xdoctestr h›hœhf]r hh]r hj]r hl]r hn]r Ugroupsr ]r h¤ah¥}r uhqMnhrhhU]r hX^>>> expected = [call(1, 2, 3), call(4, 5, 6), call()] >>> mock.call_args_list == expected Truer …r }r (hZUh\j ubaubeubht)r }r (hZUh\huh]h`hbhyhd}r (hj]r hl]r hh]r hf]r h3ahn]r hauhqMvhrhhU]r (hƒ)r }r (hZXCoping with mutable argumentsr! h\j h]h`hbh‡hd}r" (hj]r# hl]r$ hh]r% hf]r& hn]r' uhqMvhrhhU]r( hXCoping with mutable argumentsr) …r* }r+ (hZj! h\j ubaubh«)r, }r- (hZX6Another situation is rare, but can bite you, is when your mock is called with mutable arguments. `call_args` and `call_args_list` store *references* to the arguments. If the arguments are mutated by the code under test then you can no longer make assertions about what the values were when the mock was called.r. h\j h]h`hbh¯hd}r/ (hj]r0 hl]r1 hh]r2 hf]r3 hn]r4 uhqMxhrhhU]r5 (hXaAnother situation is rare, but can bite you, is when your mock is called with mutable arguments. r6 …r7 }r8 (hZXaAnother situation is rare, but can bite you, is when your mock is called with mutable arguments. r9 h\j, ubj<)r: }r; (hZX `call_args`r< hd}r= (hj]r> hl]r? hh]r@ hf]rA hn]rB uh\j, hU]rC hX call_argsrD …rE }rF (hZUh\j: ubahbjJubhX and rG …rH }rI (hZX and rJ h\j, ubj<)rK }rL (hZX`call_args_list`rM hd}rN (hj]rO hl]rP hh]rQ hf]rR hn]rS uh\j, hU]rT hXcall_args_listrU …rV }rW (hZUh\jK ubahbjJubhX store rX …rY }rZ (hZX store r[ h\j, ubhÞ)r\ }r] (hZX *references*r^ hd}r_ (hj]r` hl]ra hh]rb hf]rc hn]rd uh\j, hU]re hX referencesrf …rg }rh (hZUh\j\ ubahbhíubhX¢ to the arguments. If the arguments are mutated by the code under test then you can no longer make assertions about what the values were when the mock was called.ri …rj }rk (hZX¢ to the arguments. If the arguments are mutated by the code under test then you can no longer make assertions about what the values were when the mock was called.rl h\j, ubeubh«)rm }rn (hZXhHere's some example code that shows the problem. Imagine the following functions defined in 'mymodule'::ro h\j h]h`hbh¯hd}rp (hj]rq hl]rr hh]rs hf]rt hn]ru uhqM}hrhhU]rv hXgHere's some example code that shows the problem. Imagine the following functions defined in 'mymodule':rw …rx }ry (hZXgHere's some example code that shows the problem. Imagine the following functions defined in 'mymodule':rz h\jm ubaubj)r{ }r| (hZXidef frob(val): pass def grob(val): "First frob and then clear val" frob(val) val.clear()r} h\j h]h`hbjƒhd}r~ (h›hœhf]r hh]r€ hj]r hl]r‚ hn]rƒ uhqM€hrhhU]r„ hXidef frob(val): pass def grob(val): "First frob and then clear val" frob(val) val.clear()r… …r† }r‡ (hZUh\j{ ubaubh«)rˆ }r‰ (hZXYWhen we try to test that `grob` calls `frob` with the correct argument look what happens:rŠ h\j h]h`hbh¯hd}r‹ (hj]rŒ hl]r hh]rŽ hf]r hn]r uhqMˆhrhhU]r‘ (hXWhen we try to test that r’ …r“ }r” (hZXWhen we try to test that r• h\jˆ ubj<)r– }r— (hZX`grob`r˜ hd}r™ (hj]rš hl]r› hh]rœ hf]r hn]rž uh\jˆ hU]rŸ hXgrobr  …r¡ }r¢ (hZUh\j– ubahbjJubhX calls r£ …r¤ }r¥ (hZX calls r¦ h\jˆ ubj<)r§ }r¨ (hZX`frob`r© hd}rª (hj]r« hl]r¬ hh]r­ hf]r® hn]r¯ uh\jˆ hU]r° hXfrobr± …r² }r³ (hZUh\j§ ubahbjJubhX- with the correct argument look what happens:r´ …rµ }r¶ (hZX- with the correct argument look what happens:r· h\jˆ ubeubj)r¸ }r¹ (hZX>>> with patch('mymodule.frob') as mock_frob: ... val = set([6]) ... mymodule.grob(val) ... >>> val set([]) >>> mock_frob.assert_called_with(set([6])) Traceback (most recent call last): ... AssertionError: Expected: ((set([6]),), {}) Called with: ((set([]),), {})rº h\j h]h`hbjƒhd}r» (U testnodetyper¼ Xdoctestr½ h›hœhf]r¾ hh]r¿ hj]rÀ hl]rÁ hn]r Ugroupsrà ]rÄ h¤ah¥}rÅ uhqM‹hrhhU]rÆ hX>>> with patch('mymodule.frob') as mock_frob: ... val = set([6]) ... mymodule.grob(val) ... >>> val set([]) >>> mock_frob.assert_called_with(set([6])) Traceback (most recent call last): ... AssertionError: Expected: ((set([6]),), {}) Called with: ((set([]),), {})rÇ …rÈ }rÉ (hZUh\j¸ ubaubh«)rÊ }rË (hZX£One possibility would be for mock to copy the arguments you pass in. This could then cause problems if you do assertions that rely on object identity for equality.rÌ h\j h]h`hbh¯hd}rÍ (hj]rÎ hl]rÏ hh]rÐ hf]rÑ hn]rÒ uhqM™hrhhU]rÓ hX£One possibility would be for mock to copy the arguments you pass in. This could then cause problems if you do assertions that rely on object identity for equality.rÔ …rÕ }rÖ (hZjÌ h\jÊ ubaubh«)r× }rØ (hZXºHere's one solution that uses the :attr:`side_effect` functionality. If you provide a `side_effect` function for a mock then `side_effect` will be called with the same args as the mock. This gives us an opportunity to copy the arguments and store them for later assertions. In this example I'm using *another* mock to store the arguments so that I can use the mock methods for doing the assertion. Again a helper function sets this up for me.rÙ h\j h]h`hbh¯hd}rÚ (hj]rÛ hl]rÜ hh]rÝ hf]rÞ hn]rß uhqMhrhhU]rà (hX"Here's one solution that uses the rá …râ }rã (hZX"Here's one solution that uses the rä h\j× ubhÈ)rå }ræ (hZX:attr:`side_effect`rç h\j× h]h`hbhÌhd}rè (Ureftyperé Xattrrê hЉhÑX side_effectrë U refdomainrì Xpyrí hf]rî hh]rï U refexplicitrð ‰hj]rñ hl]rò hn]ró hÛhÜj%Nj&j'uhqMhU]rô j))rõ }rö (hZjç hd}r÷ (hj]rø hl]rù (häjí Xpy-attrrú ehh]rû hf]rü hn]rý uh\jå hU]rþ hX side_effectrÿ …r }r (hZUh\jõ ubahbj7ubaubhX! functionality. If you provide a r …r }r (hZX! functionality. If you provide a r h\j× ubj<)r }r (hZX `side_effect`r hd}r (hj]r hl]r hh]r hf]r hn]r uh\j× hU]r hX side_effectr …r }r (hZUh\j ubahbjJubhX function for a mock then r …r }r (hZX function for a mock then r h\j× ubj<)r }r (hZX `side_effect`r hd}r (hj]r hl]r hh]r hf]r hn]r uh\j× hU]r hX side_effectr! …r" }r# (hZUh\j ubahbjJubhX¢ will be called with the same args as the mock. This gives us an opportunity to copy the arguments and store them for later assertions. In this example I'm using r$ …r% }r& (hZX¢ will be called with the same args as the mock. This gives us an opportunity to copy the arguments and store them for later assertions. In this example I'm using r' h\j× ubhÞ)r( }r) (hZX *another*r* hd}r+ (hj]r, hl]r- hh]r. hf]r/ hn]r0 uh\j× hU]r1 hXanotherr2 …r3 }r4 (hZUh\j( ubahbhíubhX… mock to store the arguments so that I can use the mock methods for doing the assertion. Again a helper function sets this up for me.r5 …r6 }r7 (hZX… mock to store the arguments so that I can use the mock methods for doing the assertion. Again a helper function sets this up for me.r8 h\j× ubeubj)r9 }r: (hZXV>>> from copy import deepcopy >>> from mock import Mock, patch, DEFAULT >>> def copy_call_args(mock): ... new_mock = Mock() ... def side_effect(*args, **kwargs): ... args = deepcopy(args) ... kwargs = deepcopy(kwargs) ... new_mock(*args, **kwargs) ... return DEFAULT ... mock.side_effect = side_effect ... return new_mock ... >>> with patch('mymodule.frob') as mock_frob: ... new_mock = copy_call_args(mock_frob) ... val = set([6]) ... mymodule.grob(val) ... >>> new_mock.assert_called_with(set([6])) >>> new_mock.call_args call(set([6]))r; h\j h]h`hbjƒhd}r< (U testnodetyper= Xdoctestr> h›hœhf]r? hh]r@ hj]rA hl]rB hn]rC UgroupsrD ]rE h¤ah¥}rF uhqM¥hrhhU]rG hXV>>> from copy import deepcopy >>> from mock import Mock, patch, DEFAULT >>> def copy_call_args(mock): ... new_mock = Mock() ... def side_effect(*args, **kwargs): ... args = deepcopy(args) ... kwargs = deepcopy(kwargs) ... new_mock(*args, **kwargs) ... return DEFAULT ... mock.side_effect = side_effect ... return new_mock ... >>> with patch('mymodule.frob') as mock_frob: ... new_mock = copy_call_args(mock_frob) ... val = set([6]) ... mymodule.grob(val) ... >>> new_mock.assert_called_with(set([6])) >>> new_mock.call_args call(set([6]))rH …rI }rJ (hZUh\j9 ubaubh«)rK }rL (hZXÌ`copy_call_args` is called with the mock that will be called. It returns a new mock that we do the assertion on. The `side_effect` function makes a copy of the args and calls our `new_mock` with the copy.rM h\j h]h`hbh¯hd}rN (hj]rO hl]rP hh]rQ hf]rR hn]rS uhqM¼hrhhU]rT (j<)rU }rV (hZX`copy_call_args`rW hd}rX (hj]rY hl]rZ hh]r[ hf]r\ hn]r] uh\jK hU]r^ hXcopy_call_argsr_ …r` }ra (hZUh\jU ubahbjJubhXe is called with the mock that will be called. It returns a new mock that we do the assertion on. The rb …rc }rd (hZXe is called with the mock that will be called. It returns a new mock that we do the assertion on. The re h\jK ubj<)rf }rg (hZX `side_effect`rh hd}ri (hj]rj hl]rk hh]rl hf]rm hn]rn uh\jK hU]ro hX side_effectrp …rq }rr (hZUh\jf ubahbjJubhX1 function makes a copy of the args and calls our rs …rt }ru (hZX1 function makes a copy of the args and calls our rv h\jK ubj<)rw }rx (hZX `new_mock`ry hd}rz (hj]r{ hl]r| hh]r} hf]r~ hn]r uh\jK hU]r€ hXnew_mockr …r‚ }rƒ (hZUh\jw ubahbjJubhX with the copy.r„ …r… }r† (hZX with the copy.r‡ h\jK ubeubcdocutils.nodes note rˆ )r‰ }rŠ (hZX«If your mock is only going to be used once there is an easier way of checking arguments at the point they are called. You can simply do the checking inside a `side_effect` function. .. doctest:: >>> def side_effect(arg): ... assert arg == set([6]) ... >>> mock = Mock(side_effect=side_effect) >>> mock(set([6])) >>> mock(set()) Traceback (most recent call last): ... AssertionErrorr‹ h\j h]NhbUnoterŒ hd}r (hj]rŽ hl]r hh]r hf]r‘ hn]r’ uhqNhrhhU]r“ (h«)r” }r• (hZXµIf your mock is only going to be used once there is an easier way of checking arguments at the point they are called. You can simply do the checking inside a `side_effect` function.r– h\j‰ h]h`hbh¯hd}r— (hj]r˜ hl]r™ hh]rš hf]r› hn]rœ uhqMÂhU]r (hXžIf your mock is only going to be used once there is an easier way of checking arguments at the point they are called. You can simply do the checking inside a rž …rŸ }r  (hZXžIf your mock is only going to be used once there is an easier way of checking arguments at the point they are called. You can simply do the checking inside a r¡ h\j” ubj<)r¢ }r£ (hZX `side_effect`r¤ hd}r¥ (hj]r¦ hl]r§ hh]r¨ hf]r© hn]rª uh\j” hU]r« hX side_effectr¬ …r­ }r® (hZUh\j¢ ubahbjJubhX function.r¯ …r° }r± (hZX function.r² h\j” ubeubj)r³ }r´ (hZXÂ>>> def side_effect(arg): ... assert arg == set([6]) ... >>> mock = Mock(side_effect=side_effect) >>> mock(set([6])) >>> mock(set()) Traceback (most recent call last): ... AssertionErrorrµ h\j‰ h]h`hbjƒhd}r¶ (U testnodetyper· Xdoctestr¸ h›hœhf]r¹ hh]rº hj]r» hl]r¼ hn]r½ Ugroupsr¾ ]r¿ h¤ah¥}rÀ uhqMÆhU]rÁ hXÂ>>> def side_effect(arg): ... assert arg == set([6]) ... >>> mock = Mock(side_effect=side_effect) >>> mock(set([6])) >>> mock(set()) Traceback (most recent call last): ... AssertionErrorr …rà }rÄ (hZUh\j³ ubaubeubh«)rÅ }rÆ (hZX×An alternative approach is to create a subclass of `Mock` or `MagicMock` that copies (using `copy.deepcopy `_) the arguments. Here's an example implementation:rÇ h\j h]h`hbh¯hd}rÈ (hj]rÉ hl]rÊ hh]rË hf]rÌ hn]rÍ uhqMÒhrhhU]rÎ (hX3An alternative approach is to create a subclass of rÏ …rÐ }rÑ (hZX3An alternative approach is to create a subclass of rÒ h\jÅ ubj<)rÓ }rÔ (hZX`Mock`rÕ hd}rÖ (hj]r× hl]rØ hh]rÙ hf]rÚ hn]rÛ uh\jÅ hU]rÜ hXMockrÝ …rÞ }rß (hZUh\jÓ ubahbjJubhX or rà …rá }râ (hZX or rã h\jÅ ubj<)rä }rå (hZX `MagicMock`ræ hd}rç (hj]rè hl]ré hh]rê hf]rë hn]rì uh\jÅ hU]rí hX MagicMockrî …rï }rð (hZUh\jä ubahbjJubhX that copies (using rñ …rò }ró (hZX that copies (using rô h\jÅ ubj›)rõ }rö (hZXI`copy.deepcopy `_r÷ hd}rø (Unamerù X copy.deepcopyrú j¢X6http://docs.python.org/library/copy.html#copy.deepcopyrû hf]rü hh]rý hj]rþ hl]rÿ hn]r uh\jÅ hU]r hX copy.deepcopyr …r }r (hZUh\jõ ubahbj­ubhW)r }r (hZX9 r j±Kh\jÅ hbhchd}r (Urefurir jû hf]r h8ahh]r hj]r hl]r hn]r h auhU]r ubhX2) the arguments. Here's an example implementation:r …r }r (hZX2) the arguments. Here's an example implementation:r h\jÅ ubeubj)r }r (hZX2>>> from copy import deepcopy >>> class CopyingMock(MagicMock): ... def __call__(self, *args, **kwargs): ... args = deepcopy(args) ... kwargs = deepcopy(kwargs) ... return super(CopyingMock, self).__call__(*args, **kwargs) ... >>> c = CopyingMock(return_value=None) >>> arg = set() >>> c(arg) >>> arg.add(1) >>> c.assert_called_with(set()) >>> c.assert_called_with(arg) Traceback (most recent call last): ... AssertionError: Expected call: mock(set([1])) Actual call: mock(set([])) >>> c.foo r h\j h]h`hbjƒhd}r (U testnodetyper Xdoctestr h›hœhf]r hh]r hj]r hl]r hn]r Ugroupsr ]r h¤ah¥}r! uhqM×hrhhU]r" hX2>>> from copy import deepcopy >>> class CopyingMock(MagicMock): ... def __call__(self, *args, **kwargs): ... args = deepcopy(args) ... kwargs = deepcopy(kwargs) ... return super(CopyingMock, self).__call__(*args, **kwargs) ... >>> c = CopyingMock(return_value=None) >>> arg = set() >>> c(arg) >>> arg.add(1) >>> c.assert_called_with(set()) >>> c.assert_called_with(arg) Traceback (most recent call last): ... AssertionError: Expected call: mock(set([1])) Actual call: mock(set([])) >>> c.foo r# …r$ }r% (hZUh\j ubaubh«)r& }r' (hZXÚWhen you subclass `Mock` or `MagicMock` all dynamically created attributes, and the `return_value` will use your subclass automatically. That means all children of a `CopyingMock` will also have the type `CopyingMock`.r( h\j h]h`hbh¯hd}r) (hj]r* hl]r+ hh]r, hf]r- hn]r. uhqMíhrhhU]r/ (hXWhen you subclass r0 …r1 }r2 (hZXWhen you subclass r3 h\j& ubj<)r4 }r5 (hZX`Mock`r6 hd}r7 (hj]r8 hl]r9 hh]r: hf]r; hn]r< uh\j& hU]r= hXMockr> …r? }r@ (hZUh\j4 ubahbjJubhX or rA …rB }rC (hZX or rD h\j& ubj<)rE }rF (hZX `MagicMock`rG hd}rH (hj]rI hl]rJ hh]rK hf]rL hn]rM uh\j& hU]rN hX MagicMockrO …rP }rQ (hZUh\jE ubahbjJubhX- all dynamically created attributes, and the rR …rS }rT (hZX- all dynamically created attributes, and the rU h\j& ubj<)rV }rW (hZX`return_value`rX hd}rY (hj]rZ hl]r[ hh]r\ hf]r] hn]r^ uh\j& hU]r_ hX return_valuer` …ra }rb (hZUh\jV ubahbjJubhXD will use your subclass automatically. That means all children of a rc …rd }re (hZXD will use your subclass automatically. That means all children of a rf h\j& ubj<)rg }rh (hZX `CopyingMock`ri hd}rj (hj]rk hl]rl hh]rm hf]rn hn]ro uh\j& hU]rp hX CopyingMockrq …rr }rs (hZUh\jg ubahbjJubhX will also have the type rt …ru }rv (hZX will also have the type rw h\j& ubj<)rx }ry (hZX `CopyingMock`rz hd}r{ (hj]r| hl]r} hh]r~ hf]r hn]r€ uh\j& hU]r hX CopyingMockr‚ …rƒ }r„ (hZUh\jx ubahbjJubhX.…r… }r† (hZX.h\j& ubeubeubht)r‡ }rˆ (hZUh\huh]h`hbhyhd}r‰ (hj]rŠ hl]r‹ hh]rŒ hf]r hOahn]rŽ h"auhqMóhrhhU]r (hƒ)r }r‘ (hZX&Raising exceptions on attribute accessr’ h\j‡ h]h`hbh‡hd}r“ (hj]r” hl]r• hh]r– hf]r— hn]r˜ uhqMóhrhhU]r™ hX&Raising exceptions on attribute accessrš …r› }rœ (hZj’ h\j ubaubh«)r }rž (hZX‡You can use :class:`PropertyMock` to mimic the behaviour of properties. This includes raising exceptions when an attribute is accessed.rŸ h\j‡ h]h`hbh¯hd}r  (hj]r¡ hl]r¢ hh]r£ hf]r¤ hn]r¥ uhqMõhrhhU]r¦ (hX You can use r§ …r¨ }r© (hZX You can use rª h\j ubhÈ)r« }r¬ (hZX:class:`PropertyMock`r­ h\j h]h`hbhÌhd}r® (Ureftyper¯ Xclassr° hЉhÑX PropertyMockr± U refdomainr² Xpyr³ hf]r´ hh]rµ U refexplicitr¶ ‰hj]r· hl]r¸ hn]r¹ hÛhÜj%Nj&j'uhqMõhU]rº j))r» }r¼ (hZj­ hd}r½ (hj]r¾ hl]r¿ (häj³ Xpy-classrÀ ehh]rÁ hf]r hn]rà uh\j« hU]rÄ hX PropertyMockrÅ …rÆ }rÇ (hZUh\j» ubahbj7ubaubhXf to mimic the behaviour of properties. This includes raising exceptions when an attribute is accessed.rÈ …rÉ }rÊ (hZXf to mimic the behaviour of properties. This includes raising exceptions when an attribute is accessed.rË h\j ubeubh«)rÌ }rÍ (hZXNHere's an example raising a `ValueError` when the 'foo' attribute is accessed:rÎ h\j‡ h]h`hbh¯hd}rÏ (hj]rÐ hl]rÑ hh]rÒ hf]rÓ hn]rÔ uhqMøhrhhU]rÕ (hXHere's an example raising a rÖ …r× }rØ (hZXHere's an example raising a rÙ h\jÌ ubj<)rÚ }rÛ (hZX `ValueError`rÜ hd}rÝ (hj]rÞ hl]rß hh]rà hf]rá hn]râ uh\jÌ hU]rã hX ValueErrorrä …rå }ræ (hZUh\jÚ ubahbjJubhX& when the 'foo' attribute is accessed:rç …rè }ré (hZX& when the 'foo' attribute is accessed:rê h\jÌ ubeubj)rë }rì (hZX‘>>> m = MagicMock() >>> p = PropertyMock(side_effect=ValueError) >>> type(m).foo = p >>> m.foo Traceback (most recent call last): .... ValueErrorrí h\j‡ h]h`hbjƒhd}rî (U testnodetyperï Xdoctestrð h›hœhf]rñ hh]rò hj]ró hl]rô hn]rõ Ugroupsrö ]r÷ h¤ah¥}rø uhqMúhrhhU]rù hX‘>>> m = MagicMock() >>> p = PropertyMock(side_effect=ValueError) >>> type(m).foo = p >>> m.foo Traceback (most recent call last): .... ValueErrorrú …rû }rü (hZUh\jë ubaubh«)rý }rþ (hZXBecause every mock object has its own type, a new subclass of whichever mock class you're using, all mock objects are isolated from each other. You can safely attach properties (or other descriptors or whatever you want in fact) to `type(mock)` without affecting other mock objects.rÿ h\j‡ h]h`hbh¯hd}r (hj]r hl]r hh]r hf]r hn]r uhqMhrhhU]r (hXèBecause every mock object has its own type, a new subclass of whichever mock class you're using, all mock objects are isolated from each other. You can safely attach properties (or other descriptors or whatever you want in fact) to r …r }r (hZXèBecause every mock object has its own type, a new subclass of whichever mock class you're using, all mock objects are isolated from each other. You can safely attach properties (or other descriptors or whatever you want in fact) to r h\jý ubj<)r }r (hZX `type(mock)`r hd}r (hj]r hl]r hh]r hf]r hn]r uh\jý hU]r hX type(mock)r …r }r (hZUh\j ubahbjJubhX& without affecting other mock objects.r …r }r (hZX& without affecting other mock objects.r h\jý ubeubeubht)r }r (hZUh\huh]h`hbhyhd}r (hj]r hl]r hh]r! hf]r" hBahn]r# hauhqM hrhhU]r$ (hƒ)r% }r& (hZX%Multiple calls with different effectsr' h\j h]h`hbh‡hd}r( (hj]r) hl]r* hh]r+ hf]r, hn]r- uhqM hrhhU]r. hX%Multiple calls with different effectsr/ …r0 }r1 (hZj' h\j% ubaubjˆ )r2 }r3 (hZX‚In mock 1.0 the handling of iterable `side_effect` was changed. Any exceptions in the iterable will be raised instead of returned.r4 h\j h]h`hbjŒ hd}r5 (hj]r6 hl]r7 hh]r8 hf]r9 hn]r: uhqNhrhhU]r; h«)r< }r= (hZX‚In mock 1.0 the handling of iterable `side_effect` was changed. Any exceptions in the iterable will be raised instead of returned.r> h\j2 h]h`hbh¯hd}r? (hj]r@ hl]rA hh]rB hf]rC hn]rD uhqMhU]rE (hX%In mock 1.0 the handling of iterable rF …rG }rH (hZX%In mock 1.0 the handling of iterable rI h\j< ubj<)rJ }rK (hZX `side_effect`rL hd}rM (hj]rN hl]rO hh]rP hf]rQ hn]rR uh\j< hU]rS hX side_effectrT …rU }rV (hZUh\jJ ubahbjJubhXP was changed. Any exceptions in the iterable will be raised instead of returned.rW …rX }rY (hZXP was changed. Any exceptions in the iterable will be raised instead of returned.rZ h\j< ubeubaubh«)r[ }r\ (hZXHandling code that needs to behave differently on subsequent calls during the test can be tricky. For example you may have a function that needs to raise an exception the first time it is called but returns a response on the second call (testing retry behaviour).r] h\j h]h`hbh¯hd}r^ (hj]r_ hl]r` hh]ra hf]rb hn]rc uhqMhrhhU]rd hXHandling code that needs to behave differently on subsequent calls during the test can be tricky. For example you may have a function that needs to raise an exception the first time it is called but returns a response on the second call (testing retry behaviour).re …rf }rg (hZj] h\j[ ubaubh«)rh }ri (hZXÖOne approach is to use a :attr:`side_effect` function that replaces itself. The first time it is called the `side_effect` sets a new `side_effect` that will be used for the second call. It then raises an exception:rj h\j h]h`hbh¯hd}rk (hj]rl hl]rm hh]rn hf]ro hn]rp uhqMhrhhU]rq (hXOne approach is to use a rr …rs }rt (hZXOne approach is to use a ru h\jh ubhÈ)rv }rw (hZX:attr:`side_effect`rx h\jh h]h`hbhÌhd}ry (Ureftyperz Xattrr{ hЉhÑX side_effectr| U refdomainr} Xpyr~ hf]r hh]r€ U refexplicitr ‰hj]r‚ hl]rƒ hn]r„ hÛhÜj%Nj&j'uhqMhU]r… j))r† }r‡ (hZjx hd}rˆ (hj]r‰ hl]rŠ (häj~ Xpy-attrr‹ ehh]rŒ hf]r hn]rŽ uh\jv hU]r hX side_effectr …r‘ }r’ (hZUh\j† ubahbj7ubaubhX@ function that replaces itself. The first time it is called the r“ …r” }r• (hZX@ function that replaces itself. The first time it is called the r– h\jh ubj<)r— }r˜ (hZX `side_effect`r™ hd}rš (hj]r› hl]rœ hh]r hf]rž hn]rŸ uh\jh hU]r  hX side_effectr¡ …r¢ }r£ (hZUh\j— ubahbjJubhX sets a new r¤ …r¥ }r¦ (hZX sets a new r§ h\jh ubj<)r¨ }r© (hZX `side_effect`rª hd}r« (hj]r¬ hl]r­ hh]r® hf]r¯ hn]r° uh\jh hU]r± hX side_effectr² …r³ }r´ (hZUh\j¨ ubahbjJubhXD that will be used for the second call. It then raises an exception:rµ …r¶ }r· (hZXD that will be used for the second call. It then raises an exception:r¸ h\jh ubeubj)r¹ }rº (hZXT>>> def side_effect(*args): ... def second_call(*args): ... return 'response' ... mock.side_effect = second_call ... raise Exception('boom') ... >>> mock = Mock(side_effect=side_effect) >>> mock('first') Traceback (most recent call last): ... Exception: boom >>> mock('second') 'response' >>> mock.assert_called_with('second')r» h\j h]h`hbjƒhd}r¼ (U testnodetyper½ Xdoctestr¾ h›hœhf]r¿ hh]rÀ hj]rÁ hl]r hn]rà UgroupsrÄ ]rÅ h¤ah¥}rÆ uhqMhrhhU]rÇ hXT>>> def side_effect(*args): ... def second_call(*args): ... return 'response' ... mock.side_effect = second_call ... raise Exception('boom') ... >>> mock = Mock(side_effect=side_effect) >>> mock('first') Traceback (most recent call last): ... Exception: boom >>> mock('second') 'response' >>> mock.assert_called_with('second')rÈ …rÉ }rÊ (hZUh\j¹ ubaubh«)rË }rÌ (hZXAnother perfectly valid way would be to pop return values from a list. If the return value is an exception, raise it instead of returning it:rÍ h\j h]h`hbh¯hd}rÎ (hj]rÏ hl]rÐ hh]rÑ hf]rÒ hn]rÓ uhqM,hrhhU]rÔ hXAnother perfectly valid way would be to pop return values from a list. If the return value is an exception, raise it instead of returning it:rÕ …rÖ }r× (hZjÍ h\jË ubaubj)rØ }rÙ (hZXv>>> returns = [Exception('boom'), 'response'] >>> def side_effect(*args): ... result = returns.pop(0) ... if isinstance(result, Exception): ... raise result ... return result ... >>> mock = Mock(side_effect=side_effect) >>> mock('first') Traceback (most recent call last): ... Exception: boom >>> mock('second') 'response' >>> mock.assert_called_with('second')rÚ h\j h]h`hbjƒhd}rÛ (U testnodetyperÜ XdoctestrÝ h›hœhf]rÞ hh]rß hj]rà hl]rá hn]râ Ugroupsrã ]rä h¤ah¥}rå uhqM/hrhhU]ræ hXv>>> returns = [Exception('boom'), 'response'] >>> def side_effect(*args): ... result = returns.pop(0) ... if isinstance(result, Exception): ... raise result ... return result ... >>> mock = Mock(side_effect=side_effect) >>> mock('first') Traceback (most recent call last): ... Exception: boom >>> mock('second') 'response' >>> mock.assert_called_with('second')rç …rè }ré (hZUh\jØ ubaubh«)rê }rë (hZXWhich approach you prefer is a matter of taste. The first approach is actually a line shorter but maybe the second approach is more readable.rì h\j h]h`hbh¯hd}rí (hj]rî hl]rï hh]rð hf]rñ hn]rò uhqMAhrhhU]ró hXWhich approach you prefer is a matter of taste. The first approach is actually a line shorter but maybe the second approach is more readable.rô …rõ }rö (hZjì h\jê ubaubeubht)r÷ }rø (hZUh\huh]h`hbhyhd}rù (hj]rú hl]rû hh]rü hf]rý hRahn]rþ h%auhqMFhrhhU]rÿ (hƒ)r}r(hZXNesting Patchesrh\j÷ h]h`hbh‡hd}r(hj]rhl]rhh]rhf]rhn]ruhqMFhrhhU]r hXNesting Patchesr …r }r (hZjh\jubaubh«)r }r(hZXŸUsing patch as a context manager is nice, but if you do multiple patches you can end up with nested with statements indenting further and further to the right:rh\j÷ h]h`hbh¯hd}r(hj]rhl]rhh]rhf]rhn]ruhqMHhrhhU]rhXŸUsing patch as a context manager is nice, but if you do multiple patches you can end up with nested with statements indenting further and further to the right:r…r}r(hZjh\j ubaubj)r}r(hZXõ>>> class MyTest(TestCase): ... ... def test_foo(self): ... with patch('mymodule.Foo') as mock_foo: ... with patch('mymodule.Bar') as mock_bar: ... with patch('mymodule.Spam') as mock_spam: ... assert mymodule.Foo is mock_foo ... assert mymodule.Bar is mock_bar ... assert mymodule.Spam is mock_spam ... >>> original = mymodule.Foo >>> MyTest('test_foo').test_foo() >>> assert mymodule.Foo is originalrh\j÷ h]h`hbjƒhd}r(U testnodetyperXdoctestrh›hœhf]r hh]r!hj]r"hl]r#hn]r$Ugroupsr%]r&h¤ah¥}r'uhqMLhrhhU]r(hXõ>>> class MyTest(TestCase): ... ... def test_foo(self): ... with patch('mymodule.Foo') as mock_foo: ... with patch('mymodule.Bar') as mock_bar: ... with patch('mymodule.Spam') as mock_spam: ... assert mymodule.Foo is mock_foo ... assert mymodule.Bar is mock_bar ... assert mymodule.Spam is mock_spam ... >>> original = mymodule.Foo >>> MyTest('test_foo').test_foo() >>> assert mymodule.Foo is originalr)…r*}r+(hZUh\jubaubh«)r,}r-(hZXåWith unittest2_ `cleanup` functions and the :ref:`start-and-stop` we can achieve the same effect without the nested indentation. A simple helper method, `create_patch`, puts the patch in place and returns the created mock for us:r.h\j÷ h]h`hbh¯hd}r/(hj]r0hl]r1hh]r2hf]r3hn]r4uhqM\hrhhU]r5(hXWith r6…r7}r8(hZXWith r9h\j,ubj›)r:}r;(hZX unittest2_r<j¡Kh\j,hbj­hd}r=(Unamer>X unittest2r?j¢j™hf]r@hh]rAhj]rBhl]rChn]rDuhU]rEhX unittest2rF…rG}rH(hZUh\j:ubaubhX …rI}rJ(hZX h\j,ubj<)rK}rL(hZX `cleanup`rMhd}rN(hj]rOhl]rPhh]rQhf]rRhn]rSuh\j,hU]rThXcleanuprU…rV}rW(hZUh\jKubahbjJubhX functions and the rX…rY}rZ(hZX functions and the r[h\j,ubhÈ)r\}r](hZX:ref:`start-and-stop`r^h\j,h]h`hbhÌhd}r_(Ureftyper`XrefrahЈhÑXstart-and-stoprbU refdomainrcXstdrdhf]rehh]rfU refexplicitrg‰hj]rhhl]rihn]rjhÛhÜuhqM\hU]rkhÞ)rl}rm(hZj^hd}rn(hj]rohl]rp(häjdXstd-refrqehh]rrhf]rshn]rtuh\j\hU]ruhXstart-and-stoprv…rw}rx(hZUh\jlubahbhíubaubhXX we can achieve the same effect without the nested indentation. A simple helper method, ry…rz}r{(hZXX we can achieve the same effect without the nested indentation. A simple helper method, r|h\j,ubj<)r}}r~(hZX`create_patch`rhd}r€(hj]rhl]r‚hh]rƒhf]r„hn]r…uh\j,hU]r†hX create_patchr‡…rˆ}r‰(hZUh\j}ubahbjJubhX>, puts the patch in place and returns the created mock for us:rŠ…r‹}rŒ(hZX>, puts the patch in place and returns the created mock for us:rh\j,ubeubj)rŽ}r(hZX†>>> class MyTest(TestCase): ... ... def create_patch(self, name): ... patcher = patch(name) ... thing = patcher.start() ... self.addCleanup(patcher.stop) ... return thing ... ... def test_foo(self): ... mock_foo = self.create_patch('mymodule.Foo') ... mock_bar = self.create_patch('mymodule.Bar') ... mock_spam = self.create_patch('mymodule.Spam') ... ... assert mymodule.Foo is mock_foo ... assert mymodule.Bar is mock_bar ... assert mymodule.Spam is mock_spam ... >>> original = mymodule.Foo >>> MyTest('test_foo').run() >>> assert mymodule.Foo is originalrh\j÷ h]h`hbjƒhd}r‘(U testnodetyper’Xdoctestr“h›hœhf]r”hh]r•hj]r–hl]r—hn]r˜Ugroupsr™]ršh¤ah¥}r›uhqMahrhhU]rœhX†>>> class MyTest(TestCase): ... ... def create_patch(self, name): ... patcher = patch(name) ... thing = patcher.start() ... self.addCleanup(patcher.stop) ... return thing ... ... def test_foo(self): ... mock_foo = self.create_patch('mymodule.Foo') ... mock_bar = self.create_patch('mymodule.Bar') ... mock_spam = self.create_patch('mymodule.Spam') ... ... assert mymodule.Foo is mock_foo ... assert mymodule.Bar is mock_bar ... assert mymodule.Spam is mock_spam ... >>> original = mymodule.Foo >>> MyTest('test_foo').run() >>> assert mymodule.Foo is originalr…rž}rŸ(hZUh\jŽubaubeubht)r }r¡(hZUh\huh]h`hbhyhd}r¢(hj]r£hl]r¤hh]r¥hf]r¦hNahn]r§h!auhqMzhrhhU]r¨(hƒ)r©}rª(hZX#Mocking a dictionary with MagicMockr«h\j h]h`hbh‡hd}r¬(hj]r­hl]r®hh]r¯hf]r°hn]r±uhqMzhrhhU]r²hX#Mocking a dictionary with MagicMockr³…r´}rµ(hZj«h\j©ubaubh«)r¶}r·(hZX‰You may want to mock a dictionary, or other container object, recording all access to it whilst having it still behave like a dictionary.r¸h\j h]h`hbh¯hd}r¹(hj]rºhl]r»hh]r¼hf]r½hn]r¾uhqM|hrhhU]r¿hX‰You may want to mock a dictionary, or other container object, recording all access to it whilst having it still behave like a dictionary.rÀ…rÁ}rÂ(hZj¸h\j¶ubaubh«)rÃ}rÄ(hZXÉWe can do this with :class:`MagicMock`, which will behave like a dictionary, and using :data:`~Mock.side_effect` to delegate dictionary access to a real underlying dictionary that is under our control.rÅh\j h]h`hbh¯hd}rÆ(hj]rÇhl]rÈhh]rÉhf]rÊhn]rËuhqMhrhhU]rÌ(hXWe can do this with rÍ…rÎ}rÏ(hZXWe can do this with rÐh\jÃubhÈ)rÑ}rÒ(hZX:class:`MagicMock`rÓh\jÃh]h`hbhÌhd}rÔ(UreftyperÕXclassrÖhЉhÑX MagicMockr×U refdomainrØXpyrÙhf]rÚhh]rÛU refexplicitr܉hj]rÝhl]rÞhn]rßhÛhÜj%Nj&j'uhqMhU]ràj))rá}râ(hZjÓhd}rã(hj]rähl]rå(häjÙXpy-classræehh]rçhf]rèhn]réuh\jÑhU]rêhX MagicMockrë…rì}rí(hZUh\jáubahbj7ubaubhX1, which will behave like a dictionary, and using rî…rï}rð(hZX1, which will behave like a dictionary, and using rñh\jÃubhÈ)rò}ró(hZX:data:`~Mock.side_effect`rôh\jÃh]h`hbhÌhd}rõ(UreftyperöXdatar÷hЉhÑXMock.side_effectrøU refdomainrùXpyrúhf]rûhh]rüU refexplicitrý‰hj]rþhl]rÿhn]rhÛhÜj%Nj&j'uhqMhU]rj))r}r(hZjôhd}r(hj]rhl]r(häjúXpy-datarehh]rhf]r hn]r uh\jòhU]r hX side_effectr …r }r(hZUh\jubahbj7ubaubhXY to delegate dictionary access to a real underlying dictionary that is under our control.r…r}r(hZXY to delegate dictionary access to a real underlying dictionary that is under our control.rh\jÃubeubh«)r}r(hZXëWhen the `__getitem__` and `__setitem__` methods of our `MagicMock` are called (normal dictionary access) then `side_effect` is called with the key (and in the case of `__setitem__` the value too). We can also control what is returned.rh\j h]h`hbh¯hd}r(hj]rhl]rhh]rhf]rhn]ruhqMƒhrhhU]r(hX When the r…r}r(hZX When the r h\jubj<)r!}r"(hZX `__getitem__`r#hd}r$(hj]r%hl]r&hh]r'hf]r(hn]r)uh\jhU]r*hX __getitem__r+…r,}r-(hZUh\j!ubahbjJubhX and r.…r/}r0(hZX and r1h\jubj<)r2}r3(hZX `__setitem__`r4hd}r5(hj]r6hl]r7hh]r8hf]r9hn]r:uh\jhU]r;hX __setitem__r<…r=}r>(hZUh\j2ubahbjJubhX methods of our r?…r@}rA(hZX methods of our rBh\jubj<)rC}rD(hZX `MagicMock`rEhd}rF(hj]rGhl]rHhh]rIhf]rJhn]rKuh\jhU]rLhX MagicMockrM…rN}rO(hZUh\jCubahbjJubhX, are called (normal dictionary access) then rP…rQ}rR(hZX, are called (normal dictionary access) then rSh\jubj<)rT}rU(hZX `side_effect`rVhd}rW(hj]rXhl]rYhh]rZhf]r[hn]r\uh\jhU]r]hX side_effectr^…r_}r`(hZUh\jTubahbjJubhX, is called with the key (and in the case of ra…rb}rc(hZX, is called with the key (and in the case of rdh\jubj<)re}rf(hZX `__setitem__`rghd}rh(hj]rihl]rjhh]rkhf]rlhn]rmuh\jhU]rnhX __setitem__ro…rp}rq(hZUh\jeubahbjJubhX6 the value too). We can also control what is returned.rr…rs}rt(hZX6 the value too). We can also control what is returned.ruh\jubeubh«)rv}rw(hZXˆAfter the `MagicMock` has been used we can use attributes like :data:`~Mock.call_args_list` to assert about how the dictionary was used:rxh\j h]h`hbh¯hd}ry(hj]rzhl]r{hh]r|hf]r}hn]r~uhqM‡hrhhU]r(hX After the r€…r}r‚(hZX After the rƒh\jvubj<)r„}r…(hZX `MagicMock`r†hd}r‡(hj]rˆhl]r‰hh]rŠhf]r‹hn]rŒuh\jvhU]rhX MagicMockrŽ…r}r(hZUh\j„ubahbjJubhX* has been used we can use attributes like r‘…r’}r“(hZX* has been used we can use attributes like r”h\jvubhÈ)r•}r–(hZX:data:`~Mock.call_args_list`r—h\jvh]h`hbhÌhd}r˜(Ureftyper™XdataršhЉhÑXMock.call_args_listr›U refdomainrœXpyrhf]ržhh]rŸU refexplicitr ‰hj]r¡hl]r¢hn]r£hÛhÜj%Nj&j'uhqM‡hU]r¤j))r¥}r¦(hZj—hd}r§(hj]r¨hl]r©(häjXpy-datarªehh]r«hf]r¬hn]r­uh\j•hU]r®hXcall_args_listr¯…r°}r±(hZUh\j¥ubahbj7ubaubhX- to assert about how the dictionary was used:r²…r³}r´(hZX- to assert about how the dictionary was used:rµh\jvubeubj)r¶}r·(hZX>>> my_dict = {'a': 1, 'b': 2, 'c': 3} >>> def getitem(name): ... return my_dict[name] ... >>> def setitem(name, val): ... my_dict[name] = val ... >>> mock = MagicMock() >>> mock.__getitem__.side_effect = getitem >>> mock.__setitem__.side_effect = setitemr¸h\j h]h`hbjƒhd}r¹(U testnodetyperºXdoctestr»h›hœhf]r¼hh]r½hj]r¾hl]r¿hn]rÀUgroupsrÁ]rÂh¤ah¥}rÃuhqMŠhrhhU]rÄhX>>> my_dict = {'a': 1, 'b': 2, 'c': 3} >>> def getitem(name): ... return my_dict[name] ... >>> def setitem(name, val): ... my_dict[name] = val ... >>> mock = MagicMock() >>> mock.__getitem__.side_effect = getitem >>> mock.__setitem__.side_effect = setitemrÅ…rÆ}rÇ(hZUh\j¶ubaubjˆ )rÈ}rÉ(hZXFAn alternative to using `MagicMock` is to use `Mock` and *only* provide the magic methods you specifically want: .. doctest:: >>> mock = Mock() >>> mock.__setitem__ = Mock(side_effect=getitem) >>> mock.__getitem__ = Mock(side_effect=setitem) A *third* option is to use `MagicMock` but passing in `dict` as the `spec` (or `spec_set`) argument so that the `MagicMock` created only has dictionary magic methods available: .. doctest:: >>> mock = MagicMock(spec_set=dict) >>> mock.__getitem__.side_effect = getitem >>> mock.__setitem__.side_effect = setitemrÊh\j h]NhbjŒ hd}rË(hj]rÌhl]rÍhh]rÎhf]rÏhn]rÐuhqNhrhhU]rÑ(h«)rÒ}rÓ(hZXpAn alternative to using `MagicMock` is to use `Mock` and *only* provide the magic methods you specifically want:rÔh\jÈh]h`hbh¯hd}rÕ(hj]rÖhl]r×hh]rØhf]rÙhn]rÚuhqM™hU]rÛ(hXAn alternative to using rÜ…rÝ}rÞ(hZXAn alternative to using rßh\jÒubj<)rà}rá(hZX `MagicMock`râhd}rã(hj]rähl]råhh]ræhf]rçhn]rèuh\jÒhU]réhX MagicMockrê…rë}rì(hZUh\jàubahbjJubhX is to use rí…rî}rï(hZX is to use rðh\jÒubj<)rñ}rò(hZX`Mock`róhd}rô(hj]rõhl]röhh]r÷hf]røhn]rùuh\jÒhU]rúhXMockrû…rü}rý(hZUh\jñubahbjJubhX and rþ…rÿ}r(hZX and rh\jÒubhÞ)r}r(hZX*only*rhd}r(hj]rhl]rhh]rhf]r hn]r uh\jÒhU]r hXonlyr …r }r(hZUh\jubahbhíubhX1 provide the magic methods you specifically want:r…r}r(hZX1 provide the magic methods you specifically want:rh\jÒubeubj)r}r(hZXs>>> mock = Mock() >>> mock.__setitem__ = Mock(side_effect=getitem) >>> mock.__getitem__ = Mock(side_effect=setitem)rh\jÈh]h`hbjƒhd}r(U testnodetyperXdoctestrh›hœhf]rhh]rhj]rhl]rhn]rUgroupsr]rh¤ah¥}r uhqMœhU]r!hXs>>> mock = Mock() >>> mock.__setitem__ = Mock(side_effect=getitem) >>> mock.__getitem__ = Mock(side_effect=setitem)r"…r#}r$(hZUh\jubaubh«)r%}r&(hZX°A *third* option is to use `MagicMock` but passing in `dict` as the `spec` (or `spec_set`) argument so that the `MagicMock` created only has dictionary magic methods available:r'h\jÈh]h`hbh¯hd}r((hj]r)hl]r*hh]r+hf]r,hn]r-uhqM¢hU]r.(hXA r/…r0}r1(hZXA r2h\j%ubhÞ)r3}r4(hZX*third*r5hd}r6(hj]r7hl]r8hh]r9hf]r:hn]r;uh\j%hU]r<hXthirdr=…r>}r?(hZUh\j3ubahbhíubhX option is to use r@…rA}rB(hZX option is to use rCh\j%ubj<)rD}rE(hZX `MagicMock`rFhd}rG(hj]rHhl]rIhh]rJhf]rKhn]rLuh\j%hU]rMhX MagicMockrN…rO}rP(hZUh\jDubahbjJubhX but passing in rQ…rR}rS(hZX but passing in rTh\j%ubj<)rU}rV(hZX`dict`rWhd}rX(hj]rYhl]rZhh]r[hf]r\hn]r]uh\j%hU]r^hXdictr_…r`}ra(hZUh\jUubahbjJubhX as the rb…rc}rd(hZX as the reh\j%ubj<)rf}rg(hZX`spec`rhhd}ri(hj]rjhl]rkhh]rlhf]rmhn]rnuh\j%hU]rohXspecrp…rq}rr(hZUh\jfubahbjJubhX (or rs…rt}ru(hZX (or rvh\j%ubj<)rw}rx(hZX `spec_set`ryhd}rz(hj]r{hl]r|hh]r}hf]r~hn]ruh\j%hU]r€hXspec_setr…r‚}rƒ(hZUh\jwubahbjJubhX) argument so that the r„…r…}r†(hZX) argument so that the r‡h\j%ubj<)rˆ}r‰(hZX `MagicMock`rŠhd}r‹(hj]rŒhl]rhh]rŽhf]rhn]ruh\j%hU]r‘hX MagicMockr’…r“}r”(hZUh\jˆubahbjJubhX5 created only has dictionary magic methods available:r•…r–}r—(hZX5 created only has dictionary magic methods available:r˜h\j%ubeubj)r™}rš(hZXy>>> mock = MagicMock(spec_set=dict) >>> mock.__getitem__.side_effect = getitem >>> mock.__setitem__.side_effect = setitemr›h\jÈh]h`hbjƒhd}rœ(U testnodetyperXdoctestržh›hœhf]rŸhh]r hj]r¡hl]r¢hn]r£Ugroupsr¤]r¥h¤ah¥}r¦uhqM¦hU]r§hXy>>> mock = MagicMock(spec_set=dict) >>> mock.__getitem__.side_effect = getitem >>> mock.__setitem__.side_effect = setitemr¨…r©}rª(hZUh\j™ubaubeubh«)r«}r¬(hZX¿With these side effect functions in place, the `mock` will behave like a normal dictionary but recording the access. It even raises a `KeyError` if you try to access a key that doesn't exist.r­h\j h]h`hbh¯hd}r®(hj]r¯hl]r°hh]r±hf]r²hn]r³uhqM¬hrhhU]r´(hX/With these side effect functions in place, the rµ…r¶}r·(hZX/With these side effect functions in place, the r¸h\j«ubj<)r¹}rº(hZX`mock`r»hd}r¼(hj]r½hl]r¾hh]r¿hf]rÀhn]rÁuh\j«hU]rÂhXmockrÃ…rÄ}rÅ(hZUh\j¹ubahbjJubhXQ will behave like a normal dictionary but recording the access. It even raises a rÆ…rÇ}rÈ(hZXQ will behave like a normal dictionary but recording the access. It even raises a rÉh\j«ubj<)rÊ}rË(hZX `KeyError`rÌhd}rÍ(hj]rÎhl]rÏhh]rÐhf]rÑhn]rÒuh\j«hU]rÓhXKeyErrorrÔ…rÕ}rÖ(hZUh\jÊubahbjJubhX/ if you try to access a key that doesn't exist.r×…rØ}rÙ(hZX/ if you try to access a key that doesn't exist.rÚh\j«ubeubj)rÛ}rÜ(hZX¾>>> mock['a'] 1 >>> mock['c'] 3 >>> mock['d'] Traceback (most recent call last): ... KeyError: 'd' >>> mock['b'] = 'fish' >>> mock['d'] = 'eggs' >>> mock['b'] 'fish' >>> mock['d'] 'eggs'rÝh\j h]h`hbjƒhd}rÞ(U testnodetyperßXdoctestràh›hœhf]ráhh]râhj]rãhl]rähn]råUgroupsræ]rçh¤ah¥}rèuhqM°hrhhU]réhX¾>>> mock['a'] 1 >>> mock['c'] 3 >>> mock['d'] Traceback (most recent call last): ... KeyError: 'd' >>> mock['b'] = 'fish' >>> mock['d'] = 'eggs' >>> mock['b'] 'fish' >>> mock['d'] 'eggs'rê…rë}rì(hZUh\jÛubaubh«)rí}rî(hZXmAfter it has been used you can make assertions about the access using the normal mock methods and attributes:rïh\j h]h`hbh¯hd}rð(hj]rñhl]ròhh]róhf]rôhn]rõuhqMÁhrhhU]röhXmAfter it has been used you can make assertions about the access using the normal mock methods and attributes:r÷…rø}rù(hZjïh\jíubaubj)rú}rû(hZXÝ>>> mock.__getitem__.call_args_list [call('a'), call('c'), call('d'), call('b'), call('d')] >>> mock.__setitem__.call_args_list [call('b', 'fish'), call('d', 'eggs')] >>> my_dict {'a': 1, 'c': 3, 'b': 'fish', 'd': 'eggs'}rüh\j h]h`hbjƒhd}rý(U testnodetyperþXdoctestrÿh›hœhf]rhh]rhj]rhl]rhn]rUgroupsr]rh¤ah¥}ruhqMÄhrhhU]rhXÝ>>> mock.__getitem__.call_args_list [call('a'), call('c'), call('d'), call('b'), call('d')] >>> mock.__setitem__.call_args_list [call('b', 'fish'), call('d', 'eggs')] >>> my_dict {'a': 1, 'c': 3, 'b': 'fish', 'd': 'eggs'}r …r }r (hZUh\júubaubeubht)r }r (hZUh\huh]h`hbhyhd}r(hj]rhl]rhh]rhf]rh2ahn]rhauhqMÏhrhhU]r(hƒ)r}r(hZX$Mock subclasses and their attributesrh\j h]h`hbh‡hd}r(hj]rhl]rhh]rhf]rhn]ruhqMÏhrhhU]rhX$Mock subclasses and their attributesr…r }r!(hZjh\jubaubh«)r"}r#(hZXƒThere are various reasons why you might want to subclass `Mock`. One reason might be to add helper methods. Here's a silly example:r$h\j h]h`hbh¯hd}r%(hj]r&hl]r'hh]r(hf]r)hn]r*uhqMÑhrhhU]r+(hX9There are various reasons why you might want to subclass r,…r-}r.(hZX9There are various reasons why you might want to subclass r/h\j"ubj<)r0}r1(hZX`Mock`r2hd}r3(hj]r4hl]r5hh]r6hf]r7hn]r8uh\j"hU]r9hXMockr:…r;}r<(hZUh\j0ubahbjJubhXD. One reason might be to add helper methods. Here's a silly example:r=…r>}r?(hZXD. One reason might be to add helper methods. Here's a silly example:r@h\j"ubeubj)rA}rB(hZXø>>> class MyMock(MagicMock): ... def has_been_called(self): ... return self.called ... >>> mymock = MyMock(return_value=None) >>> mymock >>> mymock.has_been_called() False >>> mymock() >>> mymock.has_been_called() TruerCh\j h]h`hbjƒhd}rD(U testnodetyperEXdoctestrFh›hœhf]rGhh]rHhj]rIhl]rJhn]rKUgroupsrL]rMh¤ah¥}rNuhqMÔhrhhU]rOhXø>>> class MyMock(MagicMock): ... def has_been_called(self): ... return self.called ... >>> mymock = MyMock(return_value=None) >>> mymock >>> mymock.has_been_called() False >>> mymock() >>> mymock.has_been_called() TruerP…rQ}rR(hZUh\jAubaubh«)rS}rT(hZX‡The standard behaviour for `Mock` instances is that attributes and the return value mocks are of the same type as the mock they are accessed on. This ensures that `Mock` attributes are `Mocks` and `MagicMock` attributes are `MagicMocks` [#]_. So if you're subclassing to add helper methods then they'll also be available on the attributes and return value mock of instances of your subclass.rUh\j h]h`hbh¯hd}rV(hj]rWhl]rXhh]rYhf]rZhn]r[uhqMãhrhhU]r\(hXThe standard behaviour for r]…r^}r_(hZXThe standard behaviour for r`h\jSubj<)ra}rb(hZX`Mock`rchd}rd(hj]rehl]rfhh]rghf]rhhn]riuh\jShU]rjhXMockrk…rl}rm(hZUh\jaubahbjJubhX‚ instances is that attributes and the return value mocks are of the same type as the mock they are accessed on. This ensures that rn…ro}rp(hZX‚ instances is that attributes and the return value mocks are of the same type as the mock they are accessed on. This ensures that rqh\jSubj<)rr}rs(hZX`Mock`rthd}ru(hj]rvhl]rwhh]rxhf]ryhn]rzuh\jShU]r{hXMockr|…r}}r~(hZUh\jrubahbjJubhX attributes are r…r€}r(hZX attributes are r‚h\jSubj<)rƒ}r„(hZX`Mocks`r…hd}r†(hj]r‡hl]rˆhh]r‰hf]rŠhn]r‹uh\jShU]rŒhXMocksr…rŽ}r(hZUh\jƒubahbjJubhX and r…r‘}r’(hZX and r“h\jSubj<)r”}r•(hZX `MagicMock`r–hd}r—(hj]r˜hl]r™hh]ršhf]r›hn]rœuh\jShU]rhX MagicMockrž…rŸ}r (hZUh\j”ubahbjJubhX attributes are r¡…r¢}r£(hZX attributes are r¤h\jSubj<)r¥}r¦(hZX `MagicMocks`r§hd}r¨(hj]r©hl]rªhh]r«hf]r¬hn]r­uh\jShU]r®hX MagicMocksr¯…r°}r±(hZUh\j¥ubahbjJubhX …r²}r³(hZX h\jSubj)r´}rµ(hZX[#]_r¶j¡Kh\jShbj¢hd}r·(j¤Khf]r¸Uid4r¹ahh]rºhj]r»hl]r¼hn]r½hphGuhU]r¾hX2…r¿}rÀ(hZUh\j´ubaubhX–. So if you're subclassing to add helper methods then they'll also be available on the attributes and return value mock of instances of your subclass.rÁ…rÂ}rÃ(hZX–. So if you're subclassing to add helper methods then they'll also be available on the attributes and return value mock of instances of your subclass.rÄh\jSubeubj)rÅ}rÆ(hZX²>>> mymock.foo >>> mymock.foo.has_been_called() False >>> mymock.foo() >>> mymock.foo.has_been_called() TruerÇh\j h]h`hbjƒhd}rÈ(U testnodetyperÉXdoctestrÊh›hœhf]rËhh]rÌhj]rÍhl]rÎhn]rÏUgroupsrÐ]rÑh¤ah¥}rÒuhqMêhrhhU]rÓhX²>>> mymock.foo >>> mymock.foo.has_been_called() False >>> mymock.foo() >>> mymock.foo.has_been_called() TruerÔ…rÕ}rÖ(hZUh\jÅubaubh«)r×}rØ(hZX0Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted adaptor `_. Having this applied to attributes too actually causes errors.rÙh\j h]h`hbh¯hd}rÚ(hj]rÛhl]rÜhh]rÝhf]rÞhn]rßuhqMõhrhhU]rà(hX-Sometimes this is inconvenient. For example, rá…râ}rã(hZX-Sometimes this is inconvenient. For example, räh\j×ubj›)rå}ræ(hZXA`one user `_rçhd}rè(UnameréXone userrêj¢X3https://code.google.com/p/mock/issues/detail?id=105rëhf]rìhh]ríhj]rîhl]rïhn]rðuh\j×hU]rñhXone userrò…ró}rô(hZUh\jåubahbj­ubhW)rõ}rö(hZX6 r÷j±Kh\j×hbhchd}rø(Urefurirùjëhf]rúhSahh]rûhj]rühl]rýhn]rþh&auhU]rÿubhX" is subclassing mock to created a r…r}r(hZX" is subclassing mock to created a rh\j×ubj›)r}r(hZXa`Twisted adaptor `_rhd}r(UnamerXTwisted adaptorr j¢XLhttp://twistedmatrix.com/documents/11.0.0/api/twisted.python.components.htmlr hf]r hh]r hj]r hl]rhn]ruh\j×hU]rhXTwisted adaptorr…r}r(hZUh\jubahbj­ubhW)r}r(hZXO rj±Kh\j×hbhchd}r(Urefurirj hf]rh}r?(hZX`_get_child_mock`r@hd}rA(hj]rBhl]rChh]rDhf]rEhn]rFuh\j#hU]rGhX_get_child_mockrH…rI}rJ(hZUh\j>ubahbjJubhXÎ to create these "sub-mocks" for attributes and return values. You can prevent your subclass being used for attributes by overriding this method. The signature is that it takes arbitrary keyword arguments (rK…rL}rM(hZXÎ to create these "sub-mocks" for attributes and return values. You can prevent your subclass being used for attributes by overriding this method. The signature is that it takes arbitrary keyword arguments (rNh\j#ubj<)rO}rP(hZX `**kwargs`rQhd}rR(hj]rShl]rThh]rUhf]rVhn]rWuh\j#hU]rXhX**kwargsrY…rZ}r[(hZUh\jOubahbjJubhX2) which are then passed onto the mock constructor:r\…r]}r^(hZX2) which are then passed onto the mock constructor:r_h\j#ubeubj)r`}ra(hZXH>>> class Subclass(MagicMock): ... def _get_child_mock(self, **kwargs): ... return MagicMock(**kwargs) ... >>> mymock = Subclass() >>> mymock.foo >>> assert isinstance(mymock, Subclass) >>> assert not isinstance(mymock.foo, Subclass) >>> assert not isinstance(mymock(), Subclass)rbh\j h]h`hbjƒhd}rc(U testnodetyperdXdoctestreh›hœhf]rfhh]rghj]rhhl]rihn]rjUgroupsrk]rlh¤ah¥}rmuhqMhrhhU]rnhXH>>> class Subclass(MagicMock): ... def _get_child_mock(self, **kwargs): ... return MagicMock(**kwargs) ... >>> mymock = Subclass() >>> mymock.foo >>> assert isinstance(mymock, Subclass) >>> assert not isinstance(mymock.foo, Subclass) >>> assert not isinstance(mymock(), Subclass)ro…rp}rq(hZUh\j`ubaubjX)rr}rs(hZX An exception to this rule are the non-callable mocks. Attributes use the callable variant because otherwise non-callable mocks couldn't have callable methods. rth\j h]h`hbj\hd}ru(j¤Khf]rvhGahh]rwj¹ahj]rxhl]ryhn]rzU2auhqMhrhhU]r{(jd)r|}r}(hZUh\jrh]Nhbjghd}r~(hj]rhl]r€hh]rhf]r‚hn]rƒuhqNhrhhU]r„hX2…r…}r†(hZUh\j|ubaubh«)r‡}rˆ(hZXžAn exception to this rule are the non-callable mocks. Attributes use the callable variant because otherwise non-callable mocks couldn't have callable methods.r‰h\jrh]h`hbh¯hd}rŠ(hj]r‹hl]rŒhh]rhf]rŽhn]ruhqMhU]rhXžAn exception to this rule are the non-callable mocks. Attributes use the callable variant because otherwise non-callable mocks couldn't have callable methods.r‘…r’}r“(hZj‰h\j‡ubaubeubeubht)r”}r•(hZUh\huh]h`hbhyhd}r–(hj]r—hl]r˜hh]r™hf]ršhTahn]r›h'auhqMhrhhU]rœ(hƒ)r}rž(hZXMocking imports with patch.dictrŸh\j”h]h`hbh‡hd}r (hj]r¡hl]r¢hh]r£hf]r¤hn]r¥uhqMhrhhU]r¦hXMocking imports with patch.dictr§…r¨}r©(hZjŸh\jubaubh«)rª}r«(hZXÉOne situation where mocking can be hard is where you have a local import inside a function. These are harder to mock because they aren't using an object from the module namespace that we can patch out.r¬h\j”h]h`hbh¯hd}r­(hj]r®hl]r¯hh]r°hf]r±hn]r²uhqMhrhhU]r³hXÉOne situation where mocking can be hard is where you have a local import inside a function. These are harder to mock because they aren't using an object from the module namespace that we can patch out.r´…rµ}r¶(hZj¬h\jªubaubh«)r·}r¸(hZX”Generally local imports are to be avoided. They are sometimes done to prevent circular dependencies, for which there is *usually* a much better way to solve the problem (refactor the code) or to prevent "up front costs" by delaying the import. This can also be solved in better ways than an unconditional local import (store the module as a class or module attribute and only do the import on first use).r¹h\j”h]h`hbh¯hd}rº(hj]r»hl]r¼hh]r½hf]r¾hn]r¿uhqMhrhhU]rÀ(hXxGenerally local imports are to be avoided. They are sometimes done to prevent circular dependencies, for which there is rÁ…rÂ}rÃ(hZXxGenerally local imports are to be avoided. They are sometimes done to prevent circular dependencies, for which there is rÄh\j·ubhÞ)rÅ}rÆ(hZX *usually*rÇhd}rÈ(hj]rÉhl]rÊhh]rËhf]rÌhn]rÍuh\j·hU]rÎhXusuallyrÏ…rÐ}rÑ(hZUh\jÅubahbhíubhX a much better way to solve the problem (refactor the code) or to prevent "up front costs" by delaying the import. This can also be solved in better ways than an unconditional local import (store the module as a class or module attribute and only do the import on first use).rÒ…rÓ}rÔ(hZX a much better way to solve the problem (refactor the code) or to prevent "up front costs" by delaying the import. This can also be solved in better ways than an unconditional local import (store the module as a class or module attribute and only do the import on first use).rÕh\j·ubeubh«)rÖ}r×(hZX†That aside there is a way to use `mock` to affect the results of an import. Importing fetches an *object* from the `sys.modules` dictionary. Note that it fetches an *object*, which need not be a module. Importing a module for the first time results in a module object being put in `sys.modules`, so usually when you import something you get a module back. This need not be the case however.rØh\j”h]h`hbh¯hd}rÙ(hj]rÚhl]rÛhh]rÜhf]rÝhn]rÞuhqM!hrhhU]rß(hX!That aside there is a way to use rà…rá}râ(hZX!That aside there is a way to use rãh\jÖubj<)rä}rå(hZX`mock`ræhd}rç(hj]rèhl]réhh]rêhf]rëhn]rìuh\jÖhU]ríhXmockrî…rï}rð(hZUh\jäubahbjJubhX: to affect the results of an import. Importing fetches an rñ…rò}ró(hZX: to affect the results of an import. Importing fetches an rôh\jÖubhÞ)rõ}rö(hZX*object*r÷hd}rø(hj]rùhl]rúhh]rûhf]rühn]rýuh\jÖhU]rþhXobjectrÿ…r}r(hZUh\jõubahbhíubhX from the r…r}r(hZX from the rh\jÖubj<)r}r(hZX `sys.modules`rhd}r (hj]r hl]r hh]r hf]r hn]ruh\jÖhU]rhX sys.modulesr…r}r(hZUh\jubahbjJubhX% dictionary. Note that it fetches an r…r}r(hZX% dictionary. Note that it fetches an rh\jÖubhÞ)r}r(hZX*object*rhd}r(hj]rhl]rhh]rhf]rhn]ruh\jÖhU]r hXobjectr!…r"}r#(hZUh\jubahbhíubhXl, which need not be a module. Importing a module for the first time results in a module object being put in r$…r%}r&(hZXl, which need not be a module. Importing a module for the first time results in a module object being put in r'h\jÖubj<)r(}r)(hZX `sys.modules`r*hd}r+(hj]r,hl]r-hh]r.hf]r/hn]r0uh\jÖhU]r1hX sys.modulesr2…r3}r4(hZUh\j(ubahbjJubhX`, so usually when you import something you get a module back. This need not be the case however.r5…r6}r7(hZX`, so usually when you import something you get a module back. This need not be the case however.r8h\jÖubeubh«)r9}r:(hZXVThis means you can use :func:`patch.dict` to *temporarily* put a mock in place in `sys.modules`. Any imports whilst this patch is active will fetch the mock. When the patch is complete (the decorated function exits, the with statement body is complete or `patcher.stop()` is called) then whatever was there previously will be restored safely.r;h\j”h]h`hbh¯hd}r<(hj]r=hl]r>hh]r?hf]r@hn]rAuhqM(hrhhU]rB(hXThis means you can use rC…rD}rE(hZXThis means you can use rFh\j9ubhÈ)rG}rH(hZX:func:`patch.dict`rIh\j9h]h`hbhÌhd}rJ(UreftyperKXfuncrLhЉhÑX patch.dictrMU refdomainrNXpyrOhf]rPhh]rQU refexplicitrR‰hj]rShl]rThn]rUhÛhÜj%Nj&j'uhqM(hU]rVj))rW}rX(hZjIhd}rY(hj]rZhl]r[(häjOXpy-funcr\ehh]r]hf]r^hn]r_uh\jGhU]r`hX patch.dict()ra…rb}rc(hZUh\jWubahbj7ubaubhX to rd…re}rf(hZX to rgh\j9ubhÞ)rh}ri(hZX *temporarily*rjhd}rk(hj]rlhl]rmhh]rnhf]rohn]rpuh\j9hU]rqhX temporarilyrr…rs}rt(hZUh\jhubahbhíubhX put a mock in place in ru…rv}rw(hZX put a mock in place in rxh\j9ubj<)ry}rz(hZX `sys.modules`r{hd}r|(hj]r}hl]r~hh]rhf]r€hn]ruh\j9hU]r‚hX sys.modulesrƒ…r„}r…(hZUh\jyubahbjJubhX . Any imports whilst this patch is active will fetch the mock. When the patch is complete (the decorated function exits, the with statement body is complete or r†…r‡}rˆ(hZX . Any imports whilst this patch is active will fetch the mock. When the patch is complete (the decorated function exits, the with statement body is complete or r‰h\j9ubj<)rŠ}r‹(hZX`patcher.stop()`rŒhd}r(hj]rŽhl]rhh]rhf]r‘hn]r’uh\j9hU]r“hXpatcher.stop()r”…r•}r–(hZUh\jŠubahbjJubhXG is called) then whatever was there previously will be restored safely.r—…r˜}r™(hZXG is called) then whatever was there previously will be restored safely.ršh\j9ubeubh«)r›}rœ(hZX5Here's an example that mocks out the 'fooble' module.rh\j”h]h`hbh¯hd}rž(hj]rŸhl]r hh]r¡hf]r¢hn]r£uhqM.hrhhU]r¤hX5Here's an example that mocks out the 'fooble' module.r¥…r¦}r§(hZjh\j›ubaubj)r¨}r©(hZXç>>> mock = Mock() >>> with patch.dict('sys.modules', {'fooble': mock}): ... import fooble ... fooble.blob() ... >>> assert 'fooble' not in sys.modules >>> mock.blob.assert_called_once_with()rªh\j”h]h`hbjƒhd}r«(U testnodetyper¬Xdoctestr­h›hœhf]r®hh]r¯hj]r°hl]r±hn]r²Ugroupsr³]r´h¤ah¥}rµuhqM0hrhhU]r¶hXç>>> mock = Mock() >>> with patch.dict('sys.modules', {'fooble': mock}): ... import fooble ... fooble.blob() ... >>> assert 'fooble' not in sys.modules >>> mock.blob.assert_called_once_with()r·…r¸}r¹(hZUh\j¨ubaubh«)rº}r»(hZXdAs you can see the `import fooble` succeeds, but on exit there is no 'fooble' left in `sys.modules`.r¼h\j”h]h`hbh¯hd}r½(hj]r¾hl]r¿hh]rÀhf]rÁhn]rÂuhqM;hrhhU]rÃ(hXAs you can see the rÄ…rÅ}rÆ(hZXAs you can see the rÇh\jºubj<)rÈ}rÉ(hZX`import fooble`rÊhd}rË(hj]rÌhl]rÍhh]rÎhf]rÏhn]rÐuh\jºhU]rÑhX import fooblerÒ…rÓ}rÔ(hZUh\jÈubahbjJubhX4 succeeds, but on exit there is no 'fooble' left in rÕ…rÖ}r×(hZX4 succeeds, but on exit there is no 'fooble' left in rØh\jºubj<)rÙ}rÚ(hZX `sys.modules`rÛhd}rÜ(hj]rÝhl]rÞhh]rßhf]ràhn]ráuh\jºhU]râhX sys.modulesrã…rä}rå(hZUh\jÙubahbjJubhX.…ræ}rç(hZX.h\jºubeubh«)rè}ré(hZX7This also works for the `from module import name` form:rêh\j”h]h`hbh¯hd}rë(hj]rìhl]ríhh]rîhf]rïhn]rðuhqM>hrhhU]rñ(hXThis also works for the rò…ró}rô(hZXThis also works for the rõh\jèubj<)rö}r÷(hZX`from module import name`røhd}rù(hj]rúhl]rûhh]rühf]rýhn]rþuh\jèhU]rÿhXfrom module import namer…r}r(hZUh\jöubahbjJubhX form:r…r}r(hZX form:rh\jèubeubj)r}r(hZXÒ>>> mock = Mock() >>> with patch.dict('sys.modules', {'fooble': mock}): ... from fooble import blob ... blob.blip() ... >>> mock.blob.blip.assert_called_once_with()r h\j”h]h`hbjƒhd}r (U testnodetyper Xdoctestr h›hœhf]r hh]rhj]rhl]rhn]rUgroupsr]rh¤ah¥}ruhqM@hrhhU]rhXÒ>>> mock = Mock() >>> with patch.dict('sys.modules', {'fooble': mock}): ... from fooble import blob ... blob.blip() ... >>> mock.blob.blip.assert_called_once_with()r…r}r(hZUh\jubaubh«)r}r(hZX:With slightly more work you can also mock package imports:rh\j”h]h`hbh¯hd}r(hj]rhl]rhh]rhf]r hn]r!uhqMJhrhhU]r"hX:With slightly more work you can also mock package imports:r#…r$}r%(hZjh\jubaubj)r&}r'(hZX>>> mock = Mock() >>> modules = {'package': mock, 'package.module': mock.module} >>> with patch.dict('sys.modules', modules): ... from package.module import fooble ... fooble() ... >>> mock.module.fooble.assert_called_once_with()r(h\j”h]h`hbjƒhd}r)(U testnodetyper*Xdoctestr+h›hœhf]r,hh]r-hj]r.hl]r/hn]r0Ugroupsr1]r2h¤ah¥}r3uhqMLhrhhU]r4hX>>> mock = Mock() >>> modules = {'package': mock, 'package.module': mock.module} >>> with patch.dict('sys.modules', modules): ... from package.module import fooble ... fooble() ... >>> mock.module.fooble.assert_called_once_with()r5…r6}r7(hZUh\j&ubaubeubht)r8}r9(hZUh\huh]h`hbhyhd}r:(hj]r;hl]r<hh]r=hf]r>hKahn]r?hauhqMYhrhhU]r@(hƒ)rA}rB(hZX8Tracking order of calls and less verbose call assertionsrCh\j8h]h`hbh‡hd}rD(hj]rEhl]rFhh]rGhf]rHhn]rIuhqMYhrhhU]rJhX8Tracking order of calls and less verbose call assertionsrK…rL}rM(hZjCh\jAubaubh«)rN}rO(hZX(The :class:`Mock` class allows you to track the *order* of method calls on your mock objects through the :attr:`~Mock.method_calls` attribute. This doesn't allow you to track the order of calls between separate mock objects, however we can use :attr:`~Mock.mock_calls` to achieve the same effect.rPh\j8h]h`hbh¯hd}rQ(hj]rRhl]rShh]rThf]rUhn]rVuhqM[hrhhU]rW(hXThe rX…rY}rZ(hZXThe r[h\jNubhÈ)r\}r](hZX :class:`Mock`r^h\jNh]h`hbhÌhd}r_(Ureftyper`XclassrahЉhÑXMockrbU refdomainrcXpyrdhf]rehh]rfU refexplicitrg‰hj]rhhl]rihn]rjhÛhÜj%Nj&j'uhqM[hU]rkj))rl}rm(hZj^hd}rn(hj]rohl]rp(häjdXpy-classrqehh]rrhf]rshn]rtuh\j\hU]ruhXMockrv…rw}rx(hZUh\jlubahbj7ubaubhX class allows you to track the ry…rz}r{(hZX class allows you to track the r|h\jNubhÞ)r}}r~(hZX*order*rhd}r€(hj]rhl]r‚hh]rƒhf]r„hn]r…uh\jNhU]r†hXorderr‡…rˆ}r‰(hZUh\j}ubahbhíubhX2 of method calls on your mock objects through the rŠ…r‹}rŒ(hZX2 of method calls on your mock objects through the rh\jNubhÈ)rŽ}r(hZX:attr:`~Mock.method_calls`rh\jNh]h`hbhÌhd}r‘(Ureftyper’Xattrr“hЉhÑXMock.method_callsr”U refdomainr•Xpyr–hf]r—hh]r˜U refexplicitr™‰hj]ršhl]r›hn]rœhÛhÜj%Nj&j'uhqM[hU]rj))rž}rŸ(hZjhd}r (hj]r¡hl]r¢(häj–Xpy-attrr£ehh]r¤hf]r¥hn]r¦uh\jŽhU]r§hX method_callsr¨…r©}rª(hZUh\jžubahbj7ubaubhXq attribute. This doesn't allow you to track the order of calls between separate mock objects, however we can use r«…r¬}r­(hZXq attribute. This doesn't allow you to track the order of calls between separate mock objects, however we can use r®h\jNubhÈ)r¯}r°(hZX:attr:`~Mock.mock_calls`r±h\jNh]h`hbhÌhd}r²(Ureftyper³Xattrr´hЉhÑXMock.mock_callsrµU refdomainr¶Xpyr·hf]r¸hh]r¹U refexplicitrº‰hj]r»hl]r¼hn]r½hÛhÜj%Nj&j'uhqM[hU]r¾j))r¿}rÀ(hZj±hd}rÁ(hj]rÂhl]rÃ(häj·Xpy-attrrÄehh]rÅhf]rÆhn]rÇuh\j¯hU]rÈhX mock_callsrÉ…rÊ}rË(hZUh\j¿ubahbj7ubaubhX to achieve the same effect.rÌ…rÍ}rÎ(hZX to achieve the same effect.rÏh\jNubeubh«)rÐ}rÑ(hZXBecause mocks track calls to child mocks in `mock_calls`, and accessing an arbitrary attribute of a mock creates a child mock, we can create our separate mocks from a parent one. Calls to those child mock will then all be recorded, in order, in the `mock_calls` of the parent:rÒh\j8h]h`hbh¯hd}rÓ(hj]rÔhl]rÕhh]rÖhf]r×hn]rØuhqM`hrhhU]rÙ(hX,Because mocks track calls to child mocks in rÚ…rÛ}rÜ(hZX,Because mocks track calls to child mocks in rÝh\jÐubj<)rÞ}rß(hZX `mock_calls`ràhd}rá(hj]râhl]rãhh]rähf]råhn]ræuh\jÐhU]rçhX mock_callsrè…ré}rê(hZUh\jÞubahbjJubhXÁ, and accessing an arbitrary attribute of a mock creates a child mock, we can create our separate mocks from a parent one. Calls to those child mock will then all be recorded, in order, in the rë…rì}rí(hZXÁ, and accessing an arbitrary attribute of a mock creates a child mock, we can create our separate mocks from a parent one. Calls to those child mock will then all be recorded, in order, in the rîh\jÐubj<)rï}rð(hZX `mock_calls`rñhd}rò(hj]róhl]rôhh]rõhf]röhn]r÷uh\jÐhU]røhX mock_callsrù…rú}rû(hZUh\jïubahbjJubhX of the parent:rü…rý}rþ(hZX of the parent:rÿh\jÐubeubj)r}r(hZX >>> manager = Mock() >>> mock_foo = manager.foo >>> mock_bar = manager.bar >>> mock_foo.something() >>> mock_bar.other.thing() >>> manager.mock_calls [call.foo.something(), call.bar.other.thing()]rh\j8h]h`hbjƒhd}r(U testnodetyperXdoctestrh›hœhf]rhh]rhj]rhl]r hn]r Ugroupsr ]r h¤ah¥}r uhqMehrhhU]rhX >>> manager = Mock() >>> mock_foo = manager.foo >>> mock_bar = manager.bar >>> mock_foo.something() >>> mock_bar.other.thing() >>> manager.mock_calls [call.foo.something(), call.bar.other.thing()]r…r}r(hZUh\jubaubh«)r}r(hZXzWe can then assert about the calls, including the order, by comparing with the `mock_calls` attribute on the manager mock:rh\j8h]h`hbh¯hd}r(hj]rhl]rhh]rhf]rhn]ruhqMshrhhU]r(hXOWe can then assert about the calls, including the order, by comparing with the r…r}r(hZXOWe can then assert about the calls, including the order, by comparing with the rh\jubj<)r }r!(hZX `mock_calls`r"hd}r#(hj]r$hl]r%hh]r&hf]r'hn]r(uh\jhU]r)hX mock_callsr*…r+}r,(hZUh\j ubahbjJubhX attribute on the manager mock:r-…r.}r/(hZX attribute on the manager mock:r0h\jubeubj)r1}r2(hZXq>>> expected_calls = [call.foo.something(), call.bar.other.thing()] >>> manager.mock_calls == expected_calls Truer3h\j8h]h`hbjƒhd}r4(U testnodetyper5Xdoctestr6h›hœhf]r7hh]r8hj]r9hl]r:hn]r;Ugroupsr<]r=h¤ah¥}r>uhqMvhrhhU]r?hXq>>> expected_calls = [call.foo.something(), call.bar.other.thing()] >>> manager.mock_calls == expected_calls Truer@…rA}rB(hZUh\j1ubaubh«)rC}rD(hZXÖIf `patch` is creating, and putting in place, your mocks then you can attach them to a manager mock using the :meth:`~Mock.attach_mock` method. After attaching calls will be recorded in `mock_calls` of the manager.rEh\j8h]h`hbh¯hd}rF(hj]rGhl]rHhh]rIhf]rJhn]rKuhqM|hrhhU]rL(hXIf rM…rN}rO(hZXIf rPh\jCubj<)rQ}rR(hZX`patch`rShd}rT(hj]rUhl]rVhh]rWhf]rXhn]rYuh\jChU]rZhXpatchr[…r\}r](hZUh\jQubahbjJubhXd is creating, and putting in place, your mocks then you can attach them to a manager mock using the r^…r_}r`(hZXd is creating, and putting in place, your mocks then you can attach them to a manager mock using the rah\jCubhÈ)rb}rc(hZX:meth:`~Mock.attach_mock`rdh\jCh]h`hbhÌhd}re(UreftyperfXmethrghЉhÑXMock.attach_mockrhU refdomainriXpyrjhf]rkhh]rlU refexplicitrm‰hj]rnhl]rohn]rphÛhÜj%Nj&j'uhqM|hU]rqj))rr}rs(hZjdhd}rt(hj]ruhl]rv(häjjXpy-methrwehh]rxhf]ryhn]rzuh\jbhU]r{hX attach_mock()r|…r}}r~(hZUh\jrubahbj7ubaubhX3 method. After attaching calls will be recorded in r…r€}r(hZX3 method. After attaching calls will be recorded in r‚h\jCubj<)rƒ}r„(hZX `mock_calls`r…hd}r†(hj]r‡hl]rˆhh]r‰hf]rŠhn]r‹uh\jChU]rŒhX mock_callsr…rŽ}r(hZUh\jƒubahbjJubhX of the manager.r…r‘}r’(hZX of the manager.r“h\jCubeubj)r”}r•(hZX>>> manager = MagicMock() >>> with patch('mymodule.Class1') as MockClass1: ... with patch('mymodule.Class2') as MockClass2: ... manager.attach_mock(MockClass1, 'MockClass1') ... manager.attach_mock(MockClass2, 'MockClass2') ... MockClass1().foo() ... MockClass2().bar() ... >>> manager.mock_calls [call.MockClass1(), call.MockClass1().foo(), call.MockClass2(), call.MockClass2().bar()]r–h\j8h]h`hbjƒhd}r—(U testnodetyper˜Xdoctestr™h›hœhf]ršhh]r›hj]rœhl]rhn]ržUgroupsrŸ]r h¤ah¥}r¡uhqM€hrhhU]r¢hX>>> manager = MagicMock() >>> with patch('mymodule.Class1') as MockClass1: ... with patch('mymodule.Class2') as MockClass2: ... manager.attach_mock(MockClass1, 'MockClass1') ... manager.attach_mock(MockClass2, 'MockClass2') ... MockClass1().foo() ... MockClass2().bar() ... >>> manager.mock_calls [call.MockClass1(), call.MockClass1().foo(), call.MockClass2(), call.MockClass2().bar()]r£…r¤}r¥(hZUh\j”ubaubh«)r¦}r§(hZX=If many calls have been made, but you're only interested in a particular sequence of them then an alternative is to use the :meth:`~Mock.assert_has_calls` method. This takes a list of calls (constructed with the :data:`call` object). If that sequence of calls are in :attr:`~Mock.mock_calls` then the assert succeeds.r¨h\j8h]h`hbh¯hd}r©(hj]rªhl]r«hh]r¬hf]r­hn]r®uhqM’hrhhU]r¯(hX|If many calls have been made, but you're only interested in a particular sequence of them then an alternative is to use the r°…r±}r²(hZX|If many calls have been made, but you're only interested in a particular sequence of them then an alternative is to use the r³h\j¦ubhÈ)r´}rµ(hZX:meth:`~Mock.assert_has_calls`r¶h\j¦h]h`hbhÌhd}r·(Ureftyper¸Xmethr¹hЉhÑXMock.assert_has_callsrºU refdomainr»Xpyr¼hf]r½hh]r¾U refexplicitr¿‰hj]rÀhl]rÁhn]rÂhÛhÜj%Nj&j'uhqM’hU]rÃj))rÄ}rÅ(hZj¶hd}rÆ(hj]rÇhl]rÈ(häj¼Xpy-methrÉehh]rÊhf]rËhn]rÌuh\j´hU]rÍhXassert_has_calls()rÎ…rÏ}rÐ(hZUh\jÄubahbj7ubaubhX: method. This takes a list of calls (constructed with the rÑ…rÒ}rÓ(hZX: method. This takes a list of calls (constructed with the rÔh\j¦ubhÈ)rÕ}rÖ(hZX :data:`call`r×h\j¦h]h`hbhÌhd}rØ(UreftyperÙXdatarÚhЉhÑXcallrÛU refdomainrÜXpyrÝhf]rÞhh]rßU refexplicitrà‰hj]ráhl]râhn]rãhÛhÜj%Nj&j'uhqM’hU]räj))rå}ræ(hZj×hd}rç(hj]rèhl]ré(häjÝXpy-datarêehh]rëhf]rìhn]ríuh\jÕhU]rîhXcallrï…rð}rñ(hZUh\jåubahbj7ubaubhX+ object). If that sequence of calls are in rò…ró}rô(hZX+ object). If that sequence of calls are in rõh\j¦ubhÈ)rö}r÷(hZX:attr:`~Mock.mock_calls`røh\j¦h]h`hbhÌhd}rù(UreftyperúXattrrûhЉhÑXMock.mock_callsrüU refdomainrýXpyrþhf]rÿhh]rU refexplicitr‰hj]rhl]rhn]rhÛhÜj%Nj&j'uhqM’hU]rj))r}r(hZjøhd}r(hj]r hl]r (häjþXpy-attrr ehh]r hf]r hn]ruh\jöhU]rhX mock_callsr…r}r(hZUh\jubahbj7ubaubhX then the assert succeeds.r…r}r(hZX then the assert succeeds.rh\j¦ubeubj)r}r(hZX>>> m = MagicMock() >>> m().foo().bar().baz() >>> m.one().two().three() >>> calls = call.one().two().three().call_list() >>> m.assert_has_calls(calls)rh\j8h]h`hbjƒhd}r(U testnodetyperXdoctestrh›hœhf]rhh]rhj]rhl]r hn]r!Ugroupsr"]r#h¤ah¥}r$uhqM˜hrhhU]r%hX>>> m = MagicMock() >>> m().foo().bar().baz() >>> m.one().two().three() >>> calls = call.one().two().three().call_list() >>> m.assert_has_calls(calls)r&…r'}r((hZUh\jubaubh«)r)}r*(hZX†Even though the chained call `m.one().two().three()` aren't the only calls that have been made to the mock, the assert still succeeds.r+h\j8h]h`hbh¯hd}r,(hj]r-hl]r.hh]r/hf]r0hn]r1uhqM¢hrhhU]r2(hXEven though the chained call r3…r4}r5(hZXEven though the chained call r6h\j)ubj<)r7}r8(hZX`m.one().two().three()`r9hd}r:(hj]r;hl]r<hh]r=hf]r>hn]r?uh\j)hU]r@hXm.one().two().three()rA…rB}rC(hZUh\j7ubahbjJubhXR aren't the only calls that have been made to the mock, the assert still succeeds.rD…rE}rF(hZXR aren't the only calls that have been made to the mock, the assert still succeeds.rGh\j)ubeubh«)rH}rI(hZXâSometimes a mock may have several calls made to it, and you are only interested in asserting about *some* of those calls. You may not even care about the order. In this case you can pass `any_order=True` to `assert_has_calls`:rJh\j8h]h`hbh¯hd}rK(hj]rLhl]rMhh]rNhf]rOhn]rPuhqM¥hrhhU]rQ(hXcSometimes a mock may have several calls made to it, and you are only interested in asserting about rR…rS}rT(hZXcSometimes a mock may have several calls made to it, and you are only interested in asserting about rUh\jHubhÞ)rV}rW(hZX*some*rXhd}rY(hj]rZhl]r[hh]r\hf]r]hn]r^uh\jHhU]r_hXsomer`…ra}rb(hZUh\jVubahbhíubhXR of those calls. You may not even care about the order. In this case you can pass rc…rd}re(hZXR of those calls. You may not even care about the order. In this case you can pass rfh\jHubj<)rg}rh(hZX`any_order=True`rihd}rj(hj]rkhl]rlhh]rmhf]rnhn]rouh\jHhU]rphXany_order=Truerq…rr}rs(hZUh\jgubahbjJubhX to rt…ru}rv(hZX to rwh\jHubj<)rx}ry(hZX`assert_has_calls`rzhd}r{(hj]r|hl]r}hh]r~hf]rhn]r€uh\jHhU]rhXassert_has_callsr‚…rƒ}r„(hZUh\jxubahbjJubhX:…r…}r†(hZX:h\jHubeubj)r‡}rˆ(hZX¯>>> m = MagicMock() >>> m(1), m.two(2, 3), m.seven(7), m.fifty('50') (...) >>> calls = [call.fifty('50'), call(1), call.seven(7)] >>> m.assert_has_calls(calls, any_order=True)r‰h\j8h]h`hbjƒhd}rŠ(U testnodetyper‹XdoctestrŒh›hœhf]rhh]rŽhj]rhl]rhn]r‘Ugroupsr’]r“h¤ah¥}r”uhqM©hrhhU]r•hX¯>>> m = MagicMock() >>> m(1), m.two(2, 3), m.seven(7), m.fifty('50') (...) >>> calls = [call.fifty('50'), call(1), call.seven(7)] >>> m.assert_has_calls(calls, any_order=True)r–…r—}r˜(hZUh\j‡ubaubeubht)r™}rš(hZUh\huh]h`hbhyhd}r›(hj]rœhl]rhh]ržhf]rŸhHahn]r hauhqM³hrhhU]r¡(hƒ)r¢}r£(hZXMore complex argument matchingr¤h\j™h]h`hbh‡hd}r¥(hj]r¦hl]r§hh]r¨hf]r©hn]rªuhqM³hrhhU]r«hXMore complex argument matchingr¬…r­}r®(hZj¤h\j¢ubaubh«)r¯}r°(hZX„Using the same basic concept as `ANY` we can implement matchers to do more complex assertions on objects used as arguments to mocks.r±h\j™h]h`hbh¯hd}r²(hj]r³hl]r´hh]rµhf]r¶hn]r·uhqMµhrhhU]r¸(hX Using the same basic concept as r¹…rº}r»(hZX Using the same basic concept as r¼h\j¯ubj<)r½}r¾(hZX`ANY`r¿hd}rÀ(hj]rÁhl]rÂhh]rÃhf]rÄhn]rÅuh\j¯hU]rÆhXANYrÇ…rÈ}rÉ(hZUh\j½ubahbjJubhX_ we can implement matchers to do more complex assertions on objects used as arguments to mocks.rÊ…rË}rÌ(hZX_ we can implement matchers to do more complex assertions on objects used as arguments to mocks.rÍh\j¯ubeubh«)rÎ}rÏ(hZX…Suppose we expect some object to be passed to a mock that by default compares equal based on object identity (which is the Python default for user defined classes). To use :meth:`~Mock.assert_called_with` we would need to pass in the exact same object. If we are only interested in some of the attributes of this object then we can create a matcher that will check these attributes for us.rÐh\j™h]h`hbh¯hd}rÑ(hj]rÒhl]rÓhh]rÔhf]rÕhn]rÖuhqM¸hrhhU]r×(hX¬Suppose we expect some object to be passed to a mock that by default compares equal based on object identity (which is the Python default for user defined classes). To use rØ…rÙ}rÚ(hZX¬Suppose we expect some object to be passed to a mock that by default compares equal based on object identity (which is the Python default for user defined classes). To use rÛh\jÎubhÈ)rÜ}rÝ(hZX :meth:`~Mock.assert_called_with`rÞh\jÎh]h`hbhÌhd}rß(UreftyperàXmethráhЉhÑXMock.assert_called_withrâU refdomainrãXpyrähf]råhh]ræU refexplicitrç‰hj]rèhl]réhn]rêhÛhÜj%Nj&j'uhqM¸hU]rëj))rì}rí(hZjÞhd}rî(hj]rïhl]rð(häjäXpy-methrñehh]ròhf]róhn]rôuh\jÜhU]rõhXassert_called_with()rö…r÷}rø(hZUh\jìubahbj7ubaubhX¹ we would need to pass in the exact same object. If we are only interested in some of the attributes of this object then we can create a matcher that will check these attributes for us.rù…rú}rû(hZX¹ we would need to pass in the exact same object. If we are only interested in some of the attributes of this object then we can create a matcher that will check these attributes for us.rüh\jÎubeubh«)rý}rþ(hZX[You can see in this example how a 'standard' call to `assert_called_with` isn't sufficient:rÿh\j™h]h`hbh¯hd}r(hj]rhl]rhh]rhf]rhn]ruhqM¿hrhhU]r(hX5You can see in this example how a 'standard' call to r…r}r (hZX5You can see in this example how a 'standard' call to r h\jýubj<)r }r (hZX`assert_called_with`r hd}r(hj]rhl]rhh]rhf]rhn]ruh\jýhU]rhXassert_called_withr…r}r(hZUh\j ubahbjJubhX isn't sufficient:r…r}r(hZX isn't sufficient:rh\jýubeubj)r}r(hZXX>>> class Foo(object): ... def __init__(self, a, b): ... self.a, self.b = a, b ... >>> mock = Mock(return_value=None) >>> mock(Foo(1, 2)) >>> mock.assert_called_with(Foo(1, 2)) Traceback (most recent call last): ... AssertionError: Expected: call(<__main__.Foo object at 0x...>) Actual call: call(<__main__.Foo object at 0x...>)rh\j™h]h`hbjƒhd}r(U testnodetyper Xdoctestr!h›hœhf]r"hh]r#hj]r$hl]r%hn]r&Ugroupsr']r(h¤ah¥}r)uhqMÂhrhhU]r*hXX>>> class Foo(object): ... def __init__(self, a, b): ... self.a, self.b = a, b ... >>> mock = Mock(return_value=None) >>> mock(Foo(1, 2)) >>> mock.assert_called_with(Foo(1, 2)) Traceback (most recent call last): ... AssertionError: Expected: call(<__main__.Foo object at 0x...>) Actual call: call(<__main__.Foo object at 0x...>)r+…r,}r-(hZUh\jubaubh«)r.}r/(hZXIA comparison function for our `Foo` class might look something like this:r0h\j™h]h`hbh¯hd}r1(hj]r2hl]r3hh]r4hf]r5hn]r6uhqMÐhrhhU]r7(hXA comparison function for our r8…r9}r:(hZXA comparison function for our r;h\j.ubj<)r<}r=(hZX`Foo`r>hd}r?(hj]r@hl]rAhh]rBhf]rChn]rDuh\j.hU]rEhXFoorF…rG}rH(hZUh\j<ubahbjJubhX& class might look something like this:rI…rJ}rK(hZX& class might look something like this:rLh\j.ubeubj)rM}rN(hZXæ>>> def compare(self, other): ... if not type(self) == type(other): ... return False ... if self.a != other.a: ... return False ... if self.b != other.b: ... return False ... return True ...rOh\j™h]h`hbjƒhd}rP(U testnodetyperQXdoctestrRh›hœhf]rShh]rThj]rUhl]rVhn]rWUgroupsrX]rYh¤ah¥}rZuhqMÒhrhhU]r[hXæ>>> def compare(self, other): ... if not type(self) == type(other): ... return False ... if self.a != other.a: ... return False ... if self.b != other.b: ... return False ... return True ...r\…r]}r^(hZUh\jMubaubh«)r_}r`(hZX{And a matcher object that can use comparison functions like this for its equality operation would look something like this:rah\j™h]h`hbh¯hd}rb(hj]rchl]rdhh]rehf]rfhn]rguhqMÞhrhhU]rhhX{And a matcher object that can use comparison functions like this for its equality operation would look something like this:ri…rj}rk(hZjah\j_ubaubj)rl}rm(hZXì>>> class Matcher(object): ... def __init__(self, compare, some_obj): ... self.compare = compare ... self.some_obj = some_obj ... def __eq__(self, other): ... return self.compare(self.some_obj, other) ...rnh\j™h]h`hbjƒhd}ro(U testnodetyperpXdoctestrqh›hœhf]rrhh]rshj]rthl]ruhn]rvUgroupsrw]rxh¤ah¥}ryuhqMáhrhhU]rzhXì>>> class Matcher(object): ... def __init__(self, compare, some_obj): ... self.compare = compare ... self.some_obj = some_obj ... def __eq__(self, other): ... return self.compare(self.some_obj, other) ...r{…r|}r}(hZUh\jlubaubh«)r~}r(hZXPutting all this together:r€h\j™h]h`hbh¯hd}r(hj]r‚hl]rƒhh]r„hf]r…hn]r†uhqMëhrhhU]r‡hXPutting all this together:rˆ…r‰}rŠ(hZj€h\j~ubaubj)r‹}rŒ(hZXR>>> match_foo = Matcher(compare, Foo(1, 2)) >>> mock.assert_called_with(match_foo)rh\j™h]h`hbjƒhd}rŽ(U testnodetyperXdoctestrh›hœhf]r‘hh]r’hj]r“hl]r”hn]r•Ugroupsr–]r—h¤ah¥}r˜uhqMíhrhhU]r™hXR>>> match_foo = Matcher(compare, Foo(1, 2)) >>> mock.assert_called_with(match_foo)rš…r›}rœ(hZUh\j‹ubaubh«)r}rž(hZXoThe `Matcher` is instantiated with our compare function and the `Foo` object we want to compare against. In `assert_called_with` the `Matcher` equality method will be called, which compares the object the mock was called with against the one we created our matcher with. If they match then `assert_called_with` passes, and if they don't an `AssertionError` is raised:rŸh\j™h]h`hbh¯hd}r (hj]r¡hl]r¢hh]r£hf]r¤hn]r¥uhqMòhrhhU]r¦(hXThe r§…r¨}r©(hZXThe rªh\jubj<)r«}r¬(hZX `Matcher`r­hd}r®(hj]r¯hl]r°hh]r±hf]r²hn]r³uh\jhU]r´hXMatcherrµ…r¶}r·(hZUh\j«ubahbjJubhX3 is instantiated with our compare function and the r¸…r¹}rº(hZX3 is instantiated with our compare function and the r»h\jubj<)r¼}r½(hZX`Foo`r¾hd}r¿(hj]rÀhl]rÁhh]rÂhf]rÃhn]rÄuh\jhU]rÅhXFoorÆ…rÇ}rÈ(hZUh\j¼ubahbjJubhX' object we want to compare against. In rÉ…rÊ}rË(hZX' object we want to compare against. In rÌh\jubj<)rÍ}rÎ(hZX`assert_called_with`rÏhd}rÐ(hj]rÑhl]rÒhh]rÓhf]rÔhn]rÕuh\jhU]rÖhXassert_called_withr×…rØ}rÙ(hZUh\jÍubahbjJubhX the rÚ…rÛ}rÜ(hZX the rÝh\jubj<)rÞ}rß(hZX `Matcher`ràhd}rá(hj]râhl]rãhh]rähf]råhn]ræuh\jhU]rçhXMatcherrè…ré}rê(hZUh\jÞubahbjJubhX” equality method will be called, which compares the object the mock was called with against the one we created our matcher with. If they match then rë…rì}rí(hZX” equality method will be called, which compares the object the mock was called with against the one we created our matcher with. If they match then rîh\jubj<)rï}rð(hZX`assert_called_with`rñhd}rò(hj]róhl]rôhh]rõhf]röhn]r÷uh\jhU]røhXassert_called_withrù…rú}rû(hZUh\jïubahbjJubhX passes, and if they don't an rü…rý}rþ(hZX passes, and if they don't an rÿh\jubj<)r}r(hZX`AssertionError`rhd}r(hj]rhl]rhh]rhf]rhn]ruh\jhU]r hXAssertionErrorr …r }r (hZUh\jubahbjJubhX is raised:r …r}r(hZX is raised:rh\jubeubj)r}r(hZXê>>> match_wrong = Matcher(compare, Foo(3, 4)) >>> mock.assert_called_with(match_wrong) Traceback (most recent call last): ... AssertionError: Expected: ((,), {}) Called with: ((,), {})rh\j™h]h`hbjƒhd}r(U testnodetyperXdoctestrh›hœhf]rhh]rhj]rhl]rhn]rUgroupsr]rh¤ah¥}ruhqMøhrhhU]rhXê>>> match_wrong = Matcher(compare, Foo(3, 4)) >>> mock.assert_called_with(match_wrong) Traceback (most recent call last): ... AssertionError: Expected: ((,), {}) Called with: ((,), {})r …r!}r"(hZUh\jubaubh«)r#}r$(hZXŒWith a bit of tweaking you could have the comparison function raise the `AssertionError` directly and provide a more useful failure message.r%h\j™h]h`hbh¯hd}r&(hj]r'hl]r(hh]r)hf]r*hn]r+uhqMhrhhU]r,(hXHWith a bit of tweaking you could have the comparison function raise the r-…r.}r/(hZXHWith a bit of tweaking you could have the comparison function raise the r0h\j#ubj<)r1}r2(hZX`AssertionError`r3hd}r4(hj]r5hl]r6hh]r7hf]r8hn]r9uh\j#hU]r:hXAssertionErrorr;…r<}r=(hZUh\j1ubahbjJubhX4 directly and provide a more useful failure message.r>…r?}r@(hZX4 directly and provide a more useful failure message.rAh\j#ubeubh«)rB}rC(hZXXAs of version 1.5, the Python testing library `PyHamcrest `_ provides similar functionality, that may be useful here, in the form of its equality matcher (`hamcrest.library.integration.match_equality `_).rDh\j™h]h`hbh¯hd}rE(hj]rFhl]rGhh]rHhf]rIhn]rJuhqMhrhhU]rK(hX.As of version 1.5, the Python testing library rL…rM}rN(hZX.As of version 1.5, the Python testing library rOh\jBubj›)rP}rQ(hZX6`PyHamcrest `_rRhd}rS(UnamerTX PyHamcrestrUj¢X&http://pypi.python.org/pypi/PyHamcrestrVhf]rWhh]rXhj]rYhl]rZhn]r[uh\jBhU]r\hX PyHamcrestr]…r^}r_(hZUh\jPubahbj­ubhW)r`}ra(hZX) rbj±Kh\jBhbhchd}rc(UrefurirdjVhf]reh9ahh]rfhj]rghl]rhhn]rihauhU]rjubhX_ provides similar functionality, that may be useful here, in the form of its equality matcher (rk…rl}rm(hZX_ provides similar functionality, that may be useful here, in the form of its equality matcher (rnh\jBubj›)ro}rp(hZX“`hamcrest.library.integration.match_equality `_rqhd}rr(UnamersX+hamcrest.library.integration.match_equalityrtj¢Xbhttp://packages.python.org/PyHamcrest/integration.html#hamcrest.library.integration.match_equalityruhf]rvhh]rwhj]rxhl]ryhn]rzuh\jBhU]r{hX+hamcrest.library.integration.match_equalityr|…r}}r~(hZUh\joubahbj­ubhW)r}r€(hZXe rj±Kh\jBhbhchd}r‚(Urefurirƒjuhf]r„h?ahh]r…hj]r†hl]r‡hn]rˆhauhU]r‰ubhX).rŠ…r‹}rŒ(hZX).rh\jBubeubeubht)rŽ}r(hZUh\huh]h`hbhyhd}r(hj]r‘hl]r’hh]r“hf]r”h6ahn]r•h auhqM hrhhU]r–(hƒ)r—}r˜(hZX*Less verbose configuration of mock objectsr™h\jŽh]h`hbh‡hd}rš(hj]r›hl]rœhh]rhf]ržhn]rŸuhqM hrhhU]r hX*Less verbose configuration of mock objectsr¡…r¢}r£(hZj™h\j—ubaubh«)r¤}r¥(hZXzThis recipe, for easier configuration of mock objects, is now part of `Mock`. See the :meth:`~Mock.configure_mock` method.r¦h\jŽh]h`hbh¯hd}r§(hj]r¨hl]r©hh]rªhf]r«hn]r¬uhqMhrhhU]r­(hXFThis recipe, for easier configuration of mock objects, is now part of r®…r¯}r°(hZXFThis recipe, for easier configuration of mock objects, is now part of r±h\j¤ubj<)r²}r³(hZX`Mock`r´hd}rµ(hj]r¶hl]r·hh]r¸hf]r¹hn]rºuh\j¤hU]r»hXMockr¼…r½}r¾(hZUh\j²ubahbjJubhX . See the r¿…rÀ}rÁ(hZX . See the rÂh\j¤ubhÈ)rÃ}rÄ(hZX:meth:`~Mock.configure_mock`rÅh\j¤h]h`hbhÌhd}rÆ(UreftyperÇXmethrÈhЉhÑXMock.configure_mockrÉU refdomainrÊXpyrËhf]rÌhh]rÍU refexplicitrΉhj]rÏhl]rÐhn]rÑhÛhÜj%Nj&j'uhqMhU]rÒj))rÓ}rÔ(hZjÅhd}rÕ(hj]rÖhl]r×(häjËXpy-methrØehh]rÙhf]rÚhn]rÛuh\jÃhU]rÜhXconfigure_mock()rÝ…rÞ}rß(hZUh\jÓubahbj7ubaubhX method.rà…rá}râ(hZX method.rãh\j¤ubeubeubht)rä}rå(hZUh\huh]h`hbhyhd}ræ(hj]rçhl]rèhh]réhf]rêh>ahn]rëhauhqMhrhhU]rì(hƒ)rí}rî(hZX#Matching any argument in assertionsrïh\jäh]h`hbh‡hd}rð(hj]rñhl]ròhh]róhf]rôhn]rõuhqMhrhhU]röhX#Matching any argument in assertionsr÷…rø}rù(hZjïh\jíubaubh«)rú}rû(hZX6This example is now built in to mock. See :data:`ANY`.rüh\jäh]h`hbh¯hd}rý(hj]rþhl]rÿhh]rhf]rhn]ruhqMhrhhU]r(hX*This example is now built in to mock. See r…r}r(hZX*This example is now built in to mock. See rh\júubhÈ)r}r (hZX :data:`ANY`r h\júh]h`hbhÌhd}r (Ureftyper Xdatar hЉhÑXANYrU refdomainrXpyrhf]rhh]rU refexplicitr‰hj]rhl]rhn]rhÛhÜj%Nj&j'uhqMhU]rj))r}r(hZj hd}r(hj]rhl]r(häjXpy-datarehh]rhf]rhn]r uh\jhU]r!hXANYr"…r#}r$(hZUh\jubahbj7ubaubhX.…r%}r&(hZX.h\júubeubeubht)r'}r((hZUh\huh]h`hbhyhd}r)(hj]r*hl]r+hh]r,hf]r-hJahn]r.hauhqMhrhhU]r/(hƒ)r0}r1(hZXMocking Propertiesr2h\j'h]h`hbh‡hd}r3(hj]r4hl]r5hh]r6hf]r7hn]r8uhqMhrhhU]r9hXMocking Propertiesr:…r;}r<(hZj2h\j0ubaubh«)r=}r>(hZX@This example is now built in to mock. See :class:`PropertyMock`.r?h\j'h]h`hbh¯hd}r@(hj]rAhl]rBhh]rChf]rDhn]rEuhqMhrhhU]rF(hX*This example is now built in to mock. See rG…rH}rI(hZX*This example is now built in to mock. See rJh\j=ubhÈ)rK}rL(hZX:class:`PropertyMock`rMh\j=h]h`hbhÌhd}rN(UreftyperOXclassrPhЉhÑX PropertyMockrQU refdomainrRXpyrShf]rThh]rUU refexplicitrV‰hj]rWhl]rXhn]rYhÛhÜj%Nj&j'uhqMhU]rZj))r[}r\(hZjMhd}r](hj]r^hl]r_(häjSXpy-classr`ehh]rahf]rbhn]rcuh\jKhU]rdhX PropertyMockre…rf}rg(hZUh\j[ubahbj7ubaubhX.…rh}ri(hZX.h\j=ubeubeubht)rj}rk(hZUh\huh]h`hbhyhd}rl(hj]rmhl]rnhh]rohf]rph5ahn]rqh auhqMhrhhU]rr(hƒ)rs}rt(hZX Mocking openruh\jjh]h`hbh‡hd}rv(hj]rwhl]rxhh]ryhf]rzhn]r{uhqMhrhhU]r|hX Mocking openr}…r~}r(hZjuh\jsubaubh«)r€}r(hZX<This example is now built in to mock. See :func:`mock_open`.r‚h\jjh]h`hbh¯hd}rƒ(hj]r„hl]r…hh]r†hf]r‡hn]rˆuhqM!hrhhU]r‰(hX*This example is now built in to mock. See rŠ…r‹}rŒ(hZX*This example is now built in to mock. See rh\j€ubhÈ)rŽ}r(hZX:func:`mock_open`rh\j€h]h`hbhÌhd}r‘(Ureftyper’Xfuncr“hЉhÑX mock_openr”U refdomainr•Xpyr–hf]r—hh]r˜U refexplicitr™‰hj]ršhl]r›hn]rœhÛhÜj%Nj&j'uhqM!hU]rj))rž}rŸ(hZjhd}r (hj]r¡hl]r¢(häj–Xpy-funcr£ehh]r¤hf]r¥hn]r¦uh\jŽhU]r§hX mock_open()r¨…r©}rª(hZUh\jžubahbj7ubaubhX.…r«}r¬(hZX.h\j€ubeubeubht)r­}r®(hZUh\huh]h`hbhyhd}r¯(hj]r°hl]r±hh]r²hf]r³hQahn]r´h$auhqM%hrhhU]rµ(hƒ)r¶}r·(hZXMocks without some attributesr¸h\j­h]h`hbh‡hd}r¹(hj]rºhl]r»hh]r¼hf]r½hn]r¾uhqM%hrhhU]r¿hXMocks without some attributesrÀ…rÁ}rÂ(hZj¸h\j¶ubaubh«)rÃ}rÄ(hZXEThis example is now built in to mock. See :ref:`deleting-attributes`.rÅh\j­h]h`hbh¯hd}rÆ(hj]rÇhl]rÈhh]rÉhf]rÊhn]rËuhqM'hrhhU]rÌ(hX*This example is now built in to mock. See rÍ…rÎ}rÏ(hZX*This example is now built in to mock. See rÐh\jÃubhÈ)rÑ}rÒ(hZX:ref:`deleting-attributes`rÓh\jÃh]h`hbhÌhd}rÔ(UreftyperÕXrefrÖhЈhÑXdeleting-attributesr×U refdomainrØXstdrÙhf]rÚhh]rÛU refexplicitr܉hj]rÝhl]rÞhn]rßhÛhÜuhqM'hU]ràhÞ)rá}râ(hZjÓhd}rã(hj]rähl]rå(häjÙXstd-refræehh]rçhf]rèhn]réuh\jÑhU]rêhXdeleting-attributesrë…rì}rí(hZUh\jáubahbhíubaubhX.…rî}rï(hZX.h\jÃubeubeubeubehZUU transformerrðNU footnote_refsrñ}ròUrefnamesró}rôX unittest2rõ]röj:asUsymbol_footnotesr÷]røUautofootnote_refsrù]rú(jžj´eUsymbol_footnote_refsrû]rüU citationsrý]rþhrhU current_linerÿNUtransform_messagesr]rcdocutils.nodes system_message r)r}r(hZUhd}r(hj]rUlevelrKhf]rhh]r Usourcer h`hl]r hn]r Uliner KUtyperUINFOruhU]rh«)r}r(hZUhd}r(hj]rhl]rhh]rhf]rhn]ruh\jhU]rhX6Hyperlink target "further-examples" is not referenced.r…r}r(hZUh\jubahbh¯ubahbUsystem_messagerubaUreporterrNUid_startrKU autofootnotesr ]r!(jYjreU citation_refsr"}r#Uindirect_targetsr$]r%Usettingsr&(cdocutils.frontend Values r'or(}r)(Ufootnote_backlinksr*KUrecord_dependenciesr+NU rfc_base_urlr,Uhttp://tools.ietf.org/html/r-U tracebackr.ˆUpep_referencesr/NUstrip_commentsr0NU toc_backlinksr1Uentryr2U language_coder3Uenr4U datestampr5NU report_levelr6KU _destinationr7NU halt_levelr8KU strip_classesr9Nh‡NUerror_encoding_error_handlerr:Ubackslashreplacer;Udebugr<NUembed_stylesheetr=‰Uoutput_encoding_error_handlerr>Ustrictr?U sectnum_xformr@KUdump_transformsrANU docinfo_xformrBKUwarning_streamrCNUpep_file_url_templaterDUpep-%04drEUexit_status_levelrFKUconfigrGNUstrict_visitorrHNUcloak_email_addressesrIˆUtrim_footnote_reference_spacerJ‰UenvrKNUdump_pseudo_xmlrLNUexpose_internalsrMNUsectsubtitle_xformrN‰U source_linkrONUrfc_referencesrPNUoutput_encodingrQUutf-8rRU source_urlrSNUinput_encodingrTU utf-8-sigrUU_disable_configrVNU id_prefixrWUU tab_widthrXKUerror_encodingrYU mac-romanrZU_sourcer[U/compile/mock/docs/examples.txtr\Ugettext_compactr]ˆU generatorr^NUdump_internalsr_NU pep_base_urlr`Uhttp://www.python.org/dev/peps/raUsyntax_highlightrbUshortrcUinput_encoding_error_handlerrdj?Uauto_id_prefixreUidrfUdoctitle_xformrg‰Ustrip_elements_with_classesrhNU _config_filesri]rjUfile_insertion_enabledrkKU raw_enabledrlKU dump_settingsrmNubUsymbol_footnote_startrnKUidsro}rp(hjäh3j h6jŽuUsubstitution_namesrq}rrhbhrhd}rs(hj]rthf]ruhh]rvUsourcerwh`hl]rxhn]ryuU footnotesrz]r{Urefidsr|}r}(hI]r~hXahG]rj´ah:]r€jžauub.mock-1.0.1/html/.doctrees/getting-started.doctree0000644000076500001200000021243612046030506022463 0ustar michaeladmin00000000000000€cdocutils.nodes document q)q}q(U nametypesq}q(Xgetting-startedqˆX using mockqNXmocking classesqNX#side effect functions and iterablesq NXgetting started with mockq NXpatch decoratorsq NXmock patching methodsq NX"mock for method calls on an objectq NXtracking all callsqNXnaming your mocksqNX$setting return values and attributesqNX'creating a mock from an existing objectqNXraising exceptions with mocksqNuUsubstitution_defsq}qUparse_messagesq]qUcurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q(hUgetting-startedqhU using-mockqhUmocking-classesqh U#side-effect-functions-and-iterablesqh Ugetting-started-with-mockq h Upatch-decoratorsq!h Umock-patching-methodsq"h U"mock-for-method-calls-on-an-objectq#hUtracking-all-callsq$hUnaming-your-mocksq%hU$setting-return-values-and-attributesq&hU'creating-a-mock-from-an-existing-objectq'hUraising-exceptions-with-mocksq(uUchildrenq)]q*cdocutils.nodes section q+)q,}q-(U rawsourceq.UUparentq/hUsourceq0cdocutils.nodes reprunicode q1X&/compile/mock/docs/getting-started.txtq2…q3}q4bUtagnameq5Usectionq6U attributesq7}q8(Udupnamesq9]q:Uclassesq;]qUidsq?]q@h aUnamesqA]qBh auUlineqCKUdocumentqDhh)]qE(cdocutils.nodes title qF)qG}qH(h.XGetting Started with MockqIh/h,h0h3h5UtitleqJh7}qK(h9]qLh;]qMh=]qNh?]qOhA]qPuhCKhDhh)]qQcdocutils.nodes Text qRXGetting Started with MockqS…qT}qU(h.hIh/hGubaubcdocutils.nodes target qV)qW}qX(h.X.. _getting-started:qYh/h,h0h3h5UtargetqZh7}q[(h9]q\h;]q]h=]q^h?]q_hahA]q`hauhCKhDhh)]qaubcsphinx.addnodes index qb)qc}qd(h.Uh/h,h0h3h5Uindexqeh7}qf(h?]qgh=]qhh9]qih;]qjhA]qkUentriesql]qm(UsingleqnXGetting StartedUindex-0qoUtqpaUinlineqq‰uhCKhDhh)]qrubhV)qs}qt(h.Uh/h,h0h3h5hZh7}qu(h9]qvh;]qwh=]qxh?]qyhoahA]qzuhCKhDhh)]q{ubcdocutils.nodes comment q|)q}}q~(h.Xöclass SomeClass(object): static_method = None class_method = None attribute = None sys.modules['package'] = package = Mock(name='package') sys.modules['package.module'] = module = package.module sys.modules['module'] = package.moduleqh/h,h0h3h5Ucommentq€h7}q(U testnodetypeq‚X testsetupqƒU xml:spaceq„Upreserveq…h?]q†h=]q‡h9]qˆh;]q‰hA]qŠUgroupsq‹]qŒUdefaultqaUoptionsqŽ}quhCK hDhh)]qhRXöclass SomeClass(object): static_method = None class_method = None attribute = None sys.modules['package'] = package = Mock(name='package') sys.modules['package.module'] = module = package.module sys.modules['module'] = package.moduleq‘…q’}q“(h.Uh/h}ubaubh+)q”}q•(h.Uh/h,h0h3h5h6h7}q–(h9]q—h;]q˜h=]q™h?]qšhahA]q›hauhCKhDhh)]qœ(hF)q}qž(h.X Using MockqŸh/h”h0h3h5hJh7}q (h9]q¡h;]q¢h=]q£h?]q¤hA]q¥uhCKhDhh)]q¦hRX Using Mockq§…q¨}q©(h.hŸh/hubaubh+)qª}q«(h.Uh/h”h0h3h5h6h7}q¬(h9]q­h;]q®h=]q¯h?]q°h"ahA]q±h auhCKhDhh)]q²(hF)q³}q´(h.XMock Patching Methodsqµh/hªh0h3h5hJh7}q¶(h9]q·h;]q¸h=]q¹h?]qºhA]q»uhCKhDhh)]q¼hRXMock Patching Methodsq½…q¾}q¿(h.hµh/h³ubaubcdocutils.nodes paragraph qÀ)qÁ}qÂ(h.X.Common uses for :class:`Mock` objects include:qÃh/hªh0h3h5U paragraphqÄh7}qÅ(h9]qÆh;]qÇh=]qÈh?]qÉhA]qÊuhCKhDhh)]qË(hRXCommon uses for qÌ…qÍ}qÎ(h.XCommon uses for qÏh/hÁubcsphinx.addnodes pending_xref qÐ)qÑ}qÒ(h.X :class:`Mock`qÓh/hÁh0h3h5U pending_xrefqÔh7}qÕ(UreftypeqÖXclassq×Urefwarnq؉U reftargetqÙXMockqÚU refdomainqÛXpyqÜh?]qÝh=]qÞU refexplicitq߉h9]qàh;]qáhA]qâUrefdocqãUgetting-startedqäUpy:classqåNU py:moduleqæNuhCKh)]qçcdocutils.nodes literal qè)qé}qê(h.hÓh7}që(h9]qìh;]qí(UxrefqîhÜXpy-classqïeh=]qðh?]qñhA]qòuh/hÑh)]qóhRXMockqô…qõ}qö(h.Uh/héubah5Uliteralq÷ubaubhRX objects include:qø…qù}qú(h.X objects include:qûh/hÁubeubcdocutils.nodes bullet_list qü)qý}qþ(h.Uh/hªh0h3h5U bullet_listqÿh7}r(UbulletrX*h?]rh=]rh9]rh;]rhA]ruhCKhDhh)]r(cdocutils.nodes list_item r)r }r (h.XPatching methodsr h/hýh0h3h5U list_itemr h7}r (h9]rh;]rh=]rh?]rhA]ruhCNhDhh)]rhÀ)r}r(h.j h/j h0h3h5hÄh7}r(h9]rh;]rh=]rh?]rhA]ruhCKh)]rhRXPatching methodsr…r}r(h.j h/jubaubaubj)r }r!(h.X"Recording method calls on objects r"h/hýh0h3h5j h7}r#(h9]r$h;]r%h=]r&h?]r'hA]r(uhCNhDhh)]r)hÀ)r*}r+(h.X!Recording method calls on objectsr,h/j h0h3h5hÄh7}r-(h9]r.h;]r/h=]r0h?]r1hA]r2uhCKh)]r3hRX!Recording method calls on objectsr4…r5}r6(h.j,h/j*ubaubaubeubhÀ)r7}r8(h.X„You might want to replace a method on an object to check that it is called with the correct arguments by another part of the system:r9h/hªh0h3h5hÄh7}r:(h9]r;h;]r<h=]r=h?]r>hA]r?uhCK hDhh)]r@hRX„You might want to replace a method on an object to check that it is called with the correct arguments by another part of the system:rA…rB}rC(h.j9h/j7ubaubcdocutils.nodes literal_block rD)rE}rF(h.XŒ>>> real = SomeClass() >>> real.method = MagicMock(name='method') >>> real.method(3, 4, 5, key='value') rGh/hªh0h3h5U literal_blockrHh7}rI(U testnodetyperJXdoctestrKh„h…h?]rLh=]rMh9]rNh;]rOhA]rPUgroupsrQ]rRhahŽ}rSuhCK#hDhh)]rThRXŒ>>> real = SomeClass() >>> real.method = MagicMock(name='method') >>> real.method(3, 4, 5, key='value') rU…rV}rW(h.Uh/jEubaubhÀ)rX}rY(h.X—Once our mock has been used (`real.method` in this example) it has methods and attributes that allow you to make assertions about how it has been used.rZh/hªh0h3h5hÄh7}r[(h9]r\h;]r]h=]r^h?]r_hA]r`uhCK*hDhh)]ra(hRXOnce our mock has been used (rb…rc}rd(h.XOnce our mock has been used (reh/jXubcdocutils.nodes title_reference rf)rg}rh(h.X `real.method`rih7}rj(h9]rkh;]rlh=]rmh?]rnhA]rouh/jXh)]rphRX real.methodrq…rr}rs(h.Uh/jgubah5Utitle_referencertubhRXm in this example) it has methods and attributes that allow you to make assertions about how it has been used.ru…rv}rw(h.Xm in this example) it has methods and attributes that allow you to make assertions about how it has been used.rxh/jXubeubcdocutils.nodes note ry)rz}r{(h.X·In most of these examples the :class:`Mock` and :class:`MagicMock` classes are interchangeable. As the `MagicMock` is the more capable class it makes a sensible one to use by default.r|h/hªh0h3h5Unoter}h7}r~(h9]rh;]r€h=]rh?]r‚hA]rƒuhCNhDhh)]r„hÀ)r…}r†(h.X·In most of these examples the :class:`Mock` and :class:`MagicMock` classes are interchangeable. As the `MagicMock` is the more capable class it makes a sensible one to use by default.r‡h/jzh0h3h5hÄh7}rˆ(h9]r‰h;]rŠh=]r‹h?]rŒhA]ruhCK/h)]rŽ(hRXIn most of these examples the r…r}r‘(h.XIn most of these examples the r’h/j…ubhÐ)r“}r”(h.X :class:`Mock`r•h/j…h0h3h5hÔh7}r–(Ureftyper—Xclassr˜h؉hÙXMockr™U refdomainršXpyr›h?]rœh=]rU refexplicitrž‰h9]rŸh;]r hA]r¡hãhähåNhæNuhCK/h)]r¢hè)r£}r¤(h.j•h7}r¥(h9]r¦h;]r§(hîj›Xpy-classr¨eh=]r©h?]rªhA]r«uh/j“h)]r¬hRXMockr­…r®}r¯(h.Uh/j£ubah5h÷ubaubhRX and r°…r±}r²(h.X and r³h/j…ubhÐ)r´}rµ(h.X:class:`MagicMock`r¶h/j…h0h3h5hÔh7}r·(Ureftyper¸Xclassr¹h؉hÙX MagicMockrºU refdomainr»Xpyr¼h?]r½h=]r¾U refexplicitr¿‰h9]rÀh;]rÁhA]rÂhãhähåNhæNuhCK/h)]rÃhè)rÄ}rÅ(h.j¶h7}rÆ(h9]rÇh;]rÈ(hîj¼Xpy-classrÉeh=]rÊh?]rËhA]rÌuh/j´h)]rÍhRX MagicMockrÎ…rÏ}rÐ(h.Uh/jÄubah5h÷ubaubhRX% classes are interchangeable. As the rÑ…rÒ}rÓ(h.X% classes are interchangeable. As the rÔh/j…ubjf)rÕ}rÖ(h.X `MagicMock`r×h7}rØ(h9]rÙh;]rÚh=]rÛh?]rÜhA]rÝuh/j…h)]rÞhRX MagicMockrß…rà}rá(h.Uh/jÕubah5jtubhRXE is the more capable class it makes a sensible one to use by default.râ…rã}rä(h.XE is the more capable class it makes a sensible one to use by default.råh/j…ubeubaubhÀ)ræ}rç(h.XûOnce the mock has been called its :attr:`~Mock.called` attribute is set to `True`. More importantly we can use the :meth:`~Mock.assert_called_with` or :meth:`~Mock.assert_called_once_with` method to check that it was called with the correct arguments.rèh/hªh0h3h5hÄh7}ré(h9]rêh;]rëh=]rìh?]ríhA]rîuhCK3hDhh)]rï(hRX"Once the mock has been called its rð…rñ}rò(h.X"Once the mock has been called its róh/jæubhÐ)rô}rõ(h.X:attr:`~Mock.called`röh/jæh0h3h5hÔh7}r÷(UreftyperøXattrrùh؉hÙX Mock.calledrúU refdomainrûXpyrüh?]rýh=]rþU refexplicitrÿ‰h9]rh;]rhA]rhãhähåNhæNuhCK3h)]rhè)r}r(h.jöh7}r(h9]rh;]r(hîjüXpy-attrr eh=]r h?]r hA]r uh/jôh)]r hRXcalledr…r}r(h.Uh/jubah5h÷ubaubhRX attribute is set to r…r}r(h.X attribute is set to rh/jæubjf)r}r(h.X`True`rh7}r(h9]rh;]rh=]rh?]rhA]ruh/jæh)]rhRXTruer…r }r!(h.Uh/jubah5jtubhRX". More importantly we can use the r"…r#}r$(h.X". More importantly we can use the r%h/jæubhÐ)r&}r'(h.X :meth:`~Mock.assert_called_with`r(h/jæh0h3h5hÔh7}r)(Ureftyper*Xmethr+h؉hÙXMock.assert_called_withr,U refdomainr-Xpyr.h?]r/h=]r0U refexplicitr1‰h9]r2h;]r3hA]r4hãhähåNhæNuhCK3h)]r5hè)r6}r7(h.j(h7}r8(h9]r9h;]r:(hîj.Xpy-methr;eh=]r<h?]r=hA]r>uh/j&h)]r?hRXassert_called_with()r@…rA}rB(h.Uh/j6ubah5h÷ubaubhRX or rC…rD}rE(h.X or rFh/jæubhÐ)rG}rH(h.X%:meth:`~Mock.assert_called_once_with`rIh/jæh0h3h5hÔh7}rJ(UreftyperKXmethrLh؉hÙXMock.assert_called_once_withrMU refdomainrNXpyrOh?]rPh=]rQU refexplicitrR‰h9]rSh;]rThA]rUhãhähåNhæNuhCK3h)]rVhè)rW}rX(h.jIh7}rY(h9]rZh;]r[(hîjOXpy-methr\eh=]r]h?]r^hA]r_uh/jGh)]r`hRXassert_called_once_with()ra…rb}rc(h.Uh/jWubah5h÷ubaubhRX? method to check that it was called with the correct arguments.rd…re}rf(h.X? method to check that it was called with the correct arguments.rgh/jæubeubhÀ)rh}ri(h.XgThis example tests that calling `ProductionClass().method` results in a call to the `something` method:rjh/hªh0h3h5hÄh7}rk(h9]rlh;]rmh=]rnh?]rohA]rpuhCK8hDhh)]rq(hRX This example tests that calling rr…rs}rt(h.X This example tests that calling ruh/jhubjf)rv}rw(h.X`ProductionClass().method`rxh7}ry(h9]rzh;]r{h=]r|h?]r}hA]r~uh/jhh)]rhRXProductionClass().methodr€…r}r‚(h.Uh/jvubah5jtubhRX results in a call to the rƒ…r„}r…(h.X results in a call to the r†h/jhubjf)r‡}rˆ(h.X `something`r‰h7}rŠ(h9]r‹h;]rŒh=]rh?]rŽhA]ruh/jhh)]rhRX somethingr‘…r’}r“(h.Uh/j‡ubah5jtubhRX method:r”…r•}r–(h.X method:r—h/jhubeubjD)r˜}r™(h.X>>>> from mock import MagicMock >>> class ProductionClass(object): ... def method(self): ... self.something(1, 2, 3) ... def something(self, a, b, c): ... pass ... >>> real = ProductionClass() >>> real.something = MagicMock() >>> real.method() >>> real.something.assert_called_once_with(1, 2, 3)ršh/hªh0h3h5jHh7}r›(U testnodetyperœXdoctestrh„h…h?]ržh=]rŸh9]r h;]r¡hA]r¢Ugroupsr£]r¤hahŽ}r¥uhCK;hDhh)]r¦hRX>>>> from mock import MagicMock >>> class ProductionClass(object): ... def method(self): ... self.something(1, 2, 3) ... def something(self, a, b, c): ... pass ... >>> real = ProductionClass() >>> real.something = MagicMock() >>> real.method() >>> real.something.assert_called_once_with(1, 2, 3)r§…r¨}r©(h.Uh/j˜ubaubeubh+)rª}r«(h.Uh/h”h0h3h5h6h7}r¬(h9]r­h;]r®h=]r¯h?]r°h#ahA]r±h auhCKLhDhh)]r²(hF)r³}r´(h.X"Mock for Method Calls on an Objectrµh/jªh0h3h5hJh7}r¶(h9]r·h;]r¸h=]r¹h?]rºhA]r»uhCKLhDhh)]r¼hRX"Mock for Method Calls on an Objectr½…r¾}r¿(h.jµh/j³ubaubhÀ)rÀ}rÁ(h.XúIn the last example we patched a method directly on an object to check that it was called correctly. Another common use case is to pass an object into a method (or some part of the system under test) and then check that it is used in the correct way.rÂh/jªh0h3h5hÄh7}rÃ(h9]rÄh;]rÅh=]rÆh?]rÇhA]rÈuhCKNhDhh)]rÉhRXúIn the last example we patched a method directly on an object to check that it was called correctly. Another common use case is to pass an object into a method (or some part of the system under test) and then check that it is used in the correct way.rÊ…rË}rÌ(h.jÂh/jÀubaubhÀ)rÍ}rÎ(h.XuThe simple `ProductionClass` below has a `closer` method. If it is called with an object then it calls `close` on it.rÏh/jªh0h3h5hÄh7}rÐ(h9]rÑh;]rÒh=]rÓh?]rÔhA]rÕuhCKShDhh)]rÖ(hRX The simple r×…rØ}rÙ(h.X The simple rÚh/jÍubjf)rÛ}rÜ(h.X`ProductionClass`rÝh7}rÞ(h9]rßh;]ràh=]ráh?]râhA]rãuh/jÍh)]rähRXProductionClassrå…ræ}rç(h.Uh/jÛubah5jtubhRX below has a rè…ré}rê(h.X below has a rëh/jÍubjf)rì}rí(h.X`closer`rîh7}rï(h9]rðh;]rñh=]ròh?]róhA]rôuh/jÍh)]rõhRXcloserrö…r÷}rø(h.Uh/jìubah5jtubhRX6 method. If it is called with an object then it calls rù…rú}rû(h.X6 method. If it is called with an object then it calls rüh/jÍubjf)rý}rþ(h.X`close`rÿh7}r(h9]rh;]rh=]rh?]rhA]ruh/jÍh)]rhRXcloser…r}r (h.Uh/jýubah5jtubhRX on it.r …r }r (h.X on it.r h/jÍubeubjD)r}r(h.Xi>>> class ProductionClass(object): ... def closer(self, something): ... something.close() ...rh/jªh0h3h5jHh7}r(U testnodetyperXdoctestrh„h…h?]rh=]rh9]rh;]rhA]rUgroupsr]rhahŽ}ruhCKVhDhh)]rhRXi>>> class ProductionClass(object): ... def closer(self, something): ... something.close() ...r…r}r(h.Uh/jubaubhÀ)r }r!(h.XhSo to test it we need to pass in an object with a `close` method and check that it was called correctly.r"h/jªh0h3h5hÄh7}r#(h9]r$h;]r%h=]r&h?]r'hA]r(uhCK]hDhh)]r)(hRX2So to test it we need to pass in an object with a r*…r+}r,(h.X2So to test it we need to pass in an object with a r-h/j ubjf)r.}r/(h.X`close`r0h7}r1(h9]r2h;]r3h=]r4h?]r5hA]r6uh/j h)]r7hRXcloser8…r9}r:(h.Uh/j.ubah5jtubhRX/ method and check that it was called correctly.r;…r<}r=(h.X/ method and check that it was called correctly.r>h/j ubeubjD)r?}r@(h.Xh>>> real = ProductionClass() >>> mock = Mock() >>> real.closer(mock) >>> mock.close.assert_called_with()rAh/jªh0h3h5jHh7}rB(U testnodetyperCXdoctestrDh„h…h?]rEh=]rFh9]rGh;]rHhA]rIUgroupsrJ]rKhahŽ}rLuhCK`hDhh)]rMhRXh>>> real = ProductionClass() >>> mock = Mock() >>> real.closer(mock) >>> mock.close.assert_called_with()rN…rO}rP(h.Uh/j?ubaubhÀ)rQ}rR(h.XWe don't have to do any work to provide the 'close' method on our mock. Accessing close creates it. So, if 'close' hasn't already been called then accessing it in the test will create it, but :meth:`~Mock.assert_called_with` will raise a failure exception.rSh/jªh0h3h5hÄh7}rT(h9]rUh;]rVh=]rWh?]rXhA]rYuhCKghDhh)]rZ(hRXÀWe don't have to do any work to provide the 'close' method on our mock. Accessing close creates it. So, if 'close' hasn't already been called then accessing it in the test will create it, but r[…r\}r](h.XÀWe don't have to do any work to provide the 'close' method on our mock. Accessing close creates it. So, if 'close' hasn't already been called then accessing it in the test will create it, but r^h/jQubhÐ)r_}r`(h.X :meth:`~Mock.assert_called_with`rah/jQh0h3h5hÔh7}rb(UreftypercXmethrdh؉hÙXMock.assert_called_withreU refdomainrfXpyrgh?]rhh=]riU refexplicitrj‰h9]rkh;]rlhA]rmhãhähåNhæNuhCKgh)]rnhè)ro}rp(h.jah7}rq(h9]rrh;]rs(hîjgXpy-methrteh=]ruh?]rvhA]rwuh/j_h)]rxhRXassert_called_with()ry…rz}r{(h.Uh/joubah5h÷ubaubhRX will raise a failure exception.r|…r}}r~(h.X will raise a failure exception.rh/jQubeubeubh+)r€}r(h.Uh/h”h0h3h5h6h7}r‚(h9]rƒh;]r„h=]r…h?]r†hahA]r‡hauhCKnhDhh)]rˆ(hF)r‰}rŠ(h.XMocking Classesr‹h/j€h0h3h5hJh7}rŒ(h9]rh;]rŽh=]rh?]rhA]r‘uhCKnhDhh)]r’hRXMocking Classesr“…r”}r•(h.j‹h/j‰ubaubhÀ)r–}r—(h.XA common use case is to mock out classes instantiated by your code under test. When you patch a class, then that class is replaced with a mock. Instances are created by *calling the class*. This means you access the "mock instance" by looking at the return value of the mocked class.r˜h/j€h0h3h5hÄh7}r™(h9]ršh;]r›h=]rœh?]rhA]ržuhCKphDhh)]rŸ(hRX©A common use case is to mock out classes instantiated by your code under test. When you patch a class, then that class is replaced with a mock. Instances are created by r …r¡}r¢(h.X©A common use case is to mock out classes instantiated by your code under test. When you patch a class, then that class is replaced with a mock. Instances are created by r£h/j–ubcdocutils.nodes emphasis r¤)r¥}r¦(h.X*calling the class*r§h7}r¨(h9]r©h;]rªh=]r«h?]r¬hA]r­uh/j–h)]r®hRXcalling the classr¯…r°}r±(h.Uh/j¥ubah5Uemphasisr²ubhRX_. This means you access the "mock instance" by looking at the return value of the mocked class.r³…r´}rµ(h.X_. This means you access the "mock instance" by looking at the return value of the mocked class.r¶h/j–ubeubhÀ)r·}r¸(h.XIn the example below we have a function `some_function` that instantiates `Foo` and calls a method on it. The call to `patch` replaces the class `Foo` with a mock. The `Foo` instance is the result of calling the mock, so it is configured by modifying the mock :attr:`~Mock.return_value`.r¹h/j€h0h3h5hÄh7}rº(h9]r»h;]r¼h=]r½h?]r¾hA]r¿uhCKuhDhh)]rÀ(hRX(In the example below we have a function rÁ…rÂ}rÃ(h.X(In the example below we have a function rÄh/j·ubjf)rÅ}rÆ(h.X`some_function`rÇh7}rÈ(h9]rÉh;]rÊh=]rËh?]rÌhA]rÍuh/j·h)]rÎhRX some_functionrÏ…rÐ}rÑ(h.Uh/jÅubah5jtubhRX that instantiates rÒ…rÓ}rÔ(h.X that instantiates rÕh/j·ubjf)rÖ}r×(h.X`Foo`rØh7}rÙ(h9]rÚh;]rÛh=]rÜh?]rÝhA]rÞuh/j·h)]rßhRXFoorà…rá}râ(h.Uh/jÖubah5jtubhRX' and calls a method on it. The call to rã…rä}rå(h.X' and calls a method on it. The call to ræh/j·ubjf)rç}rè(h.X`patch`réh7}rê(h9]rëh;]rìh=]ríh?]rîhA]rïuh/j·h)]rðhRXpatchrñ…rò}ró(h.Uh/jçubah5jtubhRX replaces the class rô…rõ}rö(h.X replaces the class r÷h/j·ubjf)rø}rù(h.X`Foo`rúh7}rû(h9]rüh;]rýh=]rþh?]rÿhA]ruh/j·h)]rhRXFoor…r}r(h.Uh/jøubah5jtubhRX with a mock. The r…r}r(h.X with a mock. The rh/j·ubjf)r }r (h.X`Foo`r h7}r (h9]r h;]rh=]rh?]rhA]ruh/j·h)]rhRXFoor…r}r(h.Uh/j ubah5jtubhRXW instance is the result of calling the mock, so it is configured by modifying the mock r…r}r(h.XW instance is the result of calling the mock, so it is configured by modifying the mock rh/j·ubhÐ)r}r(h.X:attr:`~Mock.return_value`rh/j·h0h3h5hÔh7}r(UreftyperXattrrh؉hÙXMock.return_valuer U refdomainr!Xpyr"h?]r#h=]r$U refexplicitr%‰h9]r&h;]r'hA]r(hãhähåNhæNuhCKuh)]r)hè)r*}r+(h.jh7}r,(h9]r-h;]r.(hîj"Xpy-attrr/eh=]r0h?]r1hA]r2uh/jh)]r3hRX return_valuer4…r5}r6(h.Uh/j*ubah5h÷ubaubhRX.…r7}r8(h.X.h/j·ubeubjD)r9}r:(h.X#>>> def some_function(): ... instance = module.Foo() ... return instance.method() ... >>> with patch('module.Foo') as mock: ... instance = mock.return_value ... instance.method.return_value = 'the result' ... result = some_function() ... assert result == 'the result'r;h/j€h0h3h5jHh7}r<(U testnodetyper=Xdoctestr>h„h…h?]r?h=]r@h9]rAh;]rBhA]rCUgroupsrD]rEhahŽ}rFuhCKzhDhh)]rGhRX#>>> def some_function(): ... instance = module.Foo() ... return instance.method() ... >>> with patch('module.Foo') as mock: ... instance = mock.return_value ... instance.method.return_value = 'the result' ... result = some_function() ... assert result == 'the result'rH…rI}rJ(h.Uh/j9ubaubeubh+)rK}rL(h.Uh/h”h0h3h5h6h7}rM(h9]rNh;]rOh=]rPh?]rQh%ahA]rRhauhCKˆhDhh)]rS(hF)rT}rU(h.XNaming your mocksrVh/jKh0h3h5hJh7}rW(h9]rXh;]rYh=]rZh?]r[hA]r\uhCKˆhDhh)]r]hRXNaming your mocksr^…r_}r`(h.jVh/jTubaubhÀ)ra}rb(h.XÚIt can be useful to give your mocks a name. The name is shown in the repr of the mock and can be helpful when the mock appears in test failure messages. The name is also propagated to attributes or methods of the mock:rch/jKh0h3h5hÄh7}rd(h9]reh;]rfh=]rgh?]rhhA]riuhCKŠhDhh)]rjhRXÚIt can be useful to give your mocks a name. The name is shown in the repr of the mock and can be helpful when the mock appears in test failure messages. The name is also propagated to attributes or methods of the mock:rk…rl}rm(h.jch/jaubaubjD)rn}ro(h.X€>>> mock = MagicMock(name='foo') >>> mock >>> mock.method rph/jKh0h3h5jHh7}rq(U testnodetyperrXdoctestrsh„h…h?]rth=]ruh9]rvh;]rwhA]rxUgroupsry]rzhahŽ}r{uhCKŽhDhh)]r|hRX€>>> mock = MagicMock(name='foo') >>> mock >>> mock.method r}…r~}r(h.Uh/jnubaubeubh+)r€}r(h.Uh/h”h0h3h5h6h7}r‚(h9]rƒh;]r„h=]r…h?]r†h$ahA]r‡hauhCK˜hDhh)]rˆ(hF)r‰}rŠ(h.XTracking all Callsr‹h/j€h0h3h5hJh7}rŒ(h9]rh;]rŽh=]rh?]rhA]r‘uhCK˜hDhh)]r’hRXTracking all Callsr“…r”}r•(h.j‹h/j‰ubaubhÀ)r–}r—(h.X³Often you want to track more than a single call to a method. The :attr:`~Mock.mock_calls` attribute records all calls to child attributes of the mock - and also to their children.r˜h/j€h0h3h5hÄh7}r™(h9]ršh;]r›h=]rœh?]rhA]ržuhCKšhDhh)]rŸ(hRXAOften you want to track more than a single call to a method. The r …r¡}r¢(h.XAOften you want to track more than a single call to a method. The r£h/j–ubhÐ)r¤}r¥(h.X:attr:`~Mock.mock_calls`r¦h/j–h0h3h5hÔh7}r§(Ureftyper¨Xattrr©h؉hÙXMock.mock_callsrªU refdomainr«Xpyr¬h?]r­h=]r®U refexplicitr¯‰h9]r°h;]r±hA]r²hãhähåNhæNuhCKšh)]r³hè)r´}rµ(h.j¦h7}r¶(h9]r·h;]r¸(hîj¬Xpy-attrr¹eh=]rºh?]r»hA]r¼uh/j¤h)]r½hRX mock_callsr¾…r¿}rÀ(h.Uh/j´ubah5h÷ubaubhRXZ attribute records all calls to child attributes of the mock - and also to their children.rÁ…rÂ}rÃ(h.XZ attribute records all calls to child attributes of the mock - and also to their children.rÄh/j–ubeubjD)rÅ}rÆ(h.Xï>>> mock = MagicMock() >>> mock.method() >>> mock.attribute.method(10, x=53) >>> mock.mock_calls [call.method(), call.attribute.method(10, x=53)]rÇh/j€h0h3h5jHh7}rÈ(U testnodetyperÉXdoctestrÊh„h…h?]rËh=]rÌh9]rÍh;]rÎhA]rÏUgroupsrÐ]rÑhahŽ}rÒuhCKžhDhh)]rÓhRXï>>> mock = MagicMock() >>> mock.method() >>> mock.attribute.method(10, x=53) >>> mock.mock_calls [call.method(), call.attribute.method(10, x=53)]rÔ…rÕ}rÖ(h.Uh/jÅubaubhÀ)r×}rØ(h.X)If you make an assertion about `mock_calls` and any unexpected methods have been called, then the assertion will fail. This is useful because as well as asserting that the calls you expected have been made, you are also checking that they were made in the right order and with no additional calls:rÙh/j€h0h3h5hÄh7}rÚ(h9]rÛh;]rÜh=]rÝh?]rÞhA]rßuhCK¨hDhh)]rà(hRXIf you make an assertion about rá…râ}rã(h.XIf you make an assertion about räh/j×ubjf)rå}ræ(h.X `mock_calls`rçh7}rè(h9]réh;]rêh=]rëh?]rìhA]ríuh/j×h)]rîhRX mock_callsrï…rð}rñ(h.Uh/jåubah5jtubhRXþ and any unexpected methods have been called, then the assertion will fail. This is useful because as well as asserting that the calls you expected have been made, you are also checking that they were made in the right order and with no additional calls:rò…ró}rô(h.Xþ and any unexpected methods have been called, then the assertion will fail. This is useful because as well as asserting that the calls you expected have been made, you are also checking that they were made in the right order and with no additional calls:rõh/j×ubeubhÀ)rö}r÷(h.XSYou use the :data:`call` object to construct lists for comparing with `mock_calls`:røh/j€h0h3h5hÄh7}rù(h9]rúh;]rûh=]rüh?]rýhA]rþuhCK­hDhh)]rÿ(hRX You use the r…r}r(h.X You use the rh/jöubhÐ)r}r(h.X :data:`call`rh/jöh0h3h5hÔh7}r(UreftyperXdatar h؉hÙXcallr U refdomainr Xpyr h?]r h=]rU refexplicitr‰h9]rh;]rhA]rhãhähåNhæNuhCK­h)]rhè)r}r(h.jh7}r(h9]rh;]r(hîj Xpy-datareh=]rh?]rhA]ruh/jh)]rhRXcallr…r}r (h.Uh/jubah5h÷ubaubhRX. object to construct lists for comparing with r!…r"}r#(h.X. object to construct lists for comparing with r$h/jöubjf)r%}r&(h.X `mock_calls`r'h7}r((h9]r)h;]r*h=]r+h?]r,hA]r-uh/jöh)]r.hRX mock_callsr/…r0}r1(h.Uh/j%ubah5jtubhRX:…r2}r3(h.X:h/jöubeubjD)r4}r5(h.Xd>>> expected = [call.method(), call.attribute.method(10, x=53)] >>> mock.mock_calls == expected Truer6h/j€h0h3h5jHh7}r7(U testnodetyper8Xdoctestr9h„h…h?]r:h=]r;h9]r<h;]r=hA]r>Ugroupsr?]r@hahŽ}rAuhCK°hDhh)]rBhRXd>>> expected = [call.method(), call.attribute.method(10, x=53)] >>> mock.mock_calls == expected TruerC…rD}rE(h.Uh/j4ubaubeubh+)rF}rG(h.Uh/h”h0h3h5h6h7}rH(h9]rIh;]rJh=]rKh?]rLh&ahA]rMhauhCK¸hDhh)]rN(hF)rO}rP(h.X$Setting Return Values and AttributesrQh/jFh0h3h5hJh7}rR(h9]rSh;]rTh=]rUh?]rVhA]rWuhCK¸hDhh)]rXhRX$Setting Return Values and AttributesrY…rZ}r[(h.jQh/jOubaubhÀ)r\}r](h.X=Setting the return values on a mock object is trivially easy:r^h/jFh0h3h5hÄh7}r_(h9]r`h;]rah=]rbh?]rchA]rduhCKºhDhh)]rehRX=Setting the return values on a mock object is trivially easy:rf…rg}rh(h.j^h/j\ubaubjD)ri}rj(h.X8>>> mock = Mock() >>> mock.return_value = 3 >>> mock() 3rkh/jFh0h3h5jHh7}rl(U testnodetypermXdoctestrnh„h…h?]roh=]rph9]rqh;]rrhA]rsUgroupsrt]ruhahŽ}rvuhCK¼hDhh)]rwhRX8>>> mock = Mock() >>> mock.return_value = 3 >>> mock() 3rx…ry}rz(h.Uh/jiubaubhÀ)r{}r|(h.X6Of course you can do the same for methods on the mock:r}h/jFh0h3h5hÄh7}r~(h9]rh;]r€h=]rh?]r‚hA]rƒuhCKÃhDhh)]r„hRX6Of course you can do the same for methods on the mock:r……r†}r‡(h.j}h/j{ubaubjD)rˆ}r‰(h.XF>>> mock = Mock() >>> mock.method.return_value = 3 >>> mock.method() 3rŠh/jFh0h3h5jHh7}r‹(U testnodetyperŒXdoctestrh„h…h?]rŽh=]rh9]rh;]r‘hA]r’Ugroupsr“]r”hahŽ}r•uhCKÅhDhh)]r–hRXF>>> mock = Mock() >>> mock.method.return_value = 3 >>> mock.method() 3r—…r˜}r™(h.Uh/jˆubaubhÀ)rš}r›(h.X4The return value can also be set in the constructor:rœh/jFh0h3h5hÄh7}r(h9]ržh;]rŸh=]r h?]r¡hA]r¢uhCKÌhDhh)]r£hRX4The return value can also be set in the constructor:r¤…r¥}r¦(h.jœh/jšubaubjD)r§}r¨(h.X,>>> mock = Mock(return_value=3) >>> mock() 3r©h/jFh0h3h5jHh7}rª(U testnodetyper«Xdoctestr¬h„h…h?]r­h=]r®h9]r¯h;]r°hA]r±Ugroupsr²]r³hahŽ}r´uhCKÎhDhh)]rµhRX,>>> mock = Mock(return_value=3) >>> mock() 3r¶…r·}r¸(h.Uh/j§ubaubhÀ)r¹}rº(h.X:If you need an attribute setting on your mock, just do it:r»h/jFh0h3h5hÄh7}r¼(h9]r½h;]r¾h=]r¿h?]rÀhA]rÁuhCKÔhDhh)]rÂhRX:If you need an attribute setting on your mock, just do it:rÃ…rÄ}rÅ(h.j»h/j¹ubaubjD)rÆ}rÇ(h.X->>> mock = Mock() >>> mock.x = 3 >>> mock.x 3rÈh/jFh0h3h5jHh7}rÉ(U testnodetyperÊXdoctestrËh„h…h?]rÌh=]rÍh9]rÎh;]rÏhA]rÐUgroupsrÑ]rÒhahŽ}rÓuhCKÖhDhh)]rÔhRX->>> mock = Mock() >>> mock.x = 3 >>> mock.x 3rÕ…rÖ}r×(h.Uh/jÆubaubhÀ)rØ}rÙ(h.XÚSometimes you want to mock up a more complex situation, like for example `mock.connection.cursor().execute("SELECT 1")`. If we wanted this call to return a list, then we have to configure the result of the nested call.rÚh/jFh0h3h5hÄh7}rÛ(h9]rÜh;]rÝh=]rÞh?]rßhA]ràuhCKÝhDhh)]rá(hRXISometimes you want to mock up a more complex situation, like for example râ…rã}rä(h.XISometimes you want to mock up a more complex situation, like for example råh/jØubjf)ræ}rç(h.X.`mock.connection.cursor().execute("SELECT 1")`rèh7}ré(h9]rêh;]rëh=]rìh?]ríhA]rîuh/jØh)]rïhRX,mock.connection.cursor().execute("SELECT 1")rð…rñ}rò(h.Uh/jæubah5jtubhRXc. If we wanted this call to return a list, then we have to configure the result of the nested call.ró…rô}rõ(h.Xc. If we wanted this call to return a list, then we have to configure the result of the nested call.röh/jØubeubhÀ)r÷}rø(h.XrWe can use :data:`call` to construct the set of calls in a "chained call" like this for easy assertion afterwards:rùh/jFh0h3h5hÄh7}rú(h9]rûh;]rüh=]rýh?]rþhA]rÿuhCKáhDhh)]r(hRX We can use r…r}r(h.X We can use rh/j÷ubhÐ)r}r(h.X :data:`call`rh/j÷h0h3h5hÔh7}r(Ureftyper Xdatar h؉hÙXcallr U refdomainr Xpyr h?]rh=]rU refexplicitr‰h9]rh;]rhA]rhãhähåNhæNuhCKáh)]rhè)r}r(h.jh7}r(h9]rh;]r(hîj Xpy-datareh=]rh?]rhA]ruh/jh)]rhRXcallr…r }r!(h.Uh/jubah5h÷ubaubhRX[ to construct the set of calls in a "chained call" like this for easy assertion afterwards:r"…r#}r$(h.X[ to construct the set of calls in a "chained call" like this for easy assertion afterwards:r%h/j÷ubeubjD)r&}r'(h.Xo>>> mock = Mock() >>> cursor = mock.connection.cursor.return_value >>> cursor.execute.return_value = ['foo'] >>> mock.connection.cursor().execute("SELECT 1") ['foo'] >>> expected = call.connection.cursor().execute("SELECT 1").call_list() >>> mock.mock_calls [call.connection.cursor(), call.connection.cursor().execute('SELECT 1')] >>> mock.mock_calls == expected Truer(h/jFh0h3h5jHh7}r)(U testnodetyper*Xdoctestr+h„h…h?]r,h=]r-h9]r.h;]r/hA]r0Ugroupsr1]r2hahŽ}r3uhCKåhDhh)]r4hRXo>>> mock = Mock() >>> cursor = mock.connection.cursor.return_value >>> cursor.execute.return_value = ['foo'] >>> mock.connection.cursor().execute("SELECT 1") ['foo'] >>> expected = call.connection.cursor().execute("SELECT 1").call_list() >>> mock.mock_calls [call.connection.cursor(), call.connection.cursor().execute('SELECT 1')] >>> mock.mock_calls == expected Truer5…r6}r7(h.Uh/j&ubaubhÀ)r8}r9(h.XpIt is the call to `.call_list()` that turns our call object into a list of calls representing the chained calls.r:h/jFh0h3h5hÄh7}r;(h9]r<h;]r=h=]r>h?]r?hA]r@uhCKòhDhh)]rA(hRXIt is the call to rB…rC}rD(h.XIt is the call to rEh/j8ubjf)rF}rG(h.X`.call_list()`rHh7}rI(h9]rJh;]rKh=]rLh?]rMhA]rNuh/j8h)]rOhRX .call_list()rP…rQ}rR(h.Uh/jFubah5jtubhRXP that turns our call object into a list of calls representing the chained calls.rS…rT}rU(h.XP that turns our call object into a list of calls representing the chained calls.rVh/j8ubeubeubh+)rW}rX(h.Uh/h”h0h3h5h6h7}rY(h9]rZh;]r[h=]r\h?]r]h(ahA]r^hauhCKøhDhh)]r_(hF)r`}ra(h.XRaising exceptions with mocksrbh/jWh0h3h5hJh7}rc(h9]rdh;]reh=]rfh?]rghA]rhuhCKøhDhh)]rihRXRaising exceptions with mocksrj…rk}rl(h.jbh/j`ubaubhÀ)rm}rn(h.XA useful attribute is :attr:`~Mock.side_effect`. If you set this to an exception class or instance then the exception will be raised when the mock is called.roh/jWh0h3h5hÄh7}rp(h9]rqh;]rrh=]rsh?]rthA]ruuhCKúhDhh)]rv(hRXA useful attribute is rw…rx}ry(h.XA useful attribute is rzh/jmubhÐ)r{}r|(h.X:attr:`~Mock.side_effect`r}h/jmh0h3h5hÔh7}r~(UreftyperXattrr€h؉hÙXMock.side_effectrU refdomainr‚Xpyrƒh?]r„h=]r…U refexplicitr†‰h9]r‡h;]rˆhA]r‰hãhähåNhæNuhCKúh)]rŠhè)r‹}rŒ(h.j}h7}r(h9]rŽh;]r(hîjƒXpy-attrreh=]r‘h?]r’hA]r“uh/j{h)]r”hRX side_effectr•…r–}r—(h.Uh/j‹ubah5h÷ubaubhRXn. If you set this to an exception class or instance then the exception will be raised when the mock is called.r˜…r™}rš(h.Xn. If you set this to an exception class or instance then the exception will be raised when the mock is called.r›h/jmubeubjD)rœ}r(h.Xt>>> mock = Mock(side_effect=Exception('Boom!')) >>> mock() Traceback (most recent call last): ... Exception: Boom!ržh/jWh0h3h5jHh7}rŸ(U testnodetyper Xdoctestr¡h„h…h?]r¢h=]r£h9]r¤h;]r¥hA]r¦Ugroupsr§]r¨hahŽ}r©uhCKþhDhh)]rªhRXt>>> mock = Mock(side_effect=Exception('Boom!')) >>> mock() Traceback (most recent call last): ... Exception: Boom!r«…r¬}r­(h.Uh/jœubaubeubh+)r®}r¯(h.Uh/h”h0h3h5h6h7}r°(h9]r±h;]r²h=]r³h?]r´hahA]rµh auhCMhDhh)]r¶(hF)r·}r¸(h.X#Side effect functions and iterablesr¹h/j®h0h3h5hJh7}rº(h9]r»h;]r¼h=]r½h?]r¾hA]r¿uhCMhDhh)]rÀhRX#Side effect functions and iterablesrÁ…rÂ}rÃ(h.j¹h/j·ubaubhÀ)rÄ}rÅ(h.X@`side_effect` can also be set to a function or an iterable. The use case for `side_effect` as an iterable is where your mock is going to be called several times, and you want each call to return a different value. When you set `side_effect` to an iterable every call to the mock returns the next value from the iterable:rÆh/j®h0h3h5hÄh7}rÇ(h9]rÈh;]rÉh=]rÊh?]rËhA]rÌuhCM hDhh)]rÍ(jf)rÎ}rÏ(h.X `side_effect`rÐh7}rÑ(h9]rÒh;]rÓh=]rÔh?]rÕhA]rÖuh/jÄh)]r×hRX side_effectrØ…rÙ}rÚ(h.Uh/jÎubah5jtubhRX@ can also be set to a function or an iterable. The use case for rÛ…rÜ}rÝ(h.X@ can also be set to a function or an iterable. The use case for rÞh/jÄubjf)rß}rà(h.X `side_effect`ráh7}râ(h9]rãh;]räh=]råh?]ræhA]rçuh/jÄh)]rèhRX side_effectré…rê}rë(h.Uh/jßubah5jtubhRX‰ as an iterable is where your mock is going to be called several times, and you want each call to return a different value. When you set rì…rí}rî(h.X‰ as an iterable is where your mock is going to be called several times, and you want each call to return a different value. When you set rïh/jÄubjf)rð}rñ(h.X `side_effect`ròh7}ró(h9]rôh;]rõh=]röh?]r÷hA]røuh/jÄh)]rùhRX side_effectrú…rû}rü(h.Uh/jðubah5jtubhRXP to an iterable every call to the mock returns the next value from the iterable:rý…rþ}rÿ(h.XP to an iterable every call to the mock returns the next value from the iterable:rh/jÄubeubjD)r}r(h.XR>>> mock = MagicMock(side_effect=[4, 5, 6]) >>> mock() 4 >>> mock() 5 >>> mock() 6rh/j®h0h3h5jHh7}r(U testnodetyperXdoctestrh„h…h?]rh=]rh9]r h;]r hA]r Ugroupsr ]r hahŽ}ruhCMhDhh)]rhRXR>>> mock = MagicMock(side_effect=[4, 5, 6]) >>> mock() 4 >>> mock() 5 >>> mock() 6r…r}r(h.Uh/jubaubhÀ)r}r(h.X For more advanced use cases, like dynamically varying the return values depending on what the mock is called with, `side_effect` can be a function. The function will be called with the same arguments as the mock. Whatever the function returns is what the call returns:rh/j®h0h3h5hÄh7}r(h9]rh;]rh=]rh?]rhA]ruhCMhDhh)]r(hRXsFor more advanced use cases, like dynamically varying the return values depending on what the mock is called with, r…r}r(h.XsFor more advanced use cases, like dynamically varying the return values depending on what the mock is called with, r h/jubjf)r!}r"(h.X `side_effect`r#h7}r$(h9]r%h;]r&h=]r'h?]r(hA]r)uh/jh)]r*hRX side_effectr+…r,}r-(h.Uh/j!ubah5jtubhRXŒ can be a function. The function will be called with the same arguments as the mock. Whatever the function returns is what the call returns:r.…r/}r0(h.XŒ can be a function. The function will be called with the same arguments as the mock. Whatever the function returns is what the call returns:r1h/jubeubjD)r2}r3(h.X«>>> vals = {(1, 2): 1, (2, 3): 2} >>> def side_effect(*args): ... return vals[args] ... >>> mock = MagicMock(side_effect=side_effect) >>> mock(1, 2) 1 >>> mock(2, 3) 2r4h/j®h0h3h5jHh7}r5(U testnodetyper6Xdoctestr7h„h…h?]r8h=]r9h9]r:h;]r;hA]r<Ugroupsr=]r>hahŽ}r?uhCM hDhh)]r@hRX«>>> vals = {(1, 2): 1, (2, 3): 2} >>> def side_effect(*args): ... return vals[args] ... >>> mock = MagicMock(side_effect=side_effect) >>> mock(1, 2) 1 >>> mock(2, 3) 2rA…rB}rC(h.Uh/j2ubaubeubh+)rD}rE(h.Uh/h”h0h3h5h6h7}rF(h9]rGh;]rHh=]rIh?]rJh'ahA]rKhauhCM.hDhh)]rL(hF)rM}rN(h.X'Creating a Mock from an Existing ObjectrOh/jDh0h3h5hJh7}rP(h9]rQh;]rRh=]rSh?]rThA]rUuhCM.hDhh)]rVhRX'Creating a Mock from an Existing ObjectrW…rX}rY(h.jOh/jMubaubhÀ)rZ}r[(h.X¸One problem with over use of mocking is that it couples your tests to the implementation of your mocks rather than your real code. Suppose you have a class that implements `some_method`. In a test for another class, you provide a mock of this object that *also* provides `some_method`. If later you refactor the first class, so that it no longer has `some_method` - then your tests will continue to pass even though your code is now broken!r\h/jDh0h3h5hÄh7}r](h9]r^h;]r_h=]r`h?]rahA]rbuhCM0hDhh)]rc(hRX¬One problem with over use of mocking is that it couples your tests to the implementation of your mocks rather than your real code. Suppose you have a class that implements rd…re}rf(h.X¬One problem with over use of mocking is that it couples your tests to the implementation of your mocks rather than your real code. Suppose you have a class that implements rgh/jZubjf)rh}ri(h.X `some_method`rjh7}rk(h9]rlh;]rmh=]rnh?]rohA]rpuh/jZh)]rqhRX some_methodrr…rs}rt(h.Uh/jhubah5jtubhRXF. In a test for another class, you provide a mock of this object that ru…rv}rw(h.XF. In a test for another class, you provide a mock of this object that rxh/jZubj¤)ry}rz(h.X*also*r{h7}r|(h9]r}h;]r~h=]rh?]r€hA]ruh/jZh)]r‚hRXalsorƒ…r„}r…(h.Uh/jyubah5j²ubhRX provides r†…r‡}rˆ(h.X provides r‰h/jZubjf)rŠ}r‹(h.X `some_method`rŒh7}r(h9]rŽh;]rh=]rh?]r‘hA]r’uh/jZh)]r“hRX some_methodr”…r•}r–(h.Uh/jŠubah5jtubhRXB. If later you refactor the first class, so that it no longer has r—…r˜}r™(h.XB. If later you refactor the first class, so that it no longer has ršh/jZubjf)r›}rœ(h.X `some_method`rh7}rž(h9]rŸh;]r h=]r¡h?]r¢hA]r£uh/jZh)]r¤hRX some_methodr¥…r¦}r§(h.Uh/j›ubah5jtubhRXM - then your tests will continue to pass even though your code is now broken!r¨…r©}rª(h.XM - then your tests will continue to pass even though your code is now broken!r«h/jZubeubhÀ)r¬}r­(h.X `Mock` allows you to provide an object as a specification for the mock, using the `spec` keyword argument. Accessing methods / attributes on the mock that don't exist on your specification object will immediately raise an attribute error. If you change the implementation of your specification, then tests that use that class will start failing immediately without you having to instantiate the class in those tests.r®h/jDh0h3h5hÄh7}r¯(h9]r°h;]r±h=]r²h?]r³hA]r´uhCM7hDhh)]rµ(jf)r¶}r·(h.X`Mock`r¸h7}r¹(h9]rºh;]r»h=]r¼h?]r½hA]r¾uh/j¬h)]r¿hRXMockrÀ…rÁ}rÂ(h.Uh/j¶ubah5jtubhRXL allows you to provide an object as a specification for the mock, using the rÃ…rÄ}rÅ(h.XL allows you to provide an object as a specification for the mock, using the rÆh/j¬ubjf)rÇ}rÈ(h.X`spec`rÉh7}rÊ(h9]rËh;]rÌh=]rÍh?]rÎhA]rÏuh/j¬h)]rÐhRXspecrÑ…rÒ}rÓ(h.Uh/jÇubah5jtubhRXH keyword argument. Accessing methods / attributes on the mock that don't exist on your specification object will immediately raise an attribute error. If you change the implementation of your specification, then tests that use that class will start failing immediately without you having to instantiate the class in those tests.rÔ…rÕ}rÖ(h.XH keyword argument. Accessing methods / attributes on the mock that don't exist on your specification object will immediately raise an attribute error. If you change the implementation of your specification, then tests that use that class will start failing immediately without you having to instantiate the class in those tests.r×h/j¬ubeubjD)rØ}rÙ(h.X”>>> mock = Mock(spec=SomeClass) >>> mock.old_method() Traceback (most recent call last): ... AttributeError: object has no attribute 'old_method'rÚh/jDh0h3h5jHh7}rÛ(U testnodetyperÜXdoctestrÝh„h…h?]rÞh=]rßh9]ràh;]ráhA]râUgroupsrã]rähahŽ}råuhCM>hDhh)]ræhRX”>>> mock = Mock(spec=SomeClass) >>> mock.old_method() Traceback (most recent call last): ... AttributeError: object has no attribute 'old_method'rç…rè}ré(h.Uh/jØubaubhÀ)rê}rë(h.X¬If you want a stronger form of specification that prevents the setting of arbitrary attributes as well as the getting of them then you can use `spec_set` instead of `spec`.rìh/jDh0h3h5hÄh7}rí(h9]rîh;]rïh=]rðh?]rñhA]ròuhCMFhDhh)]ró(hRXIf you want a stronger form of specification that prevents the setting of arbitrary attributes as well as the getting of them then you can use rô…rõ}rö(h.XIf you want a stronger form of specification that prevents the setting of arbitrary attributes as well as the getting of them then you can use r÷h/jêubjf)rø}rù(h.X `spec_set`rúh7}rû(h9]rüh;]rýh=]rþh?]rÿhA]ruh/jêh)]rhRXspec_setr…r}r(h.Uh/jøubah5jtubhRX instead of r…r}r(h.X instead of rh/jêubjf)r }r (h.X`spec`r h7}r (h9]r h;]rh=]rh?]rhA]ruh/jêh)]rhRXspecr…r}r(h.Uh/j ubah5jtubhRX.…r}r(h.X.h/jêubeubeubeubh+)r}r(h.Uh/h,h0h3h5h6h7}r(h9]rh;]rh=]rh?]rh!ahA]rh auhCMMhDhh)]r (hF)r!}r"(h.XPatch Decoratorsr#h/jh0h3h5hJh7}r$(h9]r%h;]r&h=]r'h?]r(hA]r)uhCMMhDhh)]r*hRXPatch Decoratorsr+…r,}r-(h.j#h/j!ubaubjy)r.}r/(h.X¾With `patch` it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read :ref:`where to patch `.r0h/jh0h3h5j}h7}r1(h9]r2h;]r3h=]r4h?]r5hA]r6uhCNhDhh)]r7hÀ)r8}r9(h.X¾With `patch` it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read :ref:`where to patch `.r:h/j.h0h3h5hÄh7}r;(h9]r<h;]r=h=]r>h?]r?hA]r@uhCMQh)]rA(hRXWith rB…rC}rD(h.XWith rEh/j8ubjf)rF}rG(h.X`patch`rHh7}rI(h9]rJh;]rKh=]rLh?]rMhA]rNuh/j8h)]rOhRXpatchrP…rQ}rR(h.Uh/jFubah5jtubhRX‹ it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read rS…rT}rU(h.X‹ it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read rVh/j8ubhÐ)rW}rX(h.X&:ref:`where to patch `rYh/j8h0h3h5hÔh7}rZ(Ureftyper[Xrefr\h؈hÙXwhere-to-patchr]U refdomainr^Xstdr_h?]r`h=]raU refexplicitrbˆh9]rch;]rdhA]rehãhäuhCMQh)]rfj¤)rg}rh(h.jYh7}ri(h9]rjh;]rk(hîj_Xstd-refrleh=]rmh?]rnhA]rouh/jWh)]rphRXwhere to patchrq…rr}rs(h.Uh/jgubah5j²ubaubhRX.…rt}ru(h.X.h/j8ubeubaubhÀ)rv}rw(h.X[A common need in tests is to patch a class attribute or a module attribute, for example patching a builtin or patching a class in a module to test that it is instantiated. Modules and classes are effectively global, so patching on them has to be undone after the test or the patch will persist into other tests and cause hard to diagnose problems.rxh/jh0h3h5hÄh7}ry(h9]rzh;]r{h=]r|h?]r}hA]r~uhCMVhDhh)]rhRX[A common need in tests is to patch a class attribute or a module attribute, for example patching a builtin or patching a class in a module to test that it is instantiated. Modules and classes are effectively global, so patching on them has to be undone after the test or the patch will persist into other tests and cause hard to diagnose problems.r€…r}r‚(h.jxh/jvubaubhÀ)rƒ}r„(h.X¾mock provides three convenient decorators for this: `patch`, `patch.object` and `patch.dict`. `patch` takes a single string, of the form `package.module.Class.attribute` to specify the attribute you are patching. It also optionally takes a value that you want the attribute (or class or whatever) to be replaced with. 'patch.object' takes an object and the name of the attribute you would like patched, plus optionally the value to patch it with.r…h/jh0h3h5hÄh7}r†(h9]r‡h;]rˆh=]r‰h?]rŠhA]r‹uhCM\hDhh)]rŒ(hRX4mock provides three convenient decorators for this: r…rŽ}r(h.X4mock provides three convenient decorators for this: rh/jƒubjf)r‘}r’(h.X`patch`r“h7}r”(h9]r•h;]r–h=]r—h?]r˜hA]r™uh/jƒh)]ršhRXpatchr›…rœ}r(h.Uh/j‘ubah5jtubhRX, rž…rŸ}r (h.X, r¡h/jƒubjf)r¢}r£(h.X`patch.object`r¤h7}r¥(h9]r¦h;]r§h=]r¨h?]r©hA]rªuh/jƒh)]r«hRX patch.objectr¬…r­}r®(h.Uh/j¢ubah5jtubhRX and r¯…r°}r±(h.X and r²h/jƒubjf)r³}r´(h.X `patch.dict`rµh7}r¶(h9]r·h;]r¸h=]r¹h?]rºhA]r»uh/jƒh)]r¼hRX patch.dictr½…r¾}r¿(h.Uh/j³ubah5jtubhRX. rÀ…rÁ}rÂ(h.X. rÃh/jƒubjf)rÄ}rÅ(h.X`patch`rÆh7}rÇ(h9]rÈh;]rÉh=]rÊh?]rËhA]rÌuh/jƒh)]rÍhRXpatchrÎ…rÏ}rÐ(h.Uh/jÄubah5jtubhRX$ takes a single string, of the form rÑ…rÒ}rÓ(h.X$ takes a single string, of the form rÔh/jƒubjf)rÕ}rÖ(h.X `package.module.Class.attribute`r×h7}rØ(h9]rÙh;]rÚh=]rÛh?]rÜhA]rÝuh/jƒh)]rÞhRXpackage.module.Class.attributerß…rà}rá(h.Uh/jÕubah5jtubhRX to specify the attribute you are patching. It also optionally takes a value that you want the attribute (or class or whatever) to be replaced with. 'patch.object' takes an object and the name of the attribute you would like patched, plus optionally the value to patch it with.râ…rã}rä(h.X to specify the attribute you are patching. It also optionally takes a value that you want the attribute (or class or whatever) to be replaced with. 'patch.object' takes an object and the name of the attribute you would like patched, plus optionally the value to patch it with.råh/jƒubeubhÀ)ræ}rç(h.X`patch.object`:rèh/jh0h3h5hÄh7}ré(h9]rêh;]rëh=]rìh?]ríhA]rîuhCMdhDhh)]rï(jf)rð}rñ(h.X`patch.object`ròh7}ró(h9]rôh;]rõh=]röh?]r÷hA]røuh/jæh)]rùhRX patch.objectrú…rû}rü(h.Uh/jðubah5jtubhRX:…rý}rþ(h.X:h/jæubeubjD)rÿ}r (h.Xš>>> original = SomeClass.attribute >>> @patch.object(SomeClass, 'attribute', sentinel.attribute) ... def test(): ... assert SomeClass.attribute == sentinel.attribute ... >>> test() >>> assert SomeClass.attribute == original >>> @patch('package.module.attribute', sentinel.attribute) ... def test(): ... from package.module import attribute ... assert attribute is sentinel.attribute ... >>> test()r h/jh0h3h5jHh7}r (U testnodetyper Xdoctestr h„h…h?]r h=]r h9]r h;]r hA]r Ugroupsr ]r hahŽ}r uhCMfhDhh)]r hRXš>>> original = SomeClass.attribute >>> @patch.object(SomeClass, 'attribute', sentinel.attribute) ... def test(): ... assert SomeClass.attribute == sentinel.attribute ... >>> test() >>> assert SomeClass.attribute == original >>> @patch('package.module.attribute', sentinel.attribute) ... def test(): ... from package.module import attribute ... assert attribute is sentinel.attribute ... >>> test()r …r }r (h.Uh/jÿubaubhÀ)r }r (h.XbIf you are patching a module (including `__builtin__`) then use `patch` instead of `patch.object`:r h/jh0h3h5hÄh7}r (h9]r h;]r h=]r h?]r hA]r uhCMwhDhh)]r (hRX(If you are patching a module (including r …r }r (h.X(If you are patching a module (including r h/j ubjf)r }r (h.X `__builtin__`r! h7}r" (h9]r# h;]r$ h=]r% h?]r& hA]r' uh/j h)]r( hRX __builtin__r) …r* }r+ (h.Uh/j ubah5jtubhRX ) then use r, …r- }r. (h.X ) then use r/ h/j ubjf)r0 }r1 (h.X`patch`r2 h7}r3 (h9]r4 h;]r5 h=]r6 h?]r7 hA]r8 uh/j h)]r9 hRXpatchr: …r; }r< (h.Uh/j0 ubah5jtubhRX instead of r= …r> }r? (h.X instead of r@ h/j ubjf)rA }rB (h.X`patch.object`rC h7}rD (h9]rE h;]rF h=]rG h?]rH hA]rI uh/j h)]rJ hRX patch.objectrK …rL }rM (h.Uh/jA ubah5jtubhRX:…rN }rO (h.X:h/j ubeubjD)rP }rQ (h.X>>> mock = MagicMock(return_value = sentinel.file_handle) >>> with patch('__builtin__.open', mock): ... handle = open('filename', 'r') ... >>> mock.assert_called_with('filename', 'r') >>> assert handle == sentinel.file_handle, "incorrect file handle returned"rR h/jh0h3h5jHh7}rS (U testnodetyperT XdoctestrU h„h…h?]rV h=]rW h9]rX h;]rY hA]rZ Ugroupsr[ ]r\ hahŽ}r] uhCMzhDhh)]r^ hRX>>> mock = MagicMock(return_value = sentinel.file_handle) >>> with patch('__builtin__.open', mock): ... handle = open('filename', 'r') ... >>> mock.assert_called_with('filename', 'r') >>> assert handle == sentinel.file_handle, "incorrect file handle returned"r_ …r` }ra (h.Uh/jP ubaubhÀ)rb }rc (h.XHThe module name can be 'dotted', in the form `package.module` if needed:rd h/jh0h3h5hÄh7}re (h9]rf h;]rg h=]rh h?]ri hA]rj uhCMƒhDhh)]rk (hRX-The module name can be 'dotted', in the form rl …rm }rn (h.X-The module name can be 'dotted', in the form ro h/jb ubjf)rp }rq (h.X`package.module`rr h7}rs (h9]rt h;]ru h=]rv h?]rw hA]rx uh/jb h)]ry hRXpackage.modulerz …r{ }r| (h.Uh/jp ubah5jtubhRX if needed:r} …r~ }r (h.X if needed:r€ h/jb ubeubjD)r }r‚ (h.XÉ>>> @patch('package.module.ClassName.attribute', sentinel.attribute) ... def test(): ... from package.module import ClassName ... assert ClassName.attribute == sentinel.attribute ... >>> test()rƒ h/jh0h3h5jHh7}r„ (U testnodetyper… Xdoctestr† h„h…h?]r‡ h=]rˆ h9]r‰ h;]rŠ hA]r‹ UgroupsrŒ ]r hahŽ}rŽ uhCM…hDhh)]r hRXÉ>>> @patch('package.module.ClassName.attribute', sentinel.attribute) ... def test(): ... from package.module import ClassName ... assert ClassName.attribute == sentinel.attribute ... >>> test()r …r‘ }r’ (h.Uh/j ubaubhÀ)r“ }r” (h.X?A nice pattern is to actually decorate test methods themselves:r• h/jh0h3h5hÄh7}r– (h9]r— h;]r˜ h=]r™ h?]rš hA]r› uhCMŽhDhh)]rœ hRX?A nice pattern is to actually decorate test methods themselves:r …rž }rŸ (h.j• h/j“ ubaubjD)r  }r¡ (h.XO>>> class MyTest(unittest2.TestCase): ... @patch.object(SomeClass, 'attribute', sentinel.attribute) ... def test_something(self): ... self.assertEqual(SomeClass.attribute, sentinel.attribute) ... >>> original = SomeClass.attribute >>> MyTest('test_something').test_something() >>> assert SomeClass.attribute == originalr¢ h/jh0h3h5jHh7}r£ (U testnodetyper¤ Xdoctestr¥ h„h…h?]r¦ h=]r§ h9]r¨ h;]r© hA]rª Ugroupsr« ]r¬ hahŽ}r­ uhCMhDhh)]r® hRXO>>> class MyTest(unittest2.TestCase): ... @patch.object(SomeClass, 'attribute', sentinel.attribute) ... def test_something(self): ... self.assertEqual(SomeClass.attribute, sentinel.attribute) ... >>> original = SomeClass.attribute >>> MyTest('test_something').test_something() >>> assert SomeClass.attribute == originalr¯ …r° }r± (h.Uh/j  ubaubhÀ)r² }r³ (h.XÁIf you want to patch with a Mock, you can use `patch` with only one argument (or `patch.object` with two arguments). The mock will be created for you and passed into the test function / method:r´ h/jh0h3h5hÄh7}rµ (h9]r¶ h;]r· h=]r¸ h?]r¹ hA]rº uhCM›hDhh)]r» (hRX.If you want to patch with a Mock, you can use r¼ …r½ }r¾ (h.X.If you want to patch with a Mock, you can use r¿ h/j² ubjf)rÀ }rÁ (h.X`patch`r h7}rà (h9]rÄ h;]rÅ h=]rÆ h?]rÇ hA]rÈ uh/j² h)]rÉ hRXpatchrÊ …rË }rÌ (h.Uh/jÀ ubah5jtubhRX with only one argument (or rÍ …rÎ }rÏ (h.X with only one argument (or rÐ h/j² ubjf)rÑ }rÒ (h.X`patch.object`rÓ h7}rÔ (h9]rÕ h;]rÖ h=]r× h?]rØ hA]rÙ uh/j² h)]rÚ hRX patch.objectrÛ …rÜ }rÝ (h.Uh/jÑ ubah5jtubhRXb with two arguments). The mock will be created for you and passed into the test function / method:rÞ …rß }rà (h.Xb with two arguments). The mock will be created for you and passed into the test function / method:rá h/j² ubeubjD)râ }rã (h.X >>> class MyTest(unittest2.TestCase): ... @patch.object(SomeClass, 'static_method') ... def test_something(self, mock_method): ... SomeClass.static_method() ... mock_method.assert_called_with() ... >>> MyTest('test_something').test_something()rä h/jh0h3h5jHh7}rå (U testnodetyperæ Xdoctestrç h„h…h?]rè h=]ré h9]rê h;]rë hA]rì Ugroupsrí ]rî hahŽ}rï uhCMŸhDhh)]rð hRX >>> class MyTest(unittest2.TestCase): ... @patch.object(SomeClass, 'static_method') ... def test_something(self, mock_method): ... SomeClass.static_method() ... mock_method.assert_called_with() ... >>> MyTest('test_something').test_something()rñ …rò }ró (h.Uh/jâ ubaubhÀ)rô }rõ (h.X>You can stack up multiple patch decorators using this pattern:rö h/jh0h3h5hÄh7}r÷ (h9]rø h;]rù h=]rú h?]rû hA]rü uhCM©hDhh)]rý hRX>You can stack up multiple patch decorators using this pattern:rþ …rÿ }r (h.jö h/jô ubaubjD)r }r (h.Xs>>> class MyTest(unittest2.TestCase): ... @patch('package.module.ClassName1') ... @patch('package.module.ClassName2') ... def test_something(self, MockClass2, MockClass1): ... self.assertTrue(package.module.ClassName1 is MockClass1) ... self.assertTrue(package.module.ClassName2 is MockClass2) ... >>> MyTest('test_something').test_something()r h/jh0h3h5jHh7}r (U testnodetyper Xdoctestr h„h…h?]r h=]r h9]r h;]r hA]r Ugroupsr ]r hahŽ}r uhCM«hDhh)]r hRXs>>> class MyTest(unittest2.TestCase): ... @patch('package.module.ClassName1') ... @patch('package.module.ClassName2') ... def test_something(self, MockClass2, MockClass1): ... self.assertTrue(package.module.ClassName1 is MockClass1) ... self.assertTrue(package.module.ClassName2 is MockClass2) ... >>> MyTest('test_something').test_something()r …r }r (h.Uh/j ubaubhÀ)r }r (h.XWhen you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal *python* order that decorators are applied). This means from the bottom up, so in the example above the mock for `test_module.ClassName2` is passed in first.r h/jh0h3h5hÄh7}r (h9]r h;]r h=]r h?]r hA]r uhCM¶hDhh)]r (hRX|When you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal r …r }r (h.X|When you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal r h/j ubj¤)r! }r" (h.X*python*r# h7}r$ (h9]r% h;]r& h=]r' h?]r( hA]r) uh/j h)]r* hRXpythonr+ …r, }r- (h.Uh/j! ubah5j²ubhRXi order that decorators are applied). This means from the bottom up, so in the example above the mock for r. …r/ }r0 (h.Xi order that decorators are applied). This means from the bottom up, so in the example above the mock for r1 h/j ubjf)r2 }r3 (h.X`test_module.ClassName2`r4 h7}r5 (h9]r6 h;]r7 h=]r8 h?]r9 hA]r: uh/j h)]r; hRXtest_module.ClassName2r< …r= }r> (h.Uh/j2 ubah5jtubhRX is passed in first.r? …r@ }rA (h.X is passed in first.rB h/j ubeubhÀ)rC }rD (h.XžThere is also :func:`patch.dict` for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends:rE h/jh0h3h5hÄh7}rF (h9]rG h;]rH h=]rI h?]rJ hA]rK uhCM»hDhh)]rL (hRXThere is also rM …rN }rO (h.XThere is also rP h/jC ubhÐ)rQ }rR (h.X:func:`patch.dict`rS h/jC h0h3h5hÔh7}rT (UreftyperU XfuncrV h؉hÙX patch.dictrW U refdomainrX XpyrY h?]rZ h=]r[ U refexplicitr\ ‰h9]r] h;]r^ hA]r_ hãhähåNhæNuhCM»h)]r` hè)ra }rb (h.jS h7}rc (h9]rd h;]re (hîjY Xpy-funcrf eh=]rg h?]rh hA]ri uh/jQ h)]rj hRX patch.dict()rk …rl }rm (h.Uh/ja ubah5h÷ubaubhRX~ for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends:rn …ro }rp (h.X~ for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends:rq h/jC ubeubjD)rr }rs (h.X¾>>> foo = {'key': 'value'} >>> original = foo.copy() >>> with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == originalrt h/jh0h3h5jHh7}ru (U testnodetyperv Xdoctestrw h„h…h?]rx h=]ry h9]rz h;]r{ hA]r| Ugroupsr} ]r~ hahŽ}r uhCM¿hDhh)]r€ hRX¾>>> foo = {'key': 'value'} >>> original = foo.copy() >>> with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == originalr …r‚ }rƒ (h.Uh/jr ubaubhÀ)r„ }r… (h.XM`patch`, `patch.object` and `patch.dict` can all be used as context managers.r† h/jh0h3h5hÄh7}r‡ (h9]rˆ h;]r‰ h=]rŠ h?]r‹ hA]rŒ uhCMÈhDhh)]r (jf)rŽ }r (h.X`patch`r h7}r‘ (h9]r’ h;]r“ h=]r” h?]r• hA]r– uh/j„ h)]r— hRXpatchr˜ …r™ }rš (h.Uh/jŽ ubah5jtubhRX, r› …rœ }r (h.X, rž h/j„ ubjf)rŸ }r  (h.X`patch.object`r¡ h7}r¢ (h9]r£ h;]r¤ h=]r¥ h?]r¦ hA]r§ uh/j„ h)]r¨ hRX patch.objectr© …rª }r« (h.Uh/jŸ ubah5jtubhRX and r¬ …r­ }r® (h.X and r¯ h/j„ ubjf)r° }r± (h.X `patch.dict`r² h7}r³ (h9]r´ h;]rµ h=]r¶ h?]r· hA]r¸ uh/j„ h)]r¹ hRX patch.dictrº …r» }r¼ (h.Uh/j° ubah5jtubhRX% can all be used as context managers.r½ …r¾ }r¿ (h.X% can all be used as context managers.rÀ h/j„ ubeubhÀ)rÁ }r (h.X~Where you use `patch` to create a mock for you, you can get a reference to the mock using the "as" form of the with statement:rà h/jh0h3h5hÄh7}rÄ (h9]rÅ h;]rÆ h=]rÇ h?]rÈ hA]rÉ uhCMÊhDhh)]rÊ (hRXWhere you use rË …rÌ }rÍ (h.XWhere you use rÎ h/jÁ ubjf)rÏ }rÐ (h.X`patch`rÑ h7}rÒ (h9]rÓ h;]rÔ h=]rÕ h?]rÖ hA]r× uh/jÁ h)]rØ hRXpatchrÙ …rÚ }rÛ (h.Uh/jÏ ubah5jtubhRXi to create a mock for you, you can get a reference to the mock using the "as" form of the with statement:rÜ …rÝ }rÞ (h.Xi to create a mock for you, you can get a reference to the mock using the "as" form of the with statement:rß h/jÁ ubeubjD)rà }rá (h.X(>>> class ProductionClass(object): ... def method(self): ... pass ... >>> with patch.object(ProductionClass, 'method') as mock_method: ... mock_method.return_value = None ... real = ProductionClass() ... real.method(1, 2, 3) ... >>> mock_method.assert_called_with(1, 2, 3)râ h/jh0h3h5jHh7}rã (U testnodetyperä Xdoctestrå h„h…h?]ræ h=]rç h9]rè h;]ré hA]rê Ugroupsrë ]rì hahŽ}rí uhCMÍhDhh)]rî hRX(>>> class ProductionClass(object): ... def method(self): ... pass ... >>> with patch.object(ProductionClass, 'method') as mock_method: ... mock_method.return_value = None ... real = ProductionClass() ... real.method(1, 2, 3) ... >>> mock_method.assert_called_with(1, 2, 3)rï …rð }rñ (h.Uh/jà ubaubhÀ)rò }ró (h.XÕAs an alternative `patch`, `patch.object` and `patch.dict` can be used as class decorators. When used in this way it is the same as applying the decorator indvidually to every method whose name starts with "test".rô h/jh0h3h5hÄh7}rõ (h9]rö h;]r÷ h=]rø h?]rù hA]rú uhCMÛhDhh)]rû (hRXAs an alternative rü …rý }rþ (h.XAs an alternative rÿ h/jò ubjf)r }r (h.X`patch`r h7}r (h9]r h;]r h=]r h?]r hA]r uh/jò h)]r hRXpatchr …r }r (h.Uh/j ubah5jtubhRX, r …r }r (h.X, r h/jò ubjf)r }r (h.X`patch.object`r h7}r (h9]r h;]r h=]r h?]r hA]r uh/jò h)]r hRX patch.objectr …r }r (h.Uh/j ubah5jtubhRX and r …r }r (h.X and r! h/jò ubjf)r" }r# (h.X `patch.dict`r$ h7}r% (h9]r& h;]r' h=]r( h?]r) hA]r* uh/jò h)]r+ hRX patch.dictr, …r- }r. (h.Uh/j" ubah5jtubhRX› can be used as class decorators. When used in this way it is the same as applying the decorator indvidually to every method whose name starts with "test".r/ …r0 }r1 (h.X› can be used as class decorators. When used in this way it is the same as applying the decorator indvidually to every method whose name starts with "test".r2 h/jò ubeubhÀ)r3 }r4 (h.XFFor some more advanced examples, see the :ref:`further-examples` page.r5 h/jh0h3h5hÄh7}r6 (h9]r7 h;]r8 h=]r9 h?]r: hA]r; uhCMßhDhh)]r< (hRX)For some more advanced examples, see the r= …r> }r? (h.X)For some more advanced examples, see the r@ h/j3 ubhÐ)rA }rB (h.X:ref:`further-examples`rC h/j3 h0h3h5hÔh7}rD (UreftyperE XrefrF h؈hÙXfurther-examplesrG U refdomainrH XstdrI h?]rJ h=]rK U refexplicitrL ‰h9]rM h;]rN hA]rO hãhäuhCMßh)]rP j¤)rQ }rR (h.jC h7}rS (h9]rT h;]rU (hîjI Xstd-refrV eh=]rW h?]rX hA]rY uh/jA h)]rZ hRXfurther-examplesr[ …r\ }r] (h.Uh/jQ ubah5j²ubaubhRX page.r^ …r_ }r` (h.X page.ra h/j3 ubeubeubeubah.UU transformerrb NU footnote_refsrc }rd Urefnamesre }rf Usymbol_footnotesrg ]rh Uautofootnote_refsri ]rj Usymbol_footnote_refsrk ]rl U citationsrm ]rn hDhU current_linero NUtransform_messagesrp ]rq (cdocutils.nodes system_message rr )rs }rt (h.Uh7}ru (h9]rv Ulevelrw Kh?]rx h=]ry Usourcerz h3h;]r{ hA]r| Uliner} KUtyper~ UINFOr uh)]r€ hÀ)r }r‚ (h.Uh7}rƒ (h9]r„ h;]r… h=]r† h?]r‡ hA]rˆ uh/js h)]r‰ hRX5Hyperlink target "getting-started" is not referenced.rŠ …r‹ }rŒ (h.Uh/j ubah5hÄubah5Usystem_messager ubjr )rŽ }r (h.Uh7}r (h9]r‘ Ulevelr’ Kh?]r“ h=]r” Usourcer• h3h;]r– hA]r— Uliner˜ KUtyper™ j uh)]rš hÀ)r› }rœ (h.Uh7}r (h9]rž h;]rŸ h=]r  h?]r¡ hA]r¢ uh/jŽ h)]r£ hRX-Hyperlink target "index-0" is not referenced.r¤ …r¥ }r¦ (h.Uh/j› ubah5hÄubah5j ubeUreporterr§ NUid_startr¨ KU autofootnotesr© ]rª U citation_refsr« }r¬ Uindirect_targetsr­ ]r® Usettingsr¯ (cdocutils.frontend Values r° or± }r² (Ufootnote_backlinksr³ KUrecord_dependenciesr´ NU rfc_base_urlrµ Uhttp://tools.ietf.org/html/r¶ U tracebackr· ˆUpep_referencesr¸ NUstrip_commentsr¹ NU toc_backlinksrº Uentryr» U language_coder¼ Uenr½ U datestampr¾ NU report_levelr¿ KU _destinationrÀ NU halt_levelrÁ KU strip_classesr NhJNUerror_encoding_error_handlerrà UbackslashreplacerÄ UdebugrÅ NUembed_stylesheetrÆ ‰Uoutput_encoding_error_handlerrÇ UstrictrÈ U sectnum_xformrÉ KUdump_transformsrÊ NU docinfo_xformrË KUwarning_streamrÌ NUpep_file_url_templaterÍ Upep-%04drÎ Uexit_status_levelrÏ KUconfigrÐ NUstrict_visitorrÑ NUcloak_email_addressesrÒ ˆUtrim_footnote_reference_spacerÓ ‰UenvrÔ NUdump_pseudo_xmlrÕ NUexpose_internalsrÖ NUsectsubtitle_xformr× ‰U source_linkrØ NUrfc_referencesrÙ NUoutput_encodingrÚ Uutf-8rÛ U source_urlrÜ NUinput_encodingrÝ U utf-8-sigrÞ U_disable_configrß NU id_prefixrà UU tab_widthrá KUerror_encodingrâ U mac-romanrã U_sourcerä U&/compile/mock/docs/getting-started.txtrå Ugettext_compactræ ˆU generatorrç NUdump_internalsrè NU pep_base_urlré Uhttp://www.python.org/dev/peps/rê Usyntax_highlightrë Ushortrì Uinput_encoding_error_handlerrí jÈ Uauto_id_prefixrî Uidrï Udoctitle_xformrð ‰Ustrip_elements_with_classesrñ NU _config_filesrò ]ró Ufile_insertion_enabledrô KU raw_enabledrõ KU dump_settingsrö NubUsymbol_footnote_startr÷ KUidsrø }rù (h!jh$j€hhWh'jDh h,h#jªh&jFh"hªhohsh(jWhj®hj€h%jKhh”uUsubstitution_namesrú }rû h5hDh7}rü (h9]rý h?]rþ h=]rÿ Usourcer h3h;]r hA]r uU footnotesr ]r Urefidsr }r ub.mock-1.0.1/html/.doctrees/index.doctree0000644000076500001200000030074012046030506020461 0ustar michaeladmin00000000000000€cdocutils.nodes document q)q}q(U nametypesq}q(X1mockity mock mock - some love for the mock moduleqˆXspyqˆX(mocking with django and google appengineqˆX mock recipesq ˆXunittestq ˆXmock objects in pythonq ˆXmock documentation as pdfq ˆXmock 0.8q ˆX referencesqNX0mailing list (testing-in-python@lists.idyll.org)qˆXmock 0.6qˆX8mock-django: tools for mocking the django orm and modelsqˆU1ˆXapi documentationqNXpython unit testing with mockqˆX(a presentation on unit testing with mockqˆXgoogle code projectqˆXolder versionsqNX michael foordqˆX7python mock: how to assert a substring of logger outputqˆXmock 0.7qˆX"mock - mocking and testing libraryqNX0imposing a no db discipline on django unit testsqˆXtestsqNXclassic mock terminologyqˆXmock.readthedocs.orgqˆX martin fowlerqˆX3python: injecting mock objects for powerful testingq ˆXmocking djangoq!ˆX bsd licenseq"ˆX getting started with python mockq#ˆX quick guideq$NX smart parameter checks with mockq%ˆX user guideq&NX'google code home & mercurial repositoryq'ˆX unittest.mockq(ˆX how to test django template tagsq)ˆX(python mock testing techniques and toolsq*ˆXpdf documentationq+ˆX installingq,NX mock homepageq-ˆX setuptoolsq.ˆX mock on pypiq/ˆX unittest2q0ˆXcoverage and mock (with django)q1ˆX6mocking dates and other classes that can't be modifiedq2ˆX terminologyq3NX#pycon 2011 video: testing with mockq4ˆuUsubstitution_defsq5}q6Uparse_messagesq7]q8Ucurrent_sourceq9NU decorationq:NUautofootnote_startq;KUnameidsq<}q=(hU/mockity-mock-mock-some-love-for-the-mock-moduleq>hUspyq?hU(mocking-with-django-and-google-appengineq@h U mock-recipesqAh UunittestqBh Umock-objects-in-pythonqCh Umock-documentation-as-pdfqDh Umock-0-8qEhU referencesqFhU.mailing-list-testing-in-python-lists-idyll-orgqGhUmock-0-6qHhU7mock-django-tools-for-mocking-the-django-orm-and-modelsqIU1Uid2qJhUapi-documentationqKhUpython-unit-testing-with-mockqLhU(a-presentation-on-unit-testing-with-mockqMhUgoogle-code-projectqNhUolder-versionsqOhU michael-foordqPhU6python-mock-how-to-assert-a-substring-of-logger-outputqQhUmock-0-7qRhU mock-mocking-and-testing-libraryqShU0imposing-a-no-db-discipline-on-django-unit-testsqThUtestsqUhUclassic-mock-terminologyqVhUmock-readthedocs-orgqWhU martin-fowlerqXh U2python-injecting-mock-objects-for-powerful-testingqYh!Umocking-djangoqZh"U bsd-licenseq[h#U getting-started-with-python-mockq\h$U quick-guideq]h%U smart-parameter-checks-with-mockq^h&U user-guideq_h'U%google-code-home-mercurial-repositoryq`h(U unittest-mockqah)U how-to-test-django-template-tagsqbh*U(python-mock-testing-techniques-and-toolsqch+Updf-documentationqdh,U installingqeh-U mock-homepageqfh.U setuptoolsqgh/U mock-on-pypiqhh0U unittest2qih1Ucoverage-and-mock-with-djangoqjh2U6mocking-dates-and-other-classes-that-can-t-be-modifiedqkh3U terminologyqlh4U"pycon-2011-video-testing-with-mockqmuUchildrenqn]qocdocutils.nodes section qp)qq}qr(U rawsourceqsUUparentqthUsourcequcdocutils.nodes reprunicode qvX/compile/mock/docs/index.txtqw…qx}qybUtagnameqzUsectionq{U attributesq|}q}(Udupnamesq~]qUclassesq€]qUbackrefsq‚]qƒUidsq„]q…hSaUnamesq†]q‡hauUlineqˆKUdocumentq‰hhn]qŠ(cdocutils.nodes title q‹)qŒ}q(hsX"Mock - Mocking and Testing LibraryqŽhthqhuhxhzUtitleqh|}q(h~]q‘h€]q’h‚]q“h„]q”h†]q•uhˆKh‰hhn]q–cdocutils.nodes Text q—X"Mock - Mocking and Testing Libraryq˜…q™}qš(hshŽhthŒubaubcdocutils.nodes field_list q›)qœ}q(hsUhthqhuhxhzU field_listqžh|}qŸ(h~]q h€]q¡h‚]q¢h„]q£h†]q¤uhˆKh‰hhn]q¥(cdocutils.nodes field q¦)q§}q¨(hsUhthœhuhxhzUfieldq©h|}qª(h~]q«h€]q¬h‚]q­h„]q®h†]q¯uhˆKh‰hhn]q°(cdocutils.nodes field_name q±)q²}q³(hsXAuthorq´h|}qµ(h~]q¶h€]q·h‚]q¸h„]q¹h†]qºuhth§hn]q»h—XAuthorq¼…q½}q¾(hsh´hth²ubahzU field_nameq¿ubcdocutils.nodes field_body qÀ)qÁ}qÂ(hsXH`Michael Foord `_qÃh|}qÄ(h~]qÅh€]qÆh‚]qÇh„]qÈh†]qÉuhth§hn]qÊcdocutils.nodes paragraph qË)qÌ}qÍ(hsXH`Michael Foord `_qÎhthÁhuhxhzU paragraphqÏh|}qÐ(h~]qÑh€]qÒh‚]qÓh„]qÔh†]qÕuhˆKhn]qÖ(cdocutils.nodes reference q×)qØ}qÙ(hshÎh|}qÚ(UnameqÛX Michael FoordqÜUrefuriqÝX5http://www.voidspace.org.uk/python/weblog/index.shtmlqÞh„]qßh‚]qàh~]qáh€]qâh†]qãuhthÌhn]qäh—X Michael Foordqå…qæ}qç(hsUhthØubahzU referenceqèubcdocutils.nodes target qé)qê}që(hsX8 qìU referencedqíKhthÌhzUtargetqîh|}qï(UrefuriqðhÞh„]qñhPah‚]qòh~]qóh€]qôh†]qõhauhn]qöubeubahzU field_bodyq÷ubeubh¦)qø}qù(hsUhthœhuhxhzh©h|}qú(h~]qûh€]qüh‚]qýh„]qþh†]qÿuhˆK h‰hhn]r(h±)r}r(hsXVersionrh|}r(h~]rh€]rh‚]rh„]rh†]r uhthøhn]r h—XVersionr …r }r (hsjhtjubahzh¿ubhÀ)r}r(hsX |release|rh|}r(h~]rh€]rh‚]rh„]rh†]ruhthøhn]rhË)r}r(hsjhtjhuhxhzhÏh|}r(h~]rh€]rh‚]rh„]rh†]ruhˆK hn]r h—X1.0.1r!…r"}r#(hsU1.0.1r$htjubaubahzh÷ubeubh¦)r%}r&(hsUhthœhuhxhzh©h|}r'(h~]r(h€]r)h‚]r*h„]r+h†]r,uhˆK h‰hhn]r-(h±)r.}r/(hsXDater0h|}r1(h~]r2h€]r3h‚]r4h„]r5h†]r6uhtj%hn]r7h—XDater8…r9}r:(hsj0htj.ubahzh¿ubhÀ)r;}r<(hsX 2012/10/07r=h|}r>(h~]r?h€]r@h‚]rAh„]rBh†]rCuhtj%hn]rDhË)rE}rF(hsj=htj;huhxhzhÏh|}rG(h~]rHh€]rIh‚]rJh„]rKh†]rLuhˆK hn]rMh—X 2012/10/07rN…rO}rP(hsj=htjEubaubahzh÷ubeubh¦)rQ}rR(hsUhthœhuhxhzh©h|}rS(h~]rTh€]rUh‚]rVh„]rWh†]rXuhˆK h‰hhn]rY(h±)rZ}r[(hsXHomepager\h|}r](h~]r^h€]r_h‚]r`h„]rah†]rbuhtjQhn]rch—XHomepagerd…re}rf(hsj\htjZubahzh¿ubhÀ)rg}rh(hsX`Mock Homepage`_rih|}rj(h~]rkh€]rlh‚]rmh„]rnh†]rouhtjQhn]rphË)rq}rr(hsjihtjghuhxhzhÏh|}rs(h~]rth€]ruh‚]rvh„]rwh†]rxuhˆK hn]ryh×)rz}r{(hsjiUresolvedr|Khtjqhzhèh|}r}(Unamer~X Mock HomepagerhÝX(http://www.voidspace.org.uk/python/mock/r€h„]rh‚]r‚h~]rƒh€]r„h†]r…uhn]r†h—X Mock Homepager‡…rˆ}r‰(hsUhtjzubaubaubahzh÷ubeubh¦)rŠ}r‹(hsUhthœhuhxhzh©h|}rŒ(h~]rh€]rŽh‚]rh„]rh†]r‘uhˆK h‰hhn]r’(h±)r“}r”(hsXDownloadr•h|}r–(h~]r—h€]r˜h‚]r™h„]ršh†]r›uhtjŠhn]rœh—XDownloadr…rž}rŸ(hsj•htj“ubahzh¿ubhÀ)r }r¡(hsX`Mock on PyPI`_r¢h|}r£(h~]r¤h€]r¥h‚]r¦h„]r§h†]r¨uhtjŠhn]r©hË)rª}r«(hsj¢htj huhxhzhÏh|}r¬(h~]r­h€]r®h‚]r¯h„]r°h†]r±uhˆK hn]r²h×)r³}r´(hsj¢j|Khtjªhzhèh|}rµ(Unamer¶X Mock on PyPIr·hÝX http://pypi.python.org/pypi/mockr¸h„]r¹h‚]rºh~]r»h€]r¼h†]r½uhn]r¾h—X Mock on PyPIr¿…rÀ}rÁ(hsUhtj³ubaubaubahzh÷ubeubh¦)rÂ}rÃ(hsUhthœhuhxhzh©h|}rÄ(h~]rÅh€]rÆh‚]rÇh„]rÈh†]rÉuhˆK h‰hhn]rÊ(h±)rË}rÌ(hsX DocumentationrÍh|}rÎ(h~]rÏh€]rÐh‚]rÑh„]rÒh†]rÓuhtjÂhn]rÔh—X DocumentationrÕ…rÖ}r×(hsjÍhtjËubahzh¿ubhÀ)rØ}rÙ(hsXK`PDF Documentation `_rÚh|}rÛ(h~]rÜh€]rÝh‚]rÞh„]rßh†]ràuhtjÂhn]ráhË)râ}rã(hsXK`PDF Documentation `_rähtjØhuhxhzhÏh|}rå(h~]ræh€]rçh‚]rèh„]réh†]rêuhˆK hn]rë(h×)rì}rí(hsjäh|}rî(UnamerïXPDF DocumentationrðhÝX4http://www.voidspace.org.uk/downloads/mock-1.0.0.pdfrñh„]ròh‚]róh~]rôh€]rõh†]röuhtjâhn]r÷h—XPDF Documentationrø…rù}rú(hsUhtjìubahzhèubhé)rû}rü(hsX7 rýhíKhtjâhzhîh|}rþ(Urefurirÿjñh„]rhdah‚]rh~]rh€]rh†]rh+auhn]rubeubahzh÷ubeubh¦)r}r(hsUhthœhuhxhzh©h|}r(h~]r h€]r h‚]r h„]r h†]r uhˆKh‰hhn]r(h±)r}r(hsXLicenserh|}r(h~]rh€]rh‚]rh„]rh†]ruhtjhn]rh—XLicenser…r}r(hsjhtjubahzh¿ubhÀ)r}r(hsX`BSD License`_rh|}r(h~]r h€]r!h‚]r"h„]r#h†]r$uhtjhn]r%hË)r&}r'(hsjhtjhuhxhzhÏh|}r((h~]r)h€]r*h‚]r+h„]r,h†]r-uhˆKhn]r.h×)r/}r0(hsjj|Khtj&hzhèh|}r1(Unamer2X BSD Licenser3hÝX0http://www.voidspace.org.uk/python/license.shtmlr4h„]r5h‚]r6h~]r7h€]r8h†]r9uhn]r:h—X BSD Licenser;…r<}r=(hsUhtj/ubaubaubahzh÷ubeubh¦)r>}r?(hsUhthœhuhxhzh©h|}r@(h~]rAh€]rBh‚]rCh„]rDh†]rEuhˆKh‰hhn]rF(h±)rG}rH(hsXSupportrIh|}rJ(h~]rKh€]rLh‚]rMh„]rNh†]rOuhtj>hn]rPh—XSupportrQ…rR}rS(hsjIhtjGubahzh¿ubhÀ)rT}rU(hsXg`Mailing list (testing-in-python@lists.idyll.org) `_rVh|}rW(h~]rXh€]rYh‚]rZh„]r[h†]r\uhtj>hn]r]hË)r^}r_(hsXg`Mailing list (testing-in-python@lists.idyll.org) `_r`htjThuhxhzhÏh|}ra(h~]rbh€]rch‚]rdh„]reh†]rfuhˆKhn]rg(h×)rh}ri(hsj`h|}rj(UnamerkX0Mailing list (testing-in-python@lists.idyll.org)rlhÝX1http://lists.idyll.org/listinfo/testing-in-pythonrmh„]rnh‚]roh~]rph€]rqh†]rruhtj^hn]rsh—X0Mailing list (testing-in-python@lists.idyll.org)rt…ru}rv(hsUhtjhubahzhèubhé)rw}rx(hsX4 ryhíKhtj^hzhîh|}rz(Urefurir{jmh„]r|hGah‚]r}h~]r~h€]rh†]r€hauhn]rubeubahzh÷ubeubh¦)r‚}rƒ(hsUhthœhuhxhzh©h|}r„(h~]r…h€]r†h‚]r‡h„]rˆh†]r‰uhˆKh‰hhn]rŠ(h±)r‹}rŒ(hsX Issue trackerrh|}rŽ(h~]rh€]rh‚]r‘h„]r’h†]r“uhtj‚hn]r”h—X Issue trackerr•…r–}r—(hsjhtj‹ubahzh¿ubhÀ)r˜}r™(hsXC`Google code project `_ ršh|}r›(h~]rœh€]rh‚]ržh„]rŸh†]r uhtj‚hn]r¡hË)r¢}r£(hsXB`Google code project `_r¤htj˜huhxhzhÏh|}r¥(h~]r¦h€]r§h‚]r¨h„]r©h†]rªuhˆKhn]r«(h×)r¬}r­(hsj¤h|}r®(Unamer¯XGoogle code projectr°hÝX)http://code.google.com/p/mock/issues/listr±h„]r²h‚]r³h~]r´h€]rµh†]r¶uhtj¢hn]r·h—XGoogle code projectr¸…r¹}rº(hsUhtj¬ubahzhèubhé)r»}r¼(hsX, r½híKhtj¢hzhîh|}r¾(Urefurir¿j±h„]rÀhNah‚]rÁh~]rÂh€]rÃh†]rÄhauhn]rÅubeubahzh÷ubeubeubhé)rÆ}rÇ(hsX;.. _Mock Homepage: http://www.voidspace.org.uk/python/mock/rÈhíKhthqhuhxhzhîh|}rÉ(hÝj€h„]rÊhfah‚]rËh~]rÌh€]rÍh†]rÎh-auhˆKh‰hhn]rÏubhé)rÐ}rÑ(hsXA.. _BSD License: http://www.voidspace.org.uk/python/license.shtmlrÒhíKhthqhuhxhzhîh|}rÓ(hÝj4h„]rÔh[ah‚]rÕh~]rÖh€]r×h†]rØh"auhˆKh‰hhn]rÙubhé)rÚ}rÛ(hsUhthqhuhxhzhîh|}rÜ(h~]rÝh„]rÞX module-mockrßah‚]ràUismodráˆh€]râh†]rãuhˆNh‰hhn]räubcsphinx.addnodes index rå)ræ}rç(hsUhthqhuhxhzUindexrèh|}ré(h„]rêh‚]rëh~]rìh€]ríh†]rîUentriesrï]rð(UsinglerñX mock (module)X module-mockUtròauhˆNh‰hhn]róubjå)rô}rõ(hsUhthqhuhxhzjèh|}rö(h„]r÷h‚]røh~]rùh€]rúh†]rûUentriesrü]rý(jñX introductionUindex-0rþUtrÿaUinliner‰uhˆKh‰hhn]rubhé)r}r(hsUhthqhuhxhzhîh|}r(h„]rh‚]rh~]rh€]rh†]r Urefidr jþuhˆKh‰hhn]r ubhË)r }r (hsX¦mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used.rhthqhuhxUexpect_referenced_by_namer}rhzhÏh|}r(h~]rh€]rh‚]rh„]rjþah†]ruhˆK h‰hUexpect_referenced_by_idr}rjþjshn]rh—X¦mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used.r…r}r(hsjhtj ubaubhË)r}r(hsX³mock is now part of the Python standard library, available as `unittest.mock `_ in Python 3.3 onwards.rhthqhuhxhzhÏh|}r (h~]r!h€]r"h‚]r#h„]r$h†]r%uhˆK$h‰hhn]r&(h—X>mock is now part of the Python standard library, available as r'…r(}r)(hsX>mock is now part of the Python standard library, available as r*htjubh×)r+}r,(hsX^`unittest.mock `_r-h|}r.(Unamer/X unittest.mockr0hÝXKhttp://docs.python.org/py3k/library/unittest.mock.html#module-unittest.mockr1h„]r2h‚]r3h~]r4h€]r5h†]r6uhtjhn]r7h—X unittest.mockr8…r9}r:(hsUhtj+ubahzhèubhé)r;}r<(hsXN r=híKhtjhzhîh|}r>(Urefurir?j1h„]r@haah‚]rAh~]rBh€]rCh†]rDh(auhn]rEubh—X in Python 3.3 onwards.rF…rG}rH(hsX in Python 3.3 onwards.rIhtjubeubhË)rJ}rK(hsXDmock provides a core :class:`Mock` class removing the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way.rLhthqhuhxhzhÏh|}rM(h~]rNh€]rOh‚]rPh„]rQh†]rRuhˆK(h‰hhn]rS(h—Xmock provides a core rT…rU}rV(hsXmock provides a core rWhtjJubcsphinx.addnodes pending_xref rX)rY}rZ(hsX :class:`Mock`r[htjJhuhxhzU pending_xrefr\h|}r](Ureftyper^Xclassr_Urefwarnr`‰U reftargetraXMockrbU refdomainrcXpyrdh„]reh‚]rfU refexplicitrg‰h~]rhh€]rih†]rjUrefdocrkUindexrlUpy:classrmNU py:modulernXmockrouhˆK(hn]rpcdocutils.nodes literal rq)rr}rs(hsj[h|}rt(h~]ruh€]rv(UxrefrwjdXpy-classrxeh‚]ryh„]rzh†]r{uhtjYhn]r|h—XMockr}…r~}r(hsUhtjrubahzUliteralr€ubaubh—X" class removing the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way.r…r‚}rƒ(hsX" class removing the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way.r„htjJubeubhË)r…}r†(hsX/Additionally, mock provides a :func:`patch` decorator that handles patching module and class level attributes within the scope of a test, along with :const:`sentinel` for creating unique objects. See the `quick guide`_ for some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:`patch`.r‡hthqhuhxhzhÏh|}rˆ(h~]r‰h€]rŠh‚]r‹h„]rŒh†]ruhˆK.h‰hhn]rŽ(h—XAdditionally, mock provides a r…r}r‘(hsXAdditionally, mock provides a r’htj…ubjX)r“}r”(hsX :func:`patch`r•htj…huhxhzj\h|}r–(Ureftyper—Xfuncr˜j`‰jaXpatchr™U refdomainršXpyr›h„]rœh‚]rU refexplicitrž‰h~]rŸh€]r h†]r¡jkjljmNjnjouhˆK.hn]r¢jq)r£}r¤(hsj•h|}r¥(h~]r¦h€]r§(jwj›Xpy-funcr¨eh‚]r©h„]rªh†]r«uhtj“hn]r¬h—Xpatch()r­…r®}r¯(hsUhtj£ubahzj€ubaubh—Xj decorator that handles patching module and class level attributes within the scope of a test, along with r°…r±}r²(hsXj decorator that handles patching module and class level attributes within the scope of a test, along with r³htj…ubjX)r´}rµ(hsX:const:`sentinel`r¶htj…huhxhzj\h|}r·(Ureftyper¸Xconstr¹j`‰jaXsentinelrºU refdomainr»Xpyr¼h„]r½h‚]r¾U refexplicitr¿‰h~]rÀh€]rÁh†]rÂjkjljmNjnjouhˆK.hn]rÃjq)rÄ}rÅ(hsj¶h|}rÆ(h~]rÇh€]rÈ(jwj¼Xpy-constrÉeh‚]rÊh„]rËh†]rÌuhtj´hn]rÍh—XsentinelrÎ…rÏ}rÐ(hsUhtjÄubahzj€ubaubh—X& for creating unique objects. See the rÑ…rÒ}rÓ(hsX& for creating unique objects. See the rÔhtj…ubh×)rÕ}rÖ(hsX`quick guide`_r×j|Khtj…hzhèh|}rØ(UnamerÙX quick guiderÚh„]rÛh‚]rÜh~]rÝh€]rÞh†]rßj h]uhn]ràh—X quick guiderá…râ}rã(hsUhtjÕubaubh—X! for some examples of how to use rä…rå}ræ(hsX! for some examples of how to use rçhtj…ubjX)rè}ré(hsX :class:`Mock`rêhtj…huhxhzj\h|}rë(UreftyperìXclassríj`‰jaXMockrîU refdomainrïXpyrðh„]rñh‚]ròU refexplicitró‰h~]rôh€]rõh†]röjkjljmNjnjouhˆK.hn]r÷jq)rø}rù(hsjêh|}rú(h~]rûh€]rü(jwjðXpy-classrýeh‚]rþh„]rÿh†]ruhtjèhn]rh—XMockr…r}r(hsUhtjøubahzj€ubaubh—X, r…r}r(hsX, rhtj…ubjX)r }r (hsX:class:`MagicMock`r htj…huhxhzj\h|}r (Ureftyper Xclassrj`‰jaX MagicMockrU refdomainrXpyrh„]rh‚]rU refexplicitr‰h~]rh€]rh†]rjkjljmNjnjouhˆK.hn]rjq)r}r(hsj h|}r(h~]rh€]r(jwjXpy-classreh‚]rh„]r h†]r!uhtj hn]r"h—X MagicMockr#…r$}r%(hsUhtjubahzj€ubaubh—X and r&…r'}r((hsX and r)htj…ubjX)r*}r+(hsX :func:`patch`r,htj…huhxhzj\h|}r-(Ureftyper.Xfuncr/j`‰jaXpatchr0U refdomainr1Xpyr2h„]r3h‚]r4U refexplicitr5‰h~]r6h€]r7h†]r8jkjljmNjnjouhˆK.hn]r9jq)r:}r;(hsj,h|}r<(h~]r=h€]r>(jwj2Xpy-funcr?eh‚]r@h„]rAh†]rBuhtj*hn]rCh—Xpatch()rD…rE}rF(hsUhtj:ubahzj€ubaubh—X.…rG}rH(hsX.htj…ubeubhË)rI}rJ(hsXÞMock is very easy to use and is designed for use with `unittest `_. Mock is based on the 'action -> assertion' pattern instead of `'record -> replay'` used by many mocking frameworks.rKhthqhuhxhzhÏh|}rL(h~]rMh€]rNh‚]rOh„]rPh†]rQuhˆK4h‰hhn]rR(h—X6Mock is very easy to use and is designed for use with rS…rT}rU(hsX6Mock is very easy to use and is designed for use with rVhtjIubh×)rW}rX(hsX3`unittest `_rYh|}rZ(Unamer[Xunittestr\hÝX%http://pypi.python.org/pypi/unittest2r]h„]r^h‚]r_h~]r`h€]rah†]rbuhtjIhn]rch—Xunittestrd…re}rf(hsUhtjWubahzhèubhé)rg}rh(hsX( rihíKhtjIhzhîh|}rj(Urefurirkj]h„]rlhBah‚]rmh~]rnh€]roh†]rph auhn]rqubh—X@. Mock is based on the 'action -> assertion' pattern instead of rr…rs}rt(hsX@. Mock is based on the 'action -> assertion' pattern instead of ruhtjIubcdocutils.nodes title_reference rv)rw}rx(hsX`'record -> replay'`ryh|}rz(h~]r{h€]r|h‚]r}h„]r~h†]ruhtjIhn]r€h—X'record -> replay'r…r‚}rƒ(hsUhtjwubahzUtitle_referencer„ubh—X! used by many mocking frameworks.r……r†}r‡(hsX! used by many mocking frameworks.rˆhtjIubeubhË)r‰}rŠ(hsX`mock is tested on Python versions 2.4-2.7, Python 3 plus the latest versions of Jython and PyPy.r‹hthqhuhxhzhÏh|}rŒ(h~]rh€]rŽh‚]rh„]rh†]r‘uhˆK9h‰hhn]r’h—X`mock is tested on Python versions 2.4-2.7, Python 3 plus the latest versions of Jython and PyPy.r“…r”}r•(hsj‹htj‰ubaubcdocutils.nodes comment r–)r—}r˜(hsXÑclass ProductionClass(object): def method(self, *args): pass module = sys.modules['module'] = ProductionClass ProductionClass.ClassName1 = ProductionClass ProductionClass.ClassName2 = ProductionClassr™hthqhuhxhzUcommentršh|}r›(U testnodetyperœX testsetuprU xml:spaceržUpreserverŸh„]r h‚]r¡h~]r¢h€]r£h†]r¤Ugroupsr¥]r¦Udefaultr§aUoptionsr¨}r©uhˆK=h‰hhn]rªh—XÑclass ProductionClass(object): def method(self, *args): pass module = sys.modules['module'] = ProductionClass ProductionClass.ClassName1 = ProductionClass ProductionClass.ClassName2 = ProductionClassr«…r¬}r­(hsUhtj—ubaubhp)r®}r¯(hsUhthqhuhxhzh{h|}r°(h~]r±h€]r²h‚]r³h„]r´hKah†]rµhauhˆKJh‰hhn]r¶(h‹)r·}r¸(hsXAPI Documentationr¹htj®huhxhzhh|}rº(h~]r»h€]r¼h‚]r½h„]r¾h†]r¿uhˆKJh‰hhn]rÀh—XAPI DocumentationrÁ…rÂ}rÃ(hsj¹htj·ubaubcdocutils.nodes compound rÄ)rÅ}rÆ(hsUhtj®huhxhzUcompoundrÇh|}rÈ(h~]rÉh€]rÊUtoctree-wrapperrËah‚]rÌh„]rÍh†]rÎuhˆNh‰hhn]rÏcsphinx.addnodes toctree rÐ)rÑ}rÒ(hsUhtjÅhuhxhzUtoctreerÓh|}rÔ(UnumberedrÕKhtjlU titlesonlyrÖ‰Uglobr׉h„]rØh‚]rÙh~]rÚh€]rÛh†]rÜjü]rÝ(NXmockrÞ†rßNXpatchrà†ráNXhelpersrâ†rãNXsentinelrä†råNX magicmockræ†rçeUhiddenrè‰U includefilesré]rê(jÞjàjâjäjæeUmaxdepthrëKuhˆKLhn]rìubaubeubhp)rí}rî(hsUhthqhuhxhzh{h|}rï(h~]rðh€]rñh‚]ròh„]róh_ah†]rôh&auhˆKWh‰hhn]rõ(h‹)rö}r÷(hsX User Guiderøhtjíhuhxhzhh|}rù(h~]rúh€]rûh‚]rüh„]rýh†]rþuhˆKWh‰hhn]rÿh—X User Guider…r}r(hsjøhtjöubaubjÄ)r}r(hsUhtjíhuhxhzjÇh|}r(h~]rh€]rjËah‚]rh„]r h†]r uhˆNh‰hhn]r jÐ)r }r (hsUhtjhuhxhzjÓh|}r(jÕKhtjljÖ‰j׉h„]rh‚]rh~]rh€]rh†]rjü]r(NXgetting-startedr†rNXexamplesr†rNXcomparer†rNX changelogr†rejè‰jé]r(jjjjejëKuhˆKYhn]rubaubjå)r}r (hsUhtjíhuhxhzjèh|}r!(h„]r"h‚]r#h~]r$h€]r%h†]r&jü]r'(jñX installingUindex-1r(Utr)aj‰uhˆKch‰hhn]r*ubhé)r+}r,(hsUhtjíhuhxhzhîh|}r-(h„]r.h‚]r/h~]r0h€]r1h†]r2j j(uhˆKch‰hhn]r3ubeubhp)r4}r5(hsUhthqhuhxj}r6hzh{h|}r7(h~]r8h€]r9h‚]r:h„]r;(hej(eh†]r<h,auhˆKeh‰hj}r=j(j+shn]r>(h‹)r?}r@(hsX InstallingrAhtj4huhxhzhh|}rB(h~]rCh€]rDh‚]rEh„]rFh†]rGuhˆKeh‰hhn]rHh—X InstallingrI…rJ}rK(hsjAhtj?ubaubhË)rL}rM(hsX¤The current version is |release|. Mock is stable and widely used. If you do find any bugs, or have suggestions for improvements / extensions then please contact us.rNhtj4huhxhzhÏh|}rO(h~]rPh€]rQh‚]rRh„]rSh†]rTuhˆKgh‰hhn]rU(h—XThe current version is rV…rW}rX(hsXThe current version is rYhtjLubh—X1.0.1rZ…r[}r\(hsj$huNhˆNh‰hhtjLubh—X„. Mock is stable and widely used. If you do find any bugs, or have suggestions for improvements / extensions then please contact us.r]…r^}r_(hsX„. Mock is stable and widely used. If you do find any bugs, or have suggestions for improvements / extensions then please contact us.r`htjLubeubcdocutils.nodes bullet_list ra)rb}rc(hsUhtj4huhxhzU bullet_listrdh|}re(UbulletrfX*h„]rgh‚]rhh~]rih€]rjh†]rkuhˆKkh‰hhn]rl(cdocutils.nodes list_item rm)rn}ro(hsX2`mock on PyPI `_rphtjbhuhxhzU list_itemrqh|}rr(h~]rsh€]rth‚]ruh„]rvh†]rwuhˆNh‰hhn]rxhË)ry}rz(hsjphtjnhuhxhzhÏh|}r{(h~]r|h€]r}h‚]r~h„]rh†]r€uhˆKkhn]r(h×)r‚}rƒ(hsjph|}r„(Unamer…X mock on PyPIr†hÝj¸h„]r‡h‚]rˆh~]r‰h€]rŠh†]r‹uhtjyhn]rŒh—X mock on PyPIr…rŽ}r(hsUhtj‚ubahzhèubhé)r}r‘(hsX# r’híKhtjyhzhîh|}r“(Urefurir”j¸h„]r•hhah‚]r–h~]r—h€]r˜h†]r™h/auhn]ršubeubaubjm)r›}rœ(hsXS`mock documentation as PDF `_rhtjbhuhxhzjqh|}rž(h~]rŸh€]r h‚]r¡h„]r¢h†]r£uhˆNh‰hhn]r¤hË)r¥}r¦(hsXS`mock documentation as PDF `_r§htj›huhxhzhÏh|}r¨(h~]r©h€]rªh‚]r«h„]r¬h†]r­uhˆKlhn]r®(h×)r¯}r°(hsj§h|}r±(Unamer²Xmock documentation as PDFr³hÝX4http://www.voidspace.org.uk/downloads/mock-1.0.0.pdfr´h„]rµh‚]r¶h~]r·h€]r¸h†]r¹uhtj¥hn]rºh—Xmock documentation as PDFr»…r¼}r½(hsUhtj¯ubahzhèubhé)r¾}r¿(hsX7 rÀhíKhtj¥hzhîh|}rÁ(UrefurirÂj´h„]rÃhDah‚]rÄh~]rÅh€]rÆh†]rÇh auhn]rÈubeubaubjm)rÉ}rÊ(hsXL`Google Code Home & Mercurial Repository `_ rËhtjbhuhxhzjqh|}rÌ(h~]rÍh€]rÎh‚]rÏh„]rÐh†]rÑuhˆNh‰hhn]rÒhË)rÓ}rÔ(hsXK`Google Code Home & Mercurial Repository `_rÕhtjÉhuhxhzhÏh|}rÖ(h~]r×h€]rØh‚]rÙh„]rÚh†]rÛuhˆKnhn]rÜ(h×)rÝ}rÞ(hsjÕh|}rß(UnameràX'Google Code Home & Mercurial RepositoryráhÝXhttp://code.google.com/p/mock/râh„]rãh‚]räh~]råh€]ræh†]rçuhtjÓhn]rèh—X'Google Code Home & Mercurial Repositoryré…rê}rë(hsUhtjÝubahzhèubhé)rì}rí(hsX! rîhíKhtjÓhzhîh|}rï(Urefurirðjâh„]rñh`ah‚]ròh~]róh€]rôh†]rõh'auhn]röubeubaubeubjå)r÷}rø(hsUhtj4huhxhzjèh|}rù(h„]rúh‚]rûh~]rüh€]rýh†]rþjü]rÿ(jñX repositoryUindex-2rUtraj‰uhˆKph‰hhn]rubhé)r}r(hsUhtj4huhxhzhîh|}r(h~]rh€]rh‚]rh„]r jah†]r uhˆKph‰hhn]r ubjå)r }r (hsUhtj4huhxhzjèh|}r(h„]rh‚]rh~]rh€]rh†]rjü]r(jñXhgUindex-3rUtraj‰uhˆKrh‰hhn]rubhé)r}r(hsUhtj4huhxhzhîh|}r(h„]rh‚]rh~]rh€]rh†]rj juhˆKrh‰hhn]r ubhË)r!}r"(hsXuYou can checkout the latest development version from the Google Code Mercurial repository with the following command:r#htj4huhxj}r$hzhÏh|}r%(h~]r&h€]r'h‚]r(h„]r)jah†]r*uhˆKsh‰hj}r+jjshn]r,h—XuYou can checkout the latest development version from the Google Code Mercurial repository with the following command:r-…r.}r/(hsj#htj!ubaubcdocutils.nodes block_quote r0)r1}r2(hsUhtj4huhxhzU block_quoter3h|}r4(h~]r5h€]r6h‚]r7h„]r8h†]r9uhˆNh‰hhn]r:hË)r;}r<(hsX1``hg clone https://mock.googlecode.com/hg/ mock``r=htj1huhxhzhÏh|}r>(h~]r?h€]r@h‚]rAh„]rBh†]rCuhˆKvhn]rDjq)rE}rF(hsj=h|}rG(h~]rHh€]rIh‚]rJh„]rKh†]rLuhtj;hn]rMh—X-hg clone https://mock.googlecode.com/hg/ mockrN…rO}rP(hsUhtjEubahzj€ubaubaubjå)rQ}rR(hsUhtj4huhxhzjèh|}rS(h„]rTh‚]rUh~]rVh€]rWh†]rXjü]rY(jñXpipUindex-4rZUtr[aj‰uhˆKyh‰hhn]r\ubhé)r]}r^(hsUhtj4huhxhzhîh|}r_(h~]r`h€]rah‚]rbh„]rcjZah†]rduhˆKyh‰hhn]reubjå)rf}rg(hsUhtj4huhxhzjèh|}rh(h„]rih‚]rjh~]rkh€]rlh†]rmjü]rn(jñX easy_installUindex-5roUtrpaj‰uhˆKzh‰hhn]rqubhé)rr}rs(hsUhtj4huhxhzhîh|}rt(h~]ruh€]rvh‚]rwh„]rxjoah†]ryuhˆKzh‰hhn]rzubjå)r{}r|(hsUhtj4huhxhzjèh|}r}(h„]r~h‚]rh~]r€h€]rh†]r‚jü]rƒ(jñX setuptoolsUindex-6r„Utr…aj‰uhˆK|h‰hhn]r†ubhé)r‡}rˆ(hsUhtj4huhxhzhîh|}r‰(h„]rŠh‚]r‹h~]rŒh€]rh†]rŽj j„uhˆK|h‰hhn]rubhË)r}r‘(hsXDIf you have pip, setuptools or distribute you can install mock with:r’htj4huhxj}r“hzhÏh|}r”(h~]r•h€]r–h‚]r—h„]r˜j„ah†]r™uhˆK}h‰hj}ršj„j‡shn]r›h—XDIf you have pip, setuptools or distribute you can install mock with:rœ…r}rž(hsj’htjubaubj0)rŸ}r (hsUhtj4huhxhzj3h|}r¡(h~]r¢h€]r£h‚]r¤h„]r¥h†]r¦uhˆNh‰hhn]r§cdocutils.nodes line_block r¨)r©}rª(hsUh|}r«(h~]r¬h€]r­h‚]r®h„]r¯h†]r°uhtjŸhn]r±(cdocutils.nodes line r²)r³}r´(hsX``easy_install -U mock``rµUindentr¶Khtj©hzhˆh|}r·(h~]r¸h€]r¹h‚]rºh„]r»h†]r¼uhn]r½jq)r¾}r¿(hsjµh|}rÀ(h~]rÁh€]rÂh‚]rÃh„]rÄh†]rÅuhtj³hn]rÆh—Xeasy_install -U mockrÇ…rÈ}rÉ(hsUhtj¾ubahzj€ubaubj²)rÊ}rË(hsX``pip install -U mock``rÌj¶Khtj©hzhˆh|}rÍ(h~]rÎh€]rÏh‚]rÐh„]rÑh†]rÒuhn]rÓjq)rÔ}rÕ(hsjÌh|}rÖ(h~]r×h€]rØh‚]rÙh„]rÚh†]rÛuhtjÊhn]rÜh—Xpip install -U mockrÝ…rÞ}rß(hsUhtjÔubahzj€ubaubehzU line_blockràubaubhË)rá}râ(hsXWAlternatively you can download the mock distribution from PyPI and after unpacking run:rãhtj4huhxhzhÏh|}rä(h~]råh€]ræh‚]rçh„]rèh†]réuhˆK‚h‰hhn]rêh—XWAlternatively you can download the mock distribution from PyPI and after unpacking run:rë…rì}rí(hsjãhtjáubaubj0)rî}rï(hsUhtj4huhxhzj3h|}rð(h~]rñh€]ròh‚]róh„]rôh†]rõuhˆNh‰hhn]röhË)r÷}rø(hsX``python setup.py install``rùhtjîhuhxhzhÏh|}rú(h~]rûh€]rüh‚]rýh„]rþh†]rÿuhˆK…hn]rjq)r}r(hsjùh|}r(h~]rh€]rh‚]rh„]rh†]ruhtj÷hn]r h—Xpython setup.py installr …r }r (hsUhtjubahzj€ubaubaubeubhp)r }r(hsUhíKhthqhuhxhzh{h|}r(h~]rh€]rh‚]rh„]rh]ah†]rh$auhˆK‰h‰hhn]r(h‹)r}r(hsX Quick Guiderhtj huhxhzhh|}r(h~]rh€]rh‚]rh„]rh†]ruhˆK‰h‰hhn]rh—X Quick Guider …r!}r"(hsjhtjubaubhË)r#}r$(hsX :class:`Mock` and :class:`MagicMock` objects create all attributes and methods as you access them and store details of how they have been used. You can configure them, to specify return values or limit what attributes are available, and then make assertions about how they have been used:r%htj huhxhzhÏh|}r&(h~]r'h€]r(h‚]r)h„]r*h†]r+uhˆK‹h‰hhn]r,(jX)r-}r.(hsX :class:`Mock`r/htj#huhxhzj\h|}r0(Ureftyper1Xclassr2j`‰jaXMockr3U refdomainr4Xpyr5h„]r6h‚]r7U refexplicitr8‰h~]r9h€]r:h†]r;jkjljmNjnjouhˆK‹hn]r<jq)r=}r>(hsj/h|}r?(h~]r@h€]rA(jwj5Xpy-classrBeh‚]rCh„]rDh†]rEuhtj-hn]rFh—XMockrG…rH}rI(hsUhtj=ubahzj€ubaubh—X and rJ…rK}rL(hsX and rMhtj#ubjX)rN}rO(hsX:class:`MagicMock`rPhtj#huhxhzj\h|}rQ(UreftyperRXclassrSj`‰jaX MagicMockrTU refdomainrUXpyrVh„]rWh‚]rXU refexplicitrY‰h~]rZh€]r[h†]r\jkjljmNjnjouhˆK‹hn]r]jq)r^}r_(hsjPh|}r`(h~]rah€]rb(jwjVXpy-classrceh‚]rdh„]reh†]rfuhtjNhn]rgh—X MagicMockrh…ri}rj(hsUhtj^ubahzj€ubaubh—Xü objects create all attributes and methods as you access them and store details of how they have been used. You can configure them, to specify return values or limit what attributes are available, and then make assertions about how they have been used:rk…rl}rm(hsXü objects create all attributes and methods as you access them and store details of how they have been used. You can configure them, to specify return values or limit what attributes are available, and then make assertions about how they have been used:rnhtj#ubeubcdocutils.nodes literal_block ro)rp}rq(hsXÌ>>> from mock import MagicMock >>> thing = ProductionClass() >>> thing.method = MagicMock(return_value=3) >>> thing.method(3, 4, 5, key='value') 3 >>> thing.method.assert_called_with(3, 4, 5, key='value')rrhtj huhxhzU literal_blockrsh|}rt(U testnodetyperuXdoctestrvjžjŸh„]rwh‚]rxh~]ryh€]rzh†]r{Ugroupsr|]r}j§aj¨}r~uhˆKh‰hhn]rh—XÌ>>> from mock import MagicMock >>> thing = ProductionClass() >>> thing.method = MagicMock(return_value=3) >>> thing.method(3, 4, 5, key='value') 3 >>> thing.method.assert_called_with(3, 4, 5, key='value')r€…r}r‚(hsUhtjpubaubhË)rƒ}r„(hsXm:attr:`side_effect` allows you to perform side effects, including raising an exception when a mock is called:r…htj huhxhzhÏh|}r†(h~]r‡h€]rˆh‚]r‰h„]rŠh†]r‹uhˆK™h‰hhn]rŒ(jX)r}rŽ(hsX:attr:`side_effect`rhtjƒhuhxhzj\h|}r(Ureftyper‘Xattrr’j`‰jaX side_effectr“U refdomainr”Xpyr•h„]r–h‚]r—U refexplicitr˜‰h~]r™h€]ršh†]r›jkjljmNjnjouhˆK™hn]rœjq)r}rž(hsjh|}rŸ(h~]r h€]r¡(jwj•Xpy-attrr¢eh‚]r£h„]r¤h†]r¥uhtjhn]r¦h—X side_effectr§…r¨}r©(hsUhtjubahzj€ubaubh—XZ allows you to perform side effects, including raising an exception when a mock is called:rª…r«}r¬(hsXZ allows you to perform side effects, including raising an exception when a mock is called:r­htjƒubeubjo)r®}r¯(hsXl>>> mock = Mock(side_effect=KeyError('foo')) >>> mock() Traceback (most recent call last): ... KeyError: 'foo' >>> values = {'a': 1, 'b': 2, 'c': 3} >>> def side_effect(arg): ... return values[arg] ... >>> mock.side_effect = side_effect >>> mock('a'), mock('b'), mock('c') (1, 2, 3) >>> mock.side_effect = [5, 4, 3, 2, 1] >>> mock(), mock(), mock() (5, 4, 3)r°htj huhxhzjsh|}r±(U testnodetyper²Xdoctestr³jžjŸh„]r´h‚]rµh~]r¶h€]r·h†]r¸Ugroupsr¹]rºj§aj¨}r»uhˆKœh‰hhn]r¼h—Xl>>> mock = Mock(side_effect=KeyError('foo')) >>> mock() Traceback (most recent call last): ... KeyError: 'foo' >>> values = {'a': 1, 'b': 2, 'c': 3} >>> def side_effect(arg): ... return values[arg] ... >>> mock.side_effect = side_effect >>> mock('a'), mock('b'), mock('c') (1, 2, 3) >>> mock.side_effect = [5, 4, 3, 2, 1] >>> mock(), mock(), mock() (5, 4, 3)r½…r¾}r¿(hsUhtj®ubaubhË)rÀ}rÁ(hsX#Mock has many other ways you can configure it and control its behaviour. For example the `spec` argument configures the mock to take its specification from another object. Attempting to access attributes or methods on the mock that don't exist on the spec will fail with an `AttributeError`.rÂhtj huhxhzhÏh|}rÃ(h~]rÄh€]rÅh‚]rÆh„]rÇh†]rÈuhˆK¯h‰hhn]rÉ(h—XYMock has many other ways you can configure it and control its behaviour. For example the rÊ…rË}rÌ(hsXYMock has many other ways you can configure it and control its behaviour. For example the rÍhtjÀubjv)rÎ}rÏ(hsX`spec`rÐh|}rÑ(h~]rÒh€]rÓh‚]rÔh„]rÕh†]rÖuhtjÀhn]r×h—XspecrØ…rÙ}rÚ(hsUhtjÎubahzj„ubh—X³ argument configures the mock to take its specification from another object. Attempting to access attributes or methods on the mock that don't exist on the spec will fail with an rÛ…rÜ}rÝ(hsX³ argument configures the mock to take its specification from another object. Attempting to access attributes or methods on the mock that don't exist on the spec will fail with an rÞhtjÀubjv)rß}rà(hsX`AttributeError`ráh|}râ(h~]rãh€]räh‚]råh„]ræh†]rçuhtjÀhn]rèh—XAttributeErrorré…rê}rë(hsUhtjßubahzj„ubh—X.…rì}rí(hsX.htjÀubeubhË)rî}rï(hsXåThe :func:`patch` decorator / context manager makes it easy to mock classes or objects in a module under test. The object you specify will be replaced with a mock (or other object) during the test and restored when the test ends:rðhtj huhxhzhÏh|}rñ(h~]ròh€]róh‚]rôh„]rõh†]röuhˆK´h‰hhn]r÷(h—XThe rø…rù}rú(hsXThe rûhtjîubjX)rü}rý(hsX :func:`patch`rþhtjîhuhxhzj\h|}rÿ(UreftyperXfuncrj`‰jaXpatchrU refdomainrXpyrh„]rh‚]rU refexplicitr‰h~]rh€]r h†]r jkjljmNjnjouhˆK´hn]r jq)r }r (hsjþh|}r(h~]rh€]r(jwjXpy-funcreh‚]rh„]rh†]ruhtjühn]rh—Xpatch()r…r}r(hsUhtj ubahzj€ubaubh—XÔ decorator / context manager makes it easy to mock classes or objects in a module under test. The object you specify will be replaced with a mock (or other object) during the test and restored when the test ends:r…r}r(hsXÔ decorator / context manager makes it easy to mock classes or objects in a module under test. The object you specify will be replaced with a mock (or other object) during the test and restored when the test ends:rhtjîubeubjo)r}r(hsXh>>> from mock import patch >>> @patch('module.ClassName2') ... @patch('module.ClassName1') ... def test(MockClass1, MockClass2): ... module.ClassName1() ... module.ClassName2() ... assert MockClass1 is module.ClassName1 ... assert MockClass2 is module.ClassName2 ... assert MockClass1.called ... assert MockClass2.called ... >>> test()rhtj huhxhzjsh|}r (U testnodetyper!Xdoctestr"jžjŸh„]r#h‚]r$h~]r%h€]r&h†]r'Ugroupsr(]r)j§aj¨}r*uhˆK¸h‰hhn]r+h—Xh>>> from mock import patch >>> @patch('module.ClassName2') ... @patch('module.ClassName1') ... def test(MockClass1, MockClass2): ... module.ClassName1() ... module.ClassName2() ... assert MockClass1 is module.ClassName1 ... assert MockClass2 is module.ClassName2 ... assert MockClass1.called ... assert MockClass2.called ... >>> test()r,…r-}r.(hsUhtjubaubcdocutils.nodes note r/)r0}r1(hsXÔWhen you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal *python* order that decorators are applied). This means from the bottom up, so in the example above the mock for `module.ClassName1` is passed in first. With `patch` it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read :ref:`where to patch `.r2htj huhxhzUnoter3h|}r4(h~]r5h€]r6h‚]r7h„]r8h†]r9uhˆNh‰hhn]r:(hË)r;}r<(hsXWhen you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal *python* order that decorators are applied). This means from the bottom up, so in the example above the mock for `module.ClassName1` is passed in first.r=htj0huhxhzhÏh|}r>(h~]r?h€]r@h‚]rAh„]rBh†]rCuhˆKÊhn]rD(h—X|When you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal rE…rF}rG(hsX|When you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal rHhtj;ubcdocutils.nodes emphasis rI)rJ}rK(hsX*python*rLh|}rM(h~]rNh€]rOh‚]rPh„]rQh†]rRuhtj;hn]rSh—XpythonrT…rU}rV(hsUhtjJubahzUemphasisrWubh—Xi order that decorators are applied). This means from the bottom up, so in the example above the mock for rX…rY}rZ(hsXi order that decorators are applied). This means from the bottom up, so in the example above the mock for r[htj;ubjv)r\}r](hsX`module.ClassName1`r^h|}r_(h~]r`h€]rah‚]rbh„]rch†]rduhtj;hn]reh—Xmodule.ClassName1rf…rg}rh(hsUhtj\ubahzj„ubh—X is passed in first.ri…rj}rk(hsX is passed in first.rlhtj;ubeubhË)rm}rn(hsX¾With `patch` it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read :ref:`where to patch `.rohtj0huhxhzhÏh|}rp(h~]rqh€]rrh‚]rsh„]rth†]ruuhˆKÏhn]rv(h—XWith rw…rx}ry(hsXWith rzhtjmubjv)r{}r|(hsX`patch`r}h|}r~(h~]rh€]r€h‚]rh„]r‚h†]rƒuhtjmhn]r„h—Xpatchr……r†}r‡(hsUhtj{ubahzj„ubh—X‹ it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read rˆ…r‰}rŠ(hsX‹ it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read r‹htjmubjX)rŒ}r(hsX&:ref:`where to patch `rŽhtjmhuhxhzj\h|}r(UreftyperXrefr‘j`ˆjaXwhere-to-patchr’U refdomainr“Xstdr”h„]r•h‚]r–U refexplicitr—ˆh~]r˜h€]r™h†]ršjkjluhˆKÏhn]r›jI)rœ}r(hsjŽh|}rž(h~]rŸh€]r (jwj”Xstd-refr¡eh‚]r¢h„]r£h†]r¤uhtjŒhn]r¥h—Xwhere to patchr¦…r§}r¨(hsUhtjœubahzjWubaubh—X.…r©}rª(hsX.htjmubeubeubhË)r«}r¬(hsXTAs well as a decorator `patch` can be used as a context manager in a with statement:r­htj huhxhzhÏh|}r®(h~]r¯h€]r°h‚]r±h„]r²h†]r³uhˆKÓh‰hhn]r´(h—XAs well as a decorator rµ…r¶}r·(hsXAs well as a decorator r¸htj«ubjv)r¹}rº(hsX`patch`r»h|}r¼(h~]r½h€]r¾h‚]r¿h„]rÀh†]rÁuhtj«hn]rÂh—XpatchrÃ…rÄ}rÅ(hsUhtj¹ubahzj„ubh—X6 can be used as a context manager in a with statement:rÆ…rÇ}rÈ(hsX6 can be used as a context manager in a with statement:rÉhtj«ubeubjo)rÊ}rË(hsXÈ>>> with patch.object(ProductionClass, 'method', return_value=None) as mock_method: ... thing = ProductionClass() ... thing.method(1, 2, 3) ... >>> mock_method.assert_called_once_with(1, 2, 3)rÌhtj huhxhzjsh|}rÍ(U testnodetyperÎXdoctestrÏjžjŸh„]rÐh‚]rÑh~]rÒh€]rÓh†]rÔUgroupsrÕ]rÖj§aj¨}r×uhˆKÖh‰hhn]rØh—XÈ>>> with patch.object(ProductionClass, 'method', return_value=None) as mock_method: ... thing = ProductionClass() ... thing.method(1, 2, 3) ... >>> mock_method.assert_called_once_with(1, 2, 3)rÙ…rÚ}rÛ(hsUhtjÊubaubhË)rÜ}rÝ(hsXžThere is also :func:`patch.dict` for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends:rÞhtj huhxhzhÏh|}rß(h~]ràh€]ráh‚]râh„]rãh†]räuhˆKßh‰hhn]rå(h—XThere is also ræ…rç}rè(hsXThere is also réhtjÜubjX)rê}rë(hsX:func:`patch.dict`rìhtjÜhuhxhzj\h|}rí(UreftyperîXfuncrïj`‰jaX patch.dictrðU refdomainrñXpyròh„]róh‚]rôU refexplicitrõ‰h~]röh€]r÷h†]røjkjljmNjnjouhˆKßhn]rùjq)rú}rû(hsjìh|}rü(h~]rýh€]rþ(jwjòXpy-funcrÿeh‚]r h„]r h†]r uhtjêhn]r h—X patch.dict()r …r }r (hsUhtjúubahzj€ubaubh—X~ for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends:r …r }r (hsX~ for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends:r htjÜubeubjo)r }r (hsX¾>>> foo = {'key': 'value'} >>> original = foo.copy() >>> with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == originalr htj huhxhzjsh|}r (U testnodetyper Xdoctestr jžjŸh„]r h‚]r h~]r h€]r h†]r Ugroupsr ]r j§aj¨}r uhˆKãh‰hhn]r h—X¾>>> foo = {'key': 'value'} >>> original = foo.copy() >>> with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == originalr …r }r (hsUhtj ubaubhË)r }r (hsX·Mock supports the mocking of Python :ref:`magic methods `. The easiest way of using magic methods is with the :class:`MagicMock` class. It allows you to do things like:r htj huhxhzhÏh|}r (h~]r! h€]r" h‚]r# h„]r$ h†]r% uhˆKìh‰hhn]r& (h—X$Mock supports the mocking of Python r' …r( }r) (hsX$Mock supports the mocking of Python r* htj ubjX)r+ }r, (hsX$:ref:`magic methods `r- htj huhxhzj\h|}r. (Ureftyper/ Xrefr0 j`ˆjaX magic-methodsr1 U refdomainr2 Xstdr3 h„]r4 h‚]r5 U refexplicitr6 ˆh~]r7 h€]r8 h†]r9 jkjluhˆKìhn]r: jI)r; }r< (hsj- h|}r= (h~]r> h€]r? (jwj3 Xstd-refr@ eh‚]rA h„]rB h†]rC uhtj+ hn]rD h—X magic methodsrE …rF }rG (hsUhtj; ubahzjWubaubh—X5. The easiest way of using magic methods is with the rH …rI }rJ (hsX5. The easiest way of using magic methods is with the rK htj ubjX)rL }rM (hsX:class:`MagicMock`rN htj huhxhzj\h|}rO (UreftyperP XclassrQ j`‰jaX MagicMockrR U refdomainrS XpyrT h„]rU h‚]rV U refexplicitrW ‰h~]rX h€]rY h†]rZ jkjljmNjnjouhˆKìhn]r[ jq)r\ }r] (hsjN h|}r^ (h~]r_ h€]r` (jwjT Xpy-classra eh‚]rb h„]rc h†]rd uhtjL hn]re h—X MagicMockrf …rg }rh (hsUhtj\ ubahzj€ubaubh—X( class. It allows you to do things like:ri …rj }rk (hsX( class. It allows you to do things like:rl htj ubeubjo)rm }rn (hsX‚>>> mock = MagicMock() >>> mock.__str__.return_value = 'foobarbaz' >>> str(mock) 'foobarbaz' >>> mock.__str__.assert_called_with()ro htj huhxhzjsh|}rp (U testnodetyperq Xdoctestrr jžjŸh„]rs h‚]rt h~]ru h€]rv h†]rw Ugroupsrx ]ry j§aj¨}rz uhˆKðh‰hhn]r{ h—X‚>>> mock = MagicMock() >>> mock.__str__.return_value = 'foobarbaz' >>> str(mock) 'foobarbaz' >>> mock.__str__.assert_called_with()r| …r} }r~ (hsUhtjm ubaubhË)r }r€ (hsXüMock allows you to assign functions (or other Mock instances) to magic methods and they will be called appropriately. The `MagicMock` class is just a Mock variant that has all of the magic methods pre-created for you (well, all the useful ones anyway).r htj huhxhzhÏh|}r‚ (h~]rƒ h€]r„ h‚]r… h„]r† h†]r‡ uhˆKøh‰hhn]rˆ (h—XzMock allows you to assign functions (or other Mock instances) to magic methods and they will be called appropriately. The r‰ …rŠ }r‹ (hsXzMock allows you to assign functions (or other Mock instances) to magic methods and they will be called appropriately. The rŒ htj ubjv)r }rŽ (hsX `MagicMock`r h|}r (h~]r‘ h€]r’ h‚]r“ h„]r” h†]r• uhtj hn]r– h—X MagicMockr— …r˜ }r™ (hsUhtj ubahzj„ubh—Xw class is just a Mock variant that has all of the magic methods pre-created for you (well, all the useful ones anyway).rš …r› }rœ (hsXw class is just a Mock variant that has all of the magic methods pre-created for you (well, all the useful ones anyway).r htj ubeubhË)rž }rŸ (hsXPThe following is an example of using magic methods with the ordinary Mock class:r  htj huhxhzhÏh|}r¡ (h~]r¢ h€]r£ h‚]r¤ h„]r¥ h†]r¦ uhˆKýh‰hhn]r§ h—XPThe following is an example of using magic methods with the ordinary Mock class:r¨ …r© }rª (hsj  htjž ubaubjo)r« }r¬ (hsX[>>> mock = Mock() >>> mock.__str__ = Mock(return_value='wheeeeee') >>> str(mock) 'wheeeeee'r­ htj huhxhzjsh|}r® (U testnodetyper¯ Xdoctestr° jžjŸh„]r± h‚]r² h~]r³ h€]r´ h†]rµ Ugroupsr¶ ]r· j§aj¨}r¸ uhˆMh‰hhn]r¹ h—X[>>> mock = Mock() >>> mock.__str__ = Mock(return_value='wheeeeee') >>> str(mock) 'wheeeeee'rº …r» }r¼ (hsUhtj« ubaubhË)r½ }r¾ (hsXÜFor ensuring that the mock objects in your tests have the same api as the objects they are replacing, you can use :ref:`auto-speccing `. Auto-speccing can be done through the `autospec` argument to patch, or the :func:`create_autospec` function. Auto-speccing creates mock objects that have the same attributes and methods as the objects they are replacing, and any functions and methods (including constructors) have the same call signature as the real object.r¿ htj huhxhzhÏh|}rÀ (h~]rÁ h€]r h‚]rà h„]rÄ h†]rÅ uhˆMh‰hhn]rÆ (h—XrFor ensuring that the mock objects in your tests have the same api as the objects they are replacing, you can use rÇ …rÈ }rÉ (hsXrFor ensuring that the mock objects in your tests have the same api as the objects they are replacing, you can use rÊ htj½ ubjX)rË }rÌ (hsX$:ref:`auto-speccing `rÍ htj½ huhxhzj\h|}rÎ (UreftyperÏ XrefrÐ j`ˆjaX auto-speccingrÑ U refdomainrÒ XstdrÓ h„]rÔ h‚]rÕ U refexplicitrÖ ˆh~]r× h€]rØ h†]rÙ jkjluhˆMhn]rÚ jI)rÛ }rÜ (hsjÍ h|}rÝ (h~]rÞ h€]rß (jwjÓ Xstd-refrà eh‚]rá h„]râ h†]rã uhtjË hn]rä h—X auto-speccingrå …ræ }rç (hsUhtjÛ ubahzjWubaubh—X(. Auto-speccing can be done through the rè …ré }rê (hsX(. Auto-speccing can be done through the rë htj½ ubjv)rì }rí (hsX `autospec`rî h|}rï (h~]rð h€]rñ h‚]rò h„]ró h†]rô uhtj½ hn]rõ h—Xautospecrö …r÷ }rø (hsUhtjì ubahzj„ubh—X argument to patch, or the rù …rú }rû (hsX argument to patch, or the rü htj½ ubjX)rý }rþ (hsX:func:`create_autospec`rÿ htj½ huhxhzj\h|}r (Ureftyper Xfuncr j`‰jaXcreate_autospecr U refdomainr Xpyr h„]r h‚]r U refexplicitr ‰h~]r h€]r h†]r jkjljmNjnjouhˆMhn]r jq)r }r (hsjÿ h|}r (h~]r h€]r (jwj Xpy-funcr eh‚]r h„]r h†]r uhtjý hn]r h—Xcreate_autospec()r …r }r (hsUhtj ubahzj€ubaubh—Xâ function. Auto-speccing creates mock objects that have the same attributes and methods as the objects they are replacing, and any functions and methods (including constructors) have the same call signature as the real object.r …r }r (hsXâ function. Auto-speccing creates mock objects that have the same attributes and methods as the objects they are replacing, and any functions and methods (including constructors) have the same call signature as the real object.r htj½ ubeubhË)r }r (hsXlThis ensures that your mocks will fail in the same way as your production code if they are used incorrectly:r htj huhxhzhÏh|}r! (h~]r" h€]r# h‚]r$ h„]r% h†]r& uhˆMh‰hhn]r' h—XlThis ensures that your mocks will fail in the same way as your production code if they are used incorrectly:r( …r) }r* (hsj htj ubaubjo)r+ }r, (hsXq>>> from mock import create_autospec >>> def function(a, b, c): ... pass ... >>> mock_function = create_autospec(function, return_value='fishy') >>> mock_function(1, 2, 3) 'fishy' >>> mock_function.assert_called_once_with(1, 2, 3) >>> mock_function('wrong arguments') Traceback (most recent call last): ... TypeError: () takes exactly 3 arguments (1 given)r- htj huhxhzjsh|}r. (U testnodetyper/ Xdoctestr0 jžjŸh„]r1 h‚]r2 h~]r3 h€]r4 h†]r5 Ugroupsr6 ]r7 j§aj¨}r8 uhˆMh‰hhn]r9 h—Xq>>> from mock import create_autospec >>> def function(a, b, c): ... pass ... >>> mock_function = create_autospec(function, return_value='fishy') >>> mock_function(1, 2, 3) 'fishy' >>> mock_function.assert_called_once_with(1, 2, 3) >>> mock_function('wrong arguments') Traceback (most recent call last): ... TypeError: () takes exactly 3 arguments (1 given)r: …r; }r< (hsUhtj+ ubaubhË)r= }r> (hsX¶`create_autospec` can also be used on classes, where it copies the signature of the `__init__` method, and on callable objects where it copies the signature of the `__call__` method.r? htj huhxhzhÏh|}r@ (h~]rA h€]rB h‚]rC h„]rD h†]rE uhˆM!h‰hhn]rF (jv)rG }rH (hsX`create_autospec`rI h|}rJ (h~]rK h€]rL h‚]rM h„]rN h†]rO uhtj= hn]rP h—Xcreate_autospecrQ …rR }rS (hsUhtjG ubahzj„ubh—XC can also be used on classes, where it copies the signature of the rT …rU }rV (hsXC can also be used on classes, where it copies the signature of the rW htj= ubjv)rX }rY (hsX `__init__`rZ h|}r[ (h~]r\ h€]r] h‚]r^ h„]r_ h†]r` uhtj= hn]ra h—X__init__rb …rc }rd (hsUhtjX ubahzj„ubh—XF method, and on callable objects where it copies the signature of the re …rf }rg (hsXF method, and on callable objects where it copies the signature of the rh htj= ubjv)ri }rj (hsX `__call__`rk h|}rl (h~]rm h€]rn h‚]ro h„]rp h†]rq uhtj= hn]rr h—X__call__rs …rt }ru (hsUhtji ubahzj„ubh—X method.rv …rw }rx (hsX method.ry htj= ubeubjå)rz }r{ (hsUhtj huhxhzjèh|}r| (h„]r} h‚]r~ h~]r h€]r€ h†]r jü]r‚ (jñX referencesUindex-7rƒ Utr„ aj‰uhˆM&h‰hhn]r… ubhé)r† }r‡ (hsUhtj huhxhzhîh|}rˆ (h~]r‰ h€]rŠ h‚]r‹ h„]rŒ jƒ ah†]r uhˆM&h‰hhn]rŽ ubjå)r }r (hsUhtj huhxhzjèh|}r‘ (h„]r’ h‚]r“ h~]r” h€]r• h†]r– jü]r— (jñXarticlesUindex-8r˜ Utr™ aj‰uhˆM(h‰hhn]rš ubhé)r› }rœ (hsUhtj huhxhzhîh|}r (h„]rž h‚]rŸ h~]r  h€]r¡ h†]r¢ j j˜ uhˆM(h‰hhn]r£ ubeubhp)r¤ }r¥ (hsUhthqhuhxj}r¦ hzh{h|}r§ (h~]r¨ h€]r© h‚]rª h„]r« (hFj˜ eh†]r¬ hauhˆM*h‰hj}r­ j˜ j› shn]r® (h‹)r¯ }r° (hsX Referencesr± htj¤ huhxhzhh|}r² (h~]r³ h€]r´ h‚]rµ h„]r¶ h†]r· uhˆM*h‰hhn]r¸ h—X Referencesr¹ …rº }r» (hsj± htj¯ ubaubhË)r¼ }r½ (hsXDArticles, blog entries and other stuff related to testing with Mock:r¾ htj¤ huhxhzhÏh|}r¿ (h~]rÀ h€]rÁ h‚]r h„]rà h†]rÄ uhˆM,h‰hhn]rÅ h—XDArticles, blog entries and other stuff related to testing with Mock:rÆ …rÇ }rÈ (hsj¾ htj¼ ubaubja)rÉ }rÊ (hsUhtj¤ huhxhzjdh|}rË (jfX*h„]rÌ h‚]rÍ h~]rÎ h€]rÏ h†]rÐ uhˆM.h‰hhn]rÑ (jm)rÒ }rÓ (hsXŠ`Imposing a No DB Discipline on Django unit tests `_rÔ htjÉ huhxhzjqh|}rÕ (h~]rÖ h€]r× h‚]rØ h„]rÙ h†]rÚ uhˆNh‰hhn]rÛ hË)rÜ }rÝ (hsXŠ`Imposing a No DB Discipline on Django unit tests `_rÞ htjÒ huhxhzhÏh|}rß (h~]rà h€]rá h‚]râ h„]rã h†]rä uhˆM.hn]rå (h×)ræ }rç (hsjÞ h|}rè (Unameré X0Imposing a No DB Discipline on Django unit testsrê hÝXThttps://github.com/carljm/django-testing-slides/blob/master/models/30_no_database.mdrë h„]rì h‚]rí h~]rî h€]rï h†]rð uhtjÜ hn]rñ h—X0Imposing a No DB Discipline on Django unit testsrò …ró }rô (hsUhtjæ ubahzhèubhé)rõ }rö (hsXW r÷ híKhtjÜ hzhîh|}rø (Urefurirù jë h„]rú hTah‚]rû h~]rü h€]rý h†]rþ hauhn]rÿ ubeubaubjm)r }r (hsXd`mock-django: tools for mocking the Django ORM and models `_r htjÉ huhxhzjqh|}r (h~]r h€]r h‚]r h„]r h†]r uhˆNh‰hhn]r hË)r }r (hsXd`mock-django: tools for mocking the Django ORM and models `_r htj huhxhzhÏh|}r (h~]r h€]r h‚]r h„]r h†]r uhˆM0hn]r (h×)r }r (hsj h|}r (Unamer X8mock-django: tools for mocking the Django ORM and modelsr hÝX&https://github.com/dcramer/mock-djangor h„]r h‚]r h~]r h€]r h†]r uhtj hn]r h—X8mock-django: tools for mocking the Django ORM and modelsr …r! }r" (hsUhtj ubahzhèubhé)r# }r$ (hsX) r% híKhtj hzhîh|}r& (Urefurir' j h„]r( hIah‚]r) h~]r* h€]r+ h†]r, hauhn]r- ubeubaubjm)r. }r/ (hsXE`PyCon 2011 Video: Testing with mock `_r0 htjÉ huhxhzjqh|}r1 (h~]r2 h€]r3 h‚]r4 h„]r5 h†]r6 uhˆNh‰hhn]r7 hË)r8 }r9 (hsj0 htj. huhxhzhÏh|}r: (h~]r; h€]r< h‚]r= h„]r> h†]r? uhˆM2hn]r@ (h×)rA }rB (hsj0 h|}rC (UnamerD X#PyCon 2011 Video: Testing with mockrE hÝXhttps://blip.tv/file/4881513rF h„]rG h‚]rH h~]rI h€]rJ h†]rK uhtj8 hn]rL h—X#PyCon 2011 Video: Testing with mockrM …rN }rO (hsUhtjA ubahzhèubhé)rP }rQ (hsX rR híKhtj8 hzhîh|}rS (UrefurirT jF h„]rU hmah‚]rV h~]rW h€]rX h†]rY h4auhn]rZ ubeubaubjm)r[ }r\ (hsXX`Mock objects in Python `_r] htjÉ huhxhzjqh|}r^ (h~]r_ h€]r` h‚]ra h„]rb h†]rc uhˆNh‰hhn]rd hË)re }rf (hsXX`Mock objects in Python `_rg htj[ huhxhzhÏh|}rh (h~]ri h€]rj h‚]rk h„]rl h†]rm uhˆM3hn]rn (h×)ro }rp (hsjg h|}rq (Unamerr XMock objects in Pythonrs hÝX<http://noopenblockers.com/2012/01/06/mock-objects-in-python/rt h„]ru h‚]rv h~]rw h€]rx h†]ry uhtje hn]rz h—XMock objects in Pythonr{ …r| }r} (hsUhtjo ubahzhèubhé)r~ }r (hsX? r€ híKhtje hzhîh|}r (Urefurir‚ jt h„]rƒ hCah‚]r„ h~]r… h€]r† h†]r‡ h auhn]rˆ ubeubaubjm)r‰ }rŠ (hsX–`Python: Injecting Mock Objects for Powerful Testing `_r‹ htjÉ huhxhzjqh|}rŒ (h~]r h€]rŽ h‚]r h„]r h†]r‘ uhˆNh‰hhn]r’ hË)r“ }r” (hsX–`Python: Injecting Mock Objects for Powerful Testing `_r• htj‰ huhxhzhÏh|}r– (h~]r— h€]r˜ h‚]r™ h„]rš h†]r› uhˆM5hn]rœ (h×)r }rž (hsj• h|}rŸ (Unamer  X3Python: Injecting Mock Objects for Powerful Testingr¡ hÝX]http://blueprintforge.com/blog/2012/01/08/python-injecting-mock-objects-for-powerful-testing/r¢ h„]r£ h‚]r¤ h~]r¥ h€]r¦ h†]r§ uhtj“ hn]r¨ h—X3Python: Injecting Mock Objects for Powerful Testingr© …rª }r« (hsUhtj ubahzhèubhé)r¬ }r­ (hsX` r® híKhtj“ hzhîh|}r¯ (Urefurir° j¢ h„]r± hYah‚]r² h~]r³ h€]r´ h†]rµ h auhn]r¶ ubeubaubjm)r· }r¸ (hsX”`Python Mock: How to assert a substring of logger output `_r¹ htjÉ huhxhzjqh|}rº (h~]r» h€]r¼ h‚]r½ h„]r¾ h†]r¿ uhˆNh‰hhn]rÀ hË)rÁ }r (hsX”`Python Mock: How to assert a substring of logger output `_rà htj· huhxhzhÏh|}rÄ (h~]rÅ h€]rÆ h‚]rÇ h„]rÈ h†]rÉ uhˆM7hn]rÊ (h×)rË }rÌ (hsjà h|}rÍ (UnamerÎ X7Python Mock: How to assert a substring of logger outputrÏ hÝXWhttp://www.michaelpollmeier.com/python-mock-how-to-assert-a-substring-of-logger-output/rÐ h„]rÑ h‚]rÒ h~]rÓ h€]rÔ h†]rÕ uhtjÁ hn]rÖ h—X7Python Mock: How to assert a substring of logger outputr× …rØ }rÙ (hsUhtjË ubahzhèubhé)rÚ }rÛ (hsXZ rÜ híKhtjÁ hzhîh|}rÝ (UrefurirÞ jÐ h„]rß hQah‚]rà h~]rá h€]râ h†]rã hauhn]rä ubeubaubjm)rå }ræ (hsXL`Mocking Django `_rç htjÉ huhxhzjqh|}rè (h~]ré h€]rê h‚]rë h„]rì h†]rí uhˆNh‰hhn]rî hË)rï }rð (hsjç htjå huhxhzhÏh|}rñ (h~]rò h€]ró h‚]rô h„]rõ h†]rö uhˆM9hn]r÷ (h×)rø }rù (hsjç h|}rú (Unamerû XMocking Djangorü hÝX8http://www.mattjmorrison.com/2011/09/mocking-django.htmlrý h„]rþ h‚]rÿ h~]r h€]r h†]r uhtjï hn]r h—XMocking Djangor …r }r (hsUhtjø ubahzhèubhé)r }r (hsX; r híKhtjï hzhîh|}r (Urefurir jý h„]r hZah‚]r h~]r h€]r h†]r h!auhn]r ubeubaubjm)r }r (hsX—`Mocking dates and other classes that can't be modified `_r htjÉ huhxhzjqh|}r (h~]r h€]r h‚]r h„]r h†]r uhˆNh‰hhn]r hË)r }r (hsX—`Mocking dates and other classes that can't be modified `_r htj huhxhzhÏh|}r (h~]r h€]r! h‚]r" h„]r# h†]r$ uhˆM:hn]r% (h×)r& }r' (hsj h|}r( (Unamer) X6Mocking dates and other classes that can't be modifiedr* hÝX[http://williamjohnbert.com/2011/07/how-to-unit-testing-in-django-with-mocking-and-patching/r+ h„]r, h‚]r- h~]r. h€]r/ h†]r0 uhtj hn]r1 h—X6Mocking dates and other classes that can't be modifiedr2 …r3 }r4 (hsUhtj& ubahzhèubhé)r5 }r6 (hsX^ r7 híKhtj hzhîh|}r8 (Urefurir9 j+ h„]r: hkah‚]r; h~]r< h€]r= h†]r> h2auhn]r? ubeubaubjm)r@ }rA (hsXG`Mock recipes `_rB htjÉ huhxhzjqh|}rC (h~]rD h€]rE h‚]rF h„]rG h†]rH uhˆNh‰hhn]rI hË)rJ }rK (hsjB htj@ huhxhzhÏh|}rL (h~]rM h€]rN h‚]rO h„]rP h†]rQ uhˆM<hn]rR (h×)rS }rT (hsjB h|}rU (UnamerV X Mock recipesrW hÝX5http://konryd.blogspot.com/2010/06/mock-recipies.htmlrX h„]rY h‚]rZ h~]r[ h€]r\ h†]r] uhtjJ hn]r^ h—X Mock recipesr_ …r` }ra (hsUhtjS ubahzhèubhé)rb }rc (hsX8 rd híKhtjJ hzhîh|}re (Urefurirf jX h„]rg hAah‚]rh h~]ri h€]rj h†]rk h auhn]rl ubeubaubjm)rm }rn (hsXƒ`Mockity mock mock - some love for the mock module `_ro htjÉ huhxhzjqh|}rp (h~]rq h€]rr h‚]rs h„]rt h†]ru uhˆNh‰hhn]rv hË)rw }rx (hsXƒ`Mockity mock mock - some love for the mock module `_ry htjm huhxhzhÏh|}rz (h~]r{ h€]r| h‚]r} h„]r~ h†]r uhˆM=hn]r€ (h×)r }r‚ (hsjy h|}rƒ (Unamer„ X1Mockity mock mock - some love for the mock moduler… hÝXLhttp://konryd.blogspot.com/2010/05/mockity-mock-mock-some-love-for-mock.htmlr† h„]r‡ h‚]rˆ h~]r‰ h€]rŠ h†]r‹ uhtjw hn]rŒ h—X1Mockity mock mock - some love for the mock moduler …rŽ }r (hsUhtj ubahzhèubhé)r }r‘ (hsXO r’ híKhtjw hzhîh|}r“ (Urefurir” j† h„]r• h>ah‚]r– h~]r— h€]r˜ h†]r™ hauhn]rš ubeubaubjm)r› }rœ (hsXT`Coverage and Mock (with django) `_r htjÉ huhxhzjqh|}rž (h~]rŸ h€]r  h‚]r¡ h„]r¢ h†]r£ uhˆNh‰hhn]r¤ hË)r¥ }r¦ (hsXT`Coverage and Mock (with django) `_r§ htj› huhxhzhÏh|}r¨ (h~]r© h€]rª h‚]r« h„]r¬ h†]r­ uhˆM?hn]r® (h×)r¯ }r° (hsj§ h|}r± (Unamer² XCoverage and Mock (with django)r³ hÝX/http://mattsnider.com/python/mock-and-coverage/r´ h„]rµ h‚]r¶ h~]r· h€]r¸ h†]r¹ uhtj¥ hn]rº h—XCoverage and Mock (with django)r» …r¼ }r½ (hsUhtj¯ ubahzhèubhé)r¾ }r¿ (hsX2 rÀ híKhtj¥ hzhîh|}rÁ (Urefurir j´ h„]rà hjah‚]rÄ h~]rÅ h€]rÆ h†]rÇ h1auhn]rÈ ubeubaubjm)rÉ }rÊ (hsXD`Python Unit Testing with Mock `_rË htjÉ huhxhzjqh|}rÌ (h~]rÍ h€]rÎ h‚]rÏ h„]rÐ h†]rÑ uhˆNh‰hhn]rÒ hË)rÓ }rÔ (hsjË htjÉ huhxhzhÏh|}rÕ (h~]rÖ h€]r× h‚]rØ h„]rÙ h†]rÚ uhˆMAhn]rÛ (h×)rÜ }rÝ (hsjË h|}rÞ (Unamerß XPython Unit Testing with Mockrà hÝX!http://www.insomnihack.com/?p=194rá h„]râ h‚]rã h~]rä h€]rå h†]ræ uhtjÓ hn]rç h—XPython Unit Testing with Mockrè …ré }rê (hsUhtjÜ ubahzhèubhé)rë }rì (hsX$ rí híKhtjÓ hzhîh|}rî (Urefurirï já h„]rð hLah‚]rñ h~]rò h€]ró h†]rô hauhn]rõ ubeubaubjm)rö }r÷ (hsXz`Getting started with Python Mock `_rø htjÉ huhxhzjqh|}rù (h~]rú h€]rû h‚]rü h„]rý h†]rþ uhˆNh‰hhn]rÿ hË)r }r (hsXz`Getting started with Python Mock `_r htjö huhxhzhÏh|}r (h~]r h€]r h‚]r h„]r h†]r uhˆMBhn]r (h×)r }r (hsj h|}r (Unamer X Getting started with Python Mockr hÝXThttp://myadventuresincoding.wordpress.com/2011/02/26/python-python-mock-cheat-sheet/r h„]r h‚]r h~]r h€]r h†]r uhtj hn]r h—X Getting started with Python Mockr …r }r (hsUhtj ubahzhèubhé)r }r (hsXW r híKhtj hzhîh|}r (Urefurir j h„]r h\ah‚]r h~]r h€]r! h†]r" h#auhn]r# ubeubaubjm)r$ }r% (hsX]`Smart Parameter Checks with mock `_r& htjÉ huhxhzjqh|}r' (h~]r( h€]r) h‚]r* h„]r+ h†]r, uhˆNh‰hhn]r- hË)r. }r/ (hsX]`Smart Parameter Checks with mock `_r0 htj$ huhxhzhÏh|}r1 (h~]r2 h€]r3 h‚]r4 h„]r5 h†]r6 uhˆMDhn]r7 (h×)r8 }r9 (hsj0 h|}r: (Unamer; X Smart Parameter Checks with mockr< hÝX7http://tobyho.com/2011/03/24/smart-parameter-checks-in/r= h„]r> h‚]r? h~]r@ h€]rA h†]rB uhtj. hn]rC h—X Smart Parameter Checks with mockrD …rE }rF (hsUhtj8 ubahzhèubhé)rG }rH (hsX: rI híKhtj. hzhîh|}rJ (UrefurirK j= h„]rL h^ah‚]rM h~]rN h€]rO h†]rP h%auhn]rQ ubeubaubjm)rR }rS (hsX~`Python mock testing techniques and tools `_rT htjÉ huhxhzjqh|}rU (h~]rV h€]rW h‚]rX h„]rY h†]rZ uhˆNh‰hhn]r[ hË)r\ }r] (hsX~`Python mock testing techniques and tools `_r^ htjR huhxhzhÏh|}r_ (h~]r` h€]ra h‚]rb h„]rc h†]rd uhˆMFhn]re (h×)rf }rg (hsj^ h|}rh (Unameri X(Python mock testing techniques and toolsrj hÝXPhttp://agiletesting.blogspot.com/2009/07/python-mock-testing-techniques-and.htmlrk h„]rl h‚]rm h~]rn h€]ro h†]rp uhtj\ hn]rq h—X(Python mock testing techniques and toolsrr …rs }rt (hsUhtjf ubahzhèubhé)ru }rv (hsXS rw híKhtj\ hzhîh|}rx (Urefuriry jk h„]rz hcah‚]r{ h~]r| h€]r} h†]r~ h*auhn]r ubeubaubjm)r€ }r (hsX]`How To Test Django Template Tags `_r‚ htjÉ huhxhzjqh|}rƒ (h~]r„ h€]r… h‚]r† h„]r‡ h†]rˆ uhˆNh‰hhn]r‰ hË)rŠ }r‹ (hsX]`How To Test Django Template Tags `_rŒ htj€ huhxhzhÏh|}r (h~]rŽ h€]r h‚]r h„]r‘ h†]r’ uhˆMHhn]r“ (h×)r” }r• (hsjŒ h|}r– (Unamer— X How To Test Django Template Tagsr˜ hÝX7http://techblog.ironfroggy.com/2008/10/how-to-test.htmlr™ h„]rš h‚]r› h~]rœ h€]r h†]rž uhtjŠ hn]rŸ h—X How To Test Django Template Tagsr  …r¡ }r¢ (hsUhtj” ubahzhèubhé)r£ }r¤ (hsX: r¥ híKhtjŠ hzhîh|}r¦ (Urefurir§ j™ h„]r¨ hbah‚]r© h~]rª h€]r« h†]r¬ h)auhn]r­ ubeubaubjm)r® }r¯ (hsXy`A presentation on Unit Testing with Mock `_r° htjÉ huhxhzjqh|}r± (h~]r² h€]r³ h‚]r´ h„]rµ h†]r¶ uhˆNh‰hhn]r· hË)r¸ }r¹ (hsXy`A presentation on Unit Testing with Mock `_rº htj® huhxhzhÏh|}r» (h~]r¼ h€]r½ h‚]r¾ h„]r¿ h†]rÀ uhˆMJhn]rÁ (h×)r }rà (hsjº h|}rÄ (UnamerÅ X(A presentation on Unit Testing with MockrÆ hÝXKhttp://pypap.blogspot.com/2008/10/newbie-nugget-unit-testing-with-mock.htmlrÇ h„]rÈ h‚]rÉ h~]rÊ h€]rË h†]rÌ uhtj¸ hn]rÍ h—X(A presentation on Unit Testing with MockrÎ …rÏ }rÐ (hsUhtj ubahzhèubhé)rÑ }rÒ (hsXN rÓ híKhtj¸ hzhîh|}rÔ (UrefurirÕ jÇ h„]rÖ hMah‚]r× h~]rØ h€]rÙ h†]rÚ hauhn]rÛ ubeubaubjm)rÜ }rÝ (hsX„`Mocking with Django and Google AppEngine `_ rÞ htjÉ huhxhzjqh|}rß (h~]rà h€]rá h‚]râ h„]rã h†]rä uhˆNh‰hhn]rå hË)ræ }rç (hsX‚`Mocking with Django and Google AppEngine `_rè htjÜ huhxhzhÏh|}ré (h~]rê h€]rë h‚]rì h„]rí h†]rî uhˆMLhn]rï (h×)rð }rñ (hsjè h|}rò (Unameró X(Mocking with Django and Google AppEnginerô hÝXThttp://michael-a-nelson.blogspot.com/2008/09/mocking-with-django-and-google-app.htmlrõ h„]rö h‚]r÷ h~]rø h€]rù h†]rú uhtjæ hn]rû h—X(Mocking with Django and Google AppEnginerü …rý }rþ (hsUhtjð ubahzhèubhé)rÿ }r(hsXW rhíKhtjæ hzhîh|}r(Urefurirjõ h„]rh@ah‚]rh~]rh€]rh†]rhauhn]r ubeubaubeubjå)r }r (hsUhtj¤ huhxhzjèh|}r (h„]r h‚]rh~]rh€]rh†]rjü]r(jñXtestsUindex-9rUtraj‰uhˆMPh‰hhn]rubhé)r}r(hsUhtj¤ huhxhzhîh|}r(h~]rh€]rh‚]rh„]rjah†]ruhˆMPh‰hhn]rubjå)r}r (hsUhtj¤ huhxhzjèh|}r!(h„]r"h‚]r#h~]r$h€]r%h†]r&jü]r'(jñX unittest2Uindex-10r(Utr)aj‰uhˆMRh‰hhn]r*ubhé)r+}r,(hsUhtj¤ huhxhzhîh|}r-(h„]r.h‚]r/h~]r0h€]r1h†]r2j j(uhˆMRh‰hhn]r3ubeubhp)r4}r5(hsUhthqhuhxj}r6hzh{h|}r7(h~]r8h€]r9h‚]r:h„]r;(hUj(eh†]r<hauhˆMTh‰hj}r=j(j+shn]r>(h‹)r?}r@(hsXTestsrAhtj4huhxhzhh|}rB(h~]rCh€]rDh‚]rEh„]rFh†]rGuhˆMTh‰hhn]rHh—XTestsrI…rJ}rK(hsjAhtj?ubaubhË)rL}rM(hsXÌMock uses `unittest2 `_ for its own test suite. In order to run it, use the `unit2` script that comes with `unittest2` module on a checkout of the source repository:rNhtj4huhxhzhÏh|}rO(h~]rPh€]rQh‚]rRh„]rSh†]rTuhˆMVh‰hhn]rU(h—X Mock uses rV…rW}rX(hsX Mock uses rYhtjLubh×)rZ}r[(hsX4`unittest2 `_r\h|}r](Unamer^X unittest2r_hÝX%http://pypi.python.org/pypi/unittest2r`h„]rah‚]rbh~]rch€]rdh†]reuhtjLhn]rfh—X unittest2rg…rh}ri(hsUhtjZubahzhèubhé)rj}rk(hsX( rlhíKhtjLhzhîh|}rm(Urefurirnj`h„]rohiah‚]rph~]rqh€]rrh†]rsh0auhn]rtubh—X5 for its own test suite. In order to run it, use the ru…rv}rw(hsX5 for its own test suite. In order to run it, use the rxhtjLubjv)ry}rz(hsX`unit2`r{h|}r|(h~]r}h€]r~h‚]rh„]r€h†]ruhtjLhn]r‚h—Xunit2rƒ…r„}r…(hsUhtjyubahzj„ubh—X script that comes with r†…r‡}rˆ(hsX script that comes with r‰htjLubjv)rŠ}r‹(hsX `unittest2`rŒh|}r(h~]rŽh€]rh‚]rh„]r‘h†]r’uhtjLhn]r“h—X unittest2r”…r•}r–(hsUhtjŠubahzj„ubh—X/ module on a checkout of the source repository:r—…r˜}r™(hsX/ module on a checkout of the source repository:ršhtjLubeubj0)r›}rœ(hsUhtj4huhxhzj3h|}r(h~]ržh€]rŸh‚]r h„]r¡h†]r¢uhˆNh‰hhn]r£hË)r¤}r¥(hsX`unit2 discover`r¦htj›huhxhzhÏh|}r§(h~]r¨h€]r©h‚]rªh„]r«h†]r¬uhˆMZhn]r­jv)r®}r¯(hsj¦h|}r°(h~]r±h€]r²h‚]r³h„]r´h†]rµuhtj¤hn]r¶h—Xunit2 discoverr·…r¸}r¹(hsUhtj®ubahzj„ubaubaubhË)rº}r»(hsXdIf you have `setuptools `_ as well as unittest2 you can run:r¼htj4huhxhzhÏh|}r½(h~]r¾h€]r¿h‚]rÀh„]rÁh†]rÂuhˆM\h‰hhn]rÃ(h—X If you have rÄ…rÅ}rÆ(hsX If you have rÇhtjºubh×)rÈ}rÉ(hsX6`setuptools `_rÊh|}rË(UnamerÌX setuptoolsrÍhÝX&http://pypi.python.org/pypi/distributerÎh„]rÏh‚]rÐh~]rÑh€]rÒh†]rÓuhtjºhn]rÔh—X setuptoolsrÕ…rÖ}r×(hsUhtjÈubahzhèubhé)rØ}rÙ(hsX) rÚhíKhtjºhzhîh|}rÛ(UrefurirÜjÎh„]rÝhgah‚]rÞh~]rßh€]ràh†]ráh.auhn]râubh—X" as well as unittest2 you can run:rã…rä}rå(hsX" as well as unittest2 you can run:ræhtjºubeubj0)rç}rè(hsUhtj4huhxhzj3h|}ré(h~]rêh€]rëh‚]rìh„]ríh†]rîuhˆNh‰hhn]rïhË)rð}rñ(hsX``python setup.py test``ròhtjçhuhxhzhÏh|}ró(h~]rôh€]rõh‚]röh„]r÷h†]røuhˆM_hn]rùjq)rú}rû(hsjòh|}rü(h~]rýh€]rþh‚]rÿh„]rh†]ruhtjðhn]rh—Xpython setup.py testr…r}r(hsUhtjúubahzj€ubaubaubhË)r}r(hsXHOn Python 3.2 you can use ``unittest`` module from the standard library.rhtj4huhxhzhÏh|}r (h~]r h€]r h‚]r h„]r h†]ruhˆMah‰hhn]r(h—XOn Python 3.2 you can use r…r}r(hsXOn Python 3.2 you can use rhtjubjq)r}r(hsX ``unittest``rh|}r(h~]rh€]rh‚]rh„]rh†]ruhtjhn]rh—Xunittestr…r}r (hsUhtjubahzj€ubh—X" module from the standard library.r!…r"}r#(hsX" module from the standard library.r$htjubeubj0)r%}r&(hsUhtj4huhxhzj3h|}r'(h~]r(h€]r)h‚]r*h„]r+h†]r,uhˆNh‰hhn]r-hË)r.}r/(hsX"``python3.2 -m unittest discover``r0htj%huhxhzhÏh|}r1(h~]r2h€]r3h‚]r4h„]r5h†]r6uhˆMchn]r7jq)r8}r9(hsj0h|}r:(h~]r;h€]r<h‚]r=h„]r>h†]r?uhtj.hn]r@h—Xpython3.2 -m unittest discoverrA…rB}rC(hsUhtj8ubahzj€ubaubaubjå)rD}rE(hsUhtj4huhxhzjèh|}rF(h„]rGh‚]rHh~]rIh€]rJh†]rKjü]rL(jñXPython 3Uindex-11rMUtrNaj‰uhˆMfh‰hhn]rOubhé)rP}rQ(hsUhtj4huhxhzhîh|}rR(h„]rSh‚]rTh~]rUh€]rVh†]rWj jMuhˆMfh‰hhn]rXubhË)rY}rZ(hsX»On Python 3 the tests for unicode are skipped as they are not relevant. On Python 2.4 tests that use the with statements are skipped as the with statement is invalid syntax on Python 2.4.r[htj4huhxj}r\hzhÏh|}r](h~]r^h€]r_h‚]r`h„]rajMah†]rbuhˆMgh‰hj}rcjMjPshn]rdh—X»On Python 3 the tests for unicode are skipped as they are not relevant. On Python 2.4 tests that use the with statements are skipped as the with statement is invalid syntax on Python 2.4.re…rf}rg(hsj[htjYubaubjå)rh}ri(hsUhtj4huhxhzjèh|}rj(h„]rkh‚]rlh~]rmh€]rnh†]rojü]rp(jñXolder versionsUindex-12rqUtrraj‰uhˆMmh‰hhn]rsubhé)rt}ru(hsUhtj4huhxhzhîh|}rv(h„]rwh‚]rxh~]ryh€]rzh†]r{j jquhˆMmh‰hhn]r|ubeubhp)r}}r~(hsUhthqhuhxj}rhzh{h|}r€(h~]rh€]r‚h‚]rƒh„]r„(hOjqeh†]r…hauhˆMoh‰hj}r†jqjtshn]r‡(h‹)rˆ}r‰(hsXOlder VersionsrŠhtj}huhxhzhh|}r‹(h~]rŒh€]rh‚]rŽh„]rh†]ruhˆMoh‰hhn]r‘h—XOlder Versionsr’…r“}r”(hsjŠhtjˆubaubhË)r•}r–(hsX)Documentation for older versions of mock:r—htj}huhxhzhÏh|}r˜(h~]r™h€]ršh‚]r›h„]rœh†]ruhˆMqh‰hhn]ržh—X)Documentation for older versions of mock:rŸ…r }r¡(hsj—htj•ubaubja)r¢}r£(hsUhtj}huhxhzjdh|}r¤(jfX*h„]r¥h‚]r¦h~]r§h€]r¨h†]r©uhˆMsh‰hhn]rª(jm)r«}r¬(hsX:`mock 0.8 `_r­htj¢huhxhzjqh|}r®(h~]r¯h€]r°h‚]r±h„]r²h†]r³uhˆNh‰hhn]r´hË)rµ}r¶(hsj­htj«huhxhzhÏh|}r·(h~]r¸h€]r¹h‚]rºh„]r»h†]r¼uhˆMshn]r½(h×)r¾}r¿(hsj­h|}rÀ(UnamerÁXmock 0.8rÂhÝX,http://www.voidspace.org.uk/python/mock/0.8/rÃh„]rÄh‚]rÅh~]rÆh€]rÇh†]rÈuhtjµhn]rÉh—Xmock 0.8rÊ…rË}rÌ(hsUhtj¾ubahzhèubhé)rÍ}rÎ(hsX/ rÏhíKhtjµhzhîh|}rÐ(UrefurirÑjÃh„]rÒhEah‚]rÓh~]rÔh€]rÕh†]rÖh auhn]r×ubeubaubjm)rØ}rÙ(hsX:`mock 0.7 `_rÚhtj¢huhxhzjqh|}rÛ(h~]rÜh€]rÝh‚]rÞh„]rßh†]ràuhˆNh‰hhn]ráhË)râ}rã(hsjÚhtjØhuhxhzhÏh|}rä(h~]råh€]ræh‚]rçh„]rèh†]réuhˆMthn]rê(h×)rë}rì(hsjÚh|}rí(UnamerîXmock 0.7rïhÝX,http://www.voidspace.org.uk/python/mock/0.7/rðh„]rñh‚]ròh~]róh€]rôh†]rõuhtjâhn]röh—Xmock 0.7r÷…rø}rù(hsUhtjëubahzhèubhé)rú}rû(hsX/ rühíKhtjâhzhîh|}rý(Urefurirþjðh„]rÿhRah‚]rh~]rh€]rh†]rhauhn]rubeubaubjm)r}r(hsX=`mock 0.6 `_ rhtj¢huhxhzjqh|}r(h~]r h€]r h‚]r h„]r h†]r uhˆNh‰hhn]rhË)r}r(hsX<`mock 0.6 `_rhtjhuhxhzhÏh|}r(h~]rh€]rh‚]rh„]rh†]ruhˆMuhn]r(h×)r}r(hsjh|}r(UnamerXmock 0.6rhÝX.http://www.voidspace.org.uk/python/mock/0.6.0/rh„]rh‚]r h~]r!h€]r"h†]r#uhtjhn]r$h—Xmock 0.6r%…r&}r'(hsUhtjubahzhèubhé)r(}r)(hsX1 r*híKhtjhzhîh|}r+(Urefurir,jh„]r-hHah‚]r.h~]r/h€]r0h†]r1hauhn]r2ubeubaubeubhË)r3}r4(hsXuDocs from the in-development version of `mock` can be found at `mock.readthedocs.org `_.r5htj}huhxhzhÏh|}r6(h~]r7h€]r8h‚]r9h„]r:h†]r;uhˆMwh‰hhn]r<(h—X(Docs from the in-development version of r=…r>}r?(hsX(Docs from the in-development version of r@htj3ubjv)rA}rB(hsX`mock`rCh|}rD(h~]rEh€]rFh‚]rGh„]rHh†]rIuhtj3hn]rJh—XmockrK…rL}rM(hsUhtjAubahzj„ubh—X can be found at rN…rO}rP(hsX can be found at rQhtj3ubh×)rR}rS(hsX5`mock.readthedocs.org `_rTh|}rU(UnamerVXmock.readthedocs.orgrWhÝXhttp://mock.readthedocs.orgrXh„]rYh‚]rZh~]r[h€]r\h†]r]uhtj3hn]r^h—Xmock.readthedocs.orgr_…r`}ra(hsUhtjRubahzhèubhé)rb}rc(hsX rdhíKhtj3hzhîh|}re(UrefurirfjXh„]rghWah‚]rhh~]rih€]rjh†]rkhauhn]rlubh—X.…rm}rn(hsX.htj3ubeubeubhp)ro}rp(hsUhthqhuhxhzh{h|}rq(h~]rrh€]rsh‚]rth„]ruhlah†]rvh3auhˆM|h‰hhn]rw(h‹)rx}ry(hsX Terminologyrzhtjohuhxhzhh|}r{(h~]r|h€]r}h‚]r~h„]rh†]r€uhˆM|h‰hhn]rh—X Terminologyr‚…rƒ}r„(hsjzhtjxubaubhË)r…}r†(hsX•Terminology for objects used to replace other ones can be confusing. Terms like double, fake, mock, stub, and spy are all used with varying meanings.r‡htjohuhxhzhÏh|}rˆ(h~]r‰h€]rŠh‚]r‹h„]rŒh†]ruhˆM~h‰hhn]rŽh—X•Terminology for objects used to replace other ones can be confusing. Terms like double, fake, mock, stub, and spy are all used with varying meanings.r…r}r‘(hsj‡htj…ubaubhË)r’}r“(hsX"In `classic mock terminology `_ :class:`mock.Mock` is a `spy `_ that allows for *post-mortem* examination. This is what I call the "action -> assertion" [#]_ pattern of testing.r”htjohuhxhzhÏh|}r•(h~]r–h€]r—h‚]r˜h„]r™h†]ršuhˆMh‰hhn]r›(h—XIn rœ…r}rž(hsXIn rŸhtj’ubh×)r }r¡(hsXc`classic mock terminology `_r¢h|}r£(Unamer¤Xclassic mock terminologyr¥hÝXEhttp://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.htmlr¦h„]r§h‚]r¨h~]r©h€]rªh†]r«uhtj’hn]r¬h—Xclassic mock terminologyr­…r®}r¯(hsUhtj ubahzhèubhé)r°}r±(hsXH r²híKhtj’hzhîh|}r³(Urefurir´j¦h„]rµhVah‚]r¶h~]r·h€]r¸h†]r¹hauhn]rºubh—X …r»}r¼(hsX htj’ubjX)r½}r¾(hsX:class:`mock.Mock`r¿htj’huhxhzj\h|}rÀ(UreftyperÁXclassrÂj`‰jaX mock.MockrÃU refdomainrÄXpyrÅh„]rÆh‚]rÇU refexplicitrȉh~]rÉh€]rÊh†]rËjkjljmNjnjouhˆMhn]rÌjq)rÍ}rÎ(hsj¿h|}rÏ(h~]rÐh€]rÑ(jwjÅXpy-classrÒeh‚]rÓh„]rÔh†]rÕuhtj½hn]rÖh—X mock.Mockr×…rØ}rÙ(hsUhtjÍubahzj€ubaubh—X is a rÚ…rÛ}rÜ(hsX is a rÝhtj’ubh×)rÞ}rß(hsX1`spy `_ràh|}rá(UnamerâXspyrãhÝX(http://xunitpatterns.com/Test%20Spy.htmlräh„]råh‚]ræh~]rçh€]rèh†]réuhtj’hn]rêh—Xspyrë…rì}rí(hsUhtjÞubahzhèubhé)rî}rï(hsX+ rðhíKhtj’hzhîh|}rñ(Urefuriròjäh„]róh?ah‚]rôh~]rõh€]röh†]r÷hauhn]røubh—X that allows for rù…rú}rû(hsX that allows for rühtj’ubjI)rý}rþ(hsX *post-mortem*rÿh|}r(h~]rh€]rh‚]rh„]rh†]ruhtj’hn]rh—X post-mortemr…r}r (hsUhtjýubahzjWubh—X< examination. This is what I call the "action -> assertion" r …r }r (hsX< examination. This is what I call the "action -> assertion" r htj’ubcdocutils.nodes footnote_reference r)r}r(hsX[#]_rj|Khtj’hzUfootnote_referencerh|}r(UautorKh„]rUid1rah‚]rh~]rh€]rh†]rj hJuhn]rh—X1…r}r(hsUhtjubaubh—X pattern of testing.r…r}r (hsX pattern of testing.r!htj’ubeubhË)r"}r#(hsXI'm not however a fan of this "statically typed mocking terminology" promulgated by `Martin Fowler `_. It confuses usage patterns with implementation and prevents you from using natural terminology when discussing mocking.r$htjohuhxhzhÏh|}r%(h~]r&h€]r'h‚]r(h„]r)h†]r*uhˆM‡h‰hhn]r+(h—XTI'm not however a fan of this "statically typed mocking terminology" promulgated by r,…r-}r.(hsXTI'm not however a fan of this "statically typed mocking terminology" promulgated by r/htj"ubh×)r0}r1(hsXH`Martin Fowler `_r2h|}r3(Unamer4X Martin Fowlerr5hÝX5http://martinfowler.com/articles/mocksArentStubs.htmlr6h„]r7h‚]r8h~]r9h€]r:h†]r;uhtj"hn]r<h—X Martin Fowlerr=…r>}r?(hsUhtj0ubahzhèubhé)r@}rA(hsX8 rBhíKhtj"hzhîh|}rC(UrefurirDj6h„]rEhXah‚]rFh~]rGh€]rHh†]rIhauhn]rJubh—Xy. It confuses usage patterns with implementation and prevents you from using natural terminology when discussing mocking.rK…rL}rM(hsXy. It confuses usage patterns with implementation and prevents you from using natural terminology when discussing mocking.rNhtj"ubeubhË)rO}rP(hsXÆI much prefer duck typing, if an object used in your test suite looks like a mock object and quacks like a mock object then it's fine to call it a mock, no matter what the implementation looks like.rQhtjohuhxhzhÏh|}rR(h~]rSh€]rTh‚]rUh„]rVh†]rWuhˆMh‰hhn]rXh—XÆI much prefer duck typing, if an object used in your test suite looks like a mock object and quacks like a mock object then it's fine to call it a mock, no matter what the implementation looks like.rY…rZ}r[(hsjQhtjOubaubhË)r\}r](hsX%This terminology is perhaps more useful in less capable languages where different usage patterns will *require* different implementations. `mock.Mock()` is capable of being used in most of the different roles described by Fowler, except (annoyingly / frustratingly / ironically) a Mock itself!r^htjohuhxhzhÏh|}r_(h~]r`h€]rah‚]rbh„]rch†]rduhˆM‘h‰hhn]re(h—XfThis terminology is perhaps more useful in less capable languages where different usage patterns will rf…rg}rh(hsXfThis terminology is perhaps more useful in less capable languages where different usage patterns will rihtj\ubjI)rj}rk(hsX *require*rlh|}rm(h~]rnh€]roh‚]rph„]rqh†]rruhtj\hn]rsh—Xrequirert…ru}rv(hsUhtjjubahzjWubh—X different implementations. rw…rx}ry(hsX different implementations. rzhtj\ubjv)r{}r|(hsX `mock.Mock()`r}h|}r~(h~]rh€]r€h‚]rh„]r‚h†]rƒuhtj\hn]r„h—X mock.Mock()r……r†}r‡(hsUhtj{ubahzj„ubh—X is capable of being used in most of the different roles described by Fowler, except (annoyingly / frustratingly / ironically) a Mock itself!rˆ…r‰}rŠ(hsX is capable of being used in most of the different roles described by Fowler, except (annoyingly / frustratingly / ironically) a Mock itself!r‹htj\ubeubhË)rŒ}r(hsXoHow about a simpler definition: a "mock object" is an object used to replace a real one in a system under test.rŽhtjohuhxhzhÏh|}r(h~]rh€]r‘h‚]r’h„]r“h†]r”uhˆM—h‰hhn]r•h—XoHow about a simpler definition: a "mock object" is an object used to replace a real one in a system under test.r–…r—}r˜(hsjŽhtjŒubaubcdocutils.nodes footnote r™)rš}r›(hsX`This pattern is called "AAA" by some members of the testing community; "Arrange - Act - Assert".rœhtjohuhxhzUfootnoterh|}rž(jKh„]rŸhJah‚]r jah~]r¡h€]r¢h†]r£U1auhˆMšh‰hhn]r¤(cdocutils.nodes label r¥)r¦}r§(hsUhtjšhuNhzUlabelr¨h|}r©(h~]rªh€]r«h‚]r¬h„]r­h†]r®uhˆNh‰hhn]r¯h—X1…r°}r±(hsUhtj¦ubaubhË)r²}r³(hsX`This pattern is called "AAA" by some members of the testing community; "Arrange - Act - Assert".r´htjšhuhxhzhÏh|}rµ(h~]r¶h€]r·h‚]r¸h„]r¹h†]rºuhˆMšhn]r»h—X`This pattern is called "AAA" by some members of the testing community; "Arrange - Act - Assert".r¼…r½}r¾(hsj´htj²ubaubeubeubeubahsUU transformerr¿NU footnote_refsrÀ}rÁUrefnamesrÂ}rÃ(X quick guiderÄ]rÅjÕaX mock on pypirÆ]rÇj³aX bsd licenserÈ]rÉj/aX mock homepagerÊ]rËjzauUsymbol_footnotesrÌ]rÍUautofootnote_refsrÎ]rÏjaUsymbol_footnote_refsrÐ]rÑU citationsrÒ]rÓh‰hU current_linerÔNUtransform_messagesrÕ]rÖ(cdocutils.nodes system_message r×)rØ}rÙ(hsUh|}rÚ(h~]rÛUlevelrÜKh„]rÝh‚]rÞUsourcerßhxh€]ràh†]ráUtyperâUINFOrãuhn]rähË)rå}ræ(hsUh|}rç(h~]rèh€]réh‚]rêh„]rëh†]rìuhtjØhn]ríh—X1Hyperlink target "module-mock" is not referenced.rî…rï}rð(hsUhtjåubahzhÏubahzUsystem_messagerñubj×)rò}ró(hsUh|}rô(h~]rõUlevelröKh„]r÷h‚]røUsourcerùhxh€]rúh†]rûUlinerüKUtyperýjãuhn]rþhË)rÿ}r(hsUh|}r(h~]rh€]rh‚]rh„]rh†]ruhtjòhn]rh—X-Hyperlink target "index-0" is not referenced.r…r }r (hsUhtjÿubahzhÏubahzjñubj×)r }r (hsUh|}r (h~]rUlevelrKh„]rh‚]rUsourcerhxh€]rh†]rUlinerKcUtyperjãuhn]rhË)r}r(hsUh|}r(h~]rh€]rh‚]rh„]rh†]ruhtj hn]r h—X-Hyperlink target "index-1" is not referenced.r!…r"}r#(hsUhtjubahzhÏubahzjñubj×)r$}r%(hsUh|}r&(h~]r'Ulevelr(Kh„]r)h‚]r*Usourcer+hxh€]r,h†]r-Uliner.KpUtyper/jãuhn]r0hË)r1}r2(hsUh|}r3(h~]r4h€]r5h‚]r6h„]r7h†]r8uhtj$hn]r9h—X-Hyperlink target "index-2" is not referenced.r:…r;}r<(hsUhtj1ubahzhÏubahzjñubj×)r=}r>(hsUh|}r?(h~]r@UlevelrAKh„]rBh‚]rCUsourcerDhxh€]rEh†]rFUlinerGKrUtyperHjãuhn]rIhË)rJ}rK(hsUh|}rL(h~]rMh€]rNh‚]rOh„]rPh†]rQuhtj=hn]rRh—X-Hyperlink target "index-3" is not referenced.rS…rT}rU(hsUhtjJubahzhÏubahzjñubj×)rV}rW(hsUh|}rX(h~]rYUlevelrZKh„]r[h‚]r\Usourcer]hxh€]r^h†]r_Uliner`KyUtyperajãuhn]rbhË)rc}rd(hsUh|}re(h~]rfh€]rgh‚]rhh„]rih†]rjuhtjVhn]rkh—X-Hyperlink target "index-4" is not referenced.rl…rm}rn(hsUhtjcubahzhÏubahzjñubj×)ro}rp(hsUh|}rq(h~]rrUlevelrsKh„]rth‚]ruUsourcervhxh€]rwh†]rxUlineryKzUtyperzjãuhn]r{hË)r|}r}(hsUh|}r~(h~]rh€]r€h‚]rh„]r‚h†]rƒuhtjohn]r„h—X-Hyperlink target "index-5" is not referenced.r……r†}r‡(hsUhtj|ubahzhÏubahzjñubj×)rˆ}r‰(hsUh|}rŠ(h~]r‹UlevelrŒKh„]rh‚]rŽUsourcerhxh€]rh†]r‘Uliner’K|Utyper“jãuhn]r”hË)r•}r–(hsUh|}r—(h~]r˜h€]r™h‚]ršh„]r›h†]rœuhtjˆhn]rh—X-Hyperlink target "index-6" is not referenced.rž…rŸ}r (hsUhtj•ubahzhÏubahzjñubj×)r¡}r¢(hsUh|}r£(h~]r¤Ulevelr¥Kh„]r¦h‚]r§Usourcer¨hxh€]r©h†]rªUliner«M&Utyper¬jãuhn]r­hË)r®}r¯(hsUh|}r°(h~]r±h€]r²h‚]r³h„]r´h†]rµuhtj¡hn]r¶h—X-Hyperlink target "index-7" is not referenced.r·…r¸}r¹(hsUhtj®ubahzhÏubahzjñubj×)rº}r»(hsUh|}r¼(h~]r½Ulevelr¾Kh„]r¿h‚]rÀUsourcerÁhxh€]rÂh†]rÃUlinerÄM(UtyperÅjãuhn]rÆhË)rÇ}rÈ(hsUh|}rÉ(h~]rÊh€]rËh‚]rÌh„]rÍh†]rÎuhtjºhn]rÏh—X-Hyperlink target "index-8" is not referenced.rÐ…rÑ}rÒ(hsUhtjÇubahzhÏubahzjñubj×)rÓ}rÔ(hsUh|}rÕ(h~]rÖUlevelr×Kh„]rØh‚]rÙUsourcerÚhxh€]rÛh†]rÜUlinerÝMPUtyperÞjãuhn]rßhË)rà}rá(hsUh|}râ(h~]rãh€]räh‚]råh„]ræh†]rçuhtjÓhn]rèh—X-Hyperlink target "index-9" is not referenced.ré…rê}rë(hsUhtjàubahzhÏubahzjñubj×)rì}rí(hsUh|}rî(h~]rïUlevelrðKh„]rñh‚]ròUsourceróhxh€]rôh†]rõUlineröMRUtyper÷jãuhn]røhË)rù}rú(hsUh|}rû(h~]rüh€]rýh‚]rþh„]rÿh†]ruhtjìhn]rh—X.Hyperlink target "index-10" is not referenced.r…r}r(hsUhtjùubahzhÏubahzjñubj×)r}r(hsUh|}r(h~]rUlevelr Kh„]r h‚]r Usourcer hxh€]r h†]rUlinerMfUtyperjãuhn]rhË)r}r(hsUh|}r(h~]rh€]rh‚]rh„]rh†]ruhtjhn]rh—X.Hyperlink target "index-11" is not referenced.r…r}r(hsUhtjubahzhÏubahzjñubj×)r}r(hsUh|}r (h~]r!Ulevelr"Kh„]r#h‚]r$Usourcer%hxh€]r&h†]r'Uliner(MmUtyper)jãuhn]r*hË)r+}r,(hsUh|}r-(h~]r.h€]r/h‚]r0h„]r1h†]r2uhtjhn]r3h—X.Hyperlink target "index-12" is not referenced.r4…r5}r6(hsUhtj+ubahzhÏubahzjñubeUreporterr7NUid_startr8KU autofootnotesr9]r:jšaU citation_refsr;}r<Uindirect_targetsr=]r>Usettingsr?(cdocutils.frontend Values r@orA}rB(Ufootnote_backlinksrCKUrecord_dependenciesrDNU rfc_base_urlrEUhttp://tools.ietf.org/html/rFU tracebackrGˆUpep_referencesrHNUstrip_commentsrINU toc_backlinksrJUentryrKU language_coderLUenrMU datestamprNNU report_levelrOKU _destinationrPNU halt_levelrQKU strip_classesrRNhNUerror_encoding_error_handlerrSUbackslashreplacerTUdebugrUNUembed_stylesheetrV‰Uoutput_encoding_error_handlerrWUstrictrXU sectnum_xformrYKUdump_transformsrZNU docinfo_xformr[KUwarning_streamr\NUpep_file_url_templater]Upep-%04dr^Uexit_status_levelr_KUconfigr`NUstrict_visitorraNUcloak_email_addressesrbˆUtrim_footnote_reference_spacerc‰UenvrdNUdump_pseudo_xmlreNUexpose_internalsrfNUsectsubtitle_xformrg‰U source_linkrhNUrfc_referencesriNUoutput_encodingrjUutf-8rkU source_urlrlNUinput_encodingrmU utf-8-sigrnU_disable_configroNU id_prefixrpUU tab_widthrqKUerror_encodingrrU mac-romanrsU_sourcertU/compile/mock/docs/index.txtruUgettext_compactrvˆU generatorrwNUdump_internalsrxNU pep_base_urlryUhttp://www.python.org/dev/peps/rzUsyntax_highlightr{Ushortr|Uinput_encoding_error_handlerr}jXUauto_id_prefixr~UidrUdoctitle_xformr€‰Ustrip_elements_with_classesrNU _config_filesr‚]rƒUfile_insertion_enabledr„KU raw_enabledr…KU dump_settingsr†NubUsymbol_footnote_startr‡KUidsrˆ}r‰(hKj®hbj£ hmjP h?jîhijjhBjgh>j h_jíhHj(h@jÿ hTjõ jjhVj°hMjÑ hIj# hfjÆhcju h]j hZj hRjúj(j4jMjYjZj]jojrj„jjƒ j† jþj j(j4jjjj!jßjÚhXj@j˜ j¤ jjh[jÐhaj;hUj4hQjÚ hWjbhCj~ hDj¾hEjÍh\j hkj5 hLjë hOj}hShqhAjb hJjšhdjûhPhêhej4h^jG hNj»jqj}hljohgjØhjj¾ hGjwhFj¤ h`jìhhjhYj¬ uUsubstitution_namesrŠ}r‹hzh‰h|}rŒ(h~]rh„]rŽh‚]rUsourcerhxh€]r‘h†]r’uU footnotesr“]r”Urefidsr•}r–(hJ]r—jajq]r˜jtaj(]r™j+ajM]ršjPaj„]r›j‡ajþ]rœjaj(]rj+aj]ržjaj˜ ]rŸj› auub.mock-1.0.1/html/.doctrees/magicmock.doctree0000644000076500001200000022370112046030507021306 0ustar michaeladmin00000000000000€cdocutils.nodes document q)q}q(U nametypesq}q(U2ˆXmock.MagicMockqˆXmock.NonCallableMagicMockqˆXmocking magic methodsqNX magic methodsq ˆU1ˆX magic-methodsq ˆX magic mockq NuUsubstitution_defsq }q Uparse_messagesq]qUcurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q(U2Uid5qhhhhhUmocking-magic-methodsqh Uid1qU1Uid4qh U magic-methodsqh U magic-mockquUchildrenq]q(cdocutils.nodes target q)q}q(U rawsourceq X.. _magic-methods:q!Uparentq"hUsourceq#cdocutils.nodes reprunicode q$X /compile/mock/docs/magicmock.txtq%…q&}q'bUtagnameq(Utargetq)U attributesq*}q+(Uidsq,]q-Ubackrefsq.]q/Udupnamesq0]q1Uclassesq2]q3Unamesq4]q5Urefidq6huUlineq7KUdocumentq8hh]q9ubcdocutils.nodes section q:)q;}q<(h Uh"hh#h&Uexpect_referenced_by_nameq=}q>h hsh(Usectionq?h*}q@(h0]qAh2]qBh.]qCh,]qD(hheh4]qE(hh euh7Kh8hUexpect_referenced_by_idqF}qGhhsh]qH(cdocutils.nodes title qI)qJ}qK(h XMocking Magic MethodsqLh"h;h#h&h(UtitleqMh*}qN(h0]qOh2]qPh.]qQh,]qRh4]qSuh7Kh8hh]qTcdocutils.nodes Text qUXMocking Magic MethodsqV…qW}qX(h hLh"hJubaubcdocutils.nodes paragraph qY)qZ}q[(h XÈ:class:`Mock` supports mocking `magic methods `_. This allows mock objects to replace containers or other objects that implement Python protocols.q\h"h;h#h&h(U paragraphq]h*}q^(h0]q_h2]q`h.]qah,]qbh4]qcuh7K h8hh]qd(csphinx.addnodes pending_xref qe)qf}qg(h X :class:`Mock`qhh"hZh#h&h(U pending_xrefqih*}qj(UreftypeqkXclassqlUrefwarnqm‰U reftargetqnXMockqoU refdomainqpXpyqqh,]qrh.]qsU refexplicitqt‰h0]quh2]qvh4]qwUrefdocqxU magicmockqyUpy:classqzNU py:moduleq{Xmockq|uh7K h]q}cdocutils.nodes literal q~)q}q€(h hhh*}q(h0]q‚h2]qƒ(Uxrefq„hqXpy-classq…eh.]q†h,]q‡h4]qˆuh"hfh]q‰hUXMockqŠ…q‹}qŒ(h Uh"hubah(UliteralqubaubhUX supports mocking qŽ…q}q(h X supports mocking q‘h"hZubcdocutils.nodes reference q’)q“}q”(h XG`magic methods `_q•h*}q–(Unameq—X magic methodsq˜Urefuriq™X4http://www.ironpythoninaction.com/magic-methods.htmlqšh,]q›h.]qœh0]qh2]qžh4]qŸuh"hZh]q hUX magic methodsq¡…q¢}q£(h Uh"h“ubah(U referenceq¤ubh)q¥}q¦(h X7 q§U referencedq¨Kh"hZh(h)h*}q©(Urefuriqªhšh,]q«hah.]q¬h0]q­h2]q®h4]q¯h auh]q°ubhUXb. This allows mock objects to replace containers or other objects that implement Python protocols.q±…q²}q³(h Xb. This allows mock objects to replace containers or other objects that implement Python protocols.q´h"hZubeubhY)qµ}q¶(h XBecause magic methods are looked up differently from normal methods [#]_, this support has been specially implemented. This means that only specific magic methods are supported. The supported list includes *almost* all of them. If there are any missing that you need please let us know!q·h"h;h#h&h(h]h*}q¸(h0]q¹h2]qºh.]q»h,]q¼h4]q½uh7Kh8hh]q¾(hUXDBecause magic methods are looked up differently from normal methods q¿…qÀ}qÁ(h XDBecause magic methods are looked up differently from normal methods qÂh"hµubcdocutils.nodes footnote_reference qÃ)qÄ}qÅ(h X[#]_qÆUresolvedqÇKh"hµh(Ufootnote_referenceqÈh*}qÉ(UautoqÊKh,]qËUid2qÌah.]qÍh0]qÎh2]qÏh4]qÐh6huh]qÑhUX1…qÒ}qÓ(h Uh"hÄubaubhUX†, this support has been specially implemented. This means that only specific magic methods are supported. The supported list includes qÔ…qÕ}qÖ(h X†, this support has been specially implemented. This means that only specific magic methods are supported. The supported list includes q×h"hµubcdocutils.nodes emphasis qØ)qÙ}qÚ(h X*almost*qÛh*}qÜ(h0]qÝh2]qÞh.]qßh,]qàh4]qáuh"hµh]qâhUXalmostqã…qä}qå(h Uh"hÙubah(UemphasisqæubhUXH all of them. If there are any missing that you need please let us know!qç…qè}qé(h XH all of them. If there are any missing that you need please let us know!qêh"hµubeubhY)që}qì(h X¹You mock magic methods by setting the method you are interested in to a function or a mock instance. If you are using a function then it *must* take ``self`` as the first argument [#]_.qíh"h;h#h&h(h]h*}qî(h0]qïh2]qðh.]qñh,]qòh4]qóuh7Kh8hh]qô(hUX‰You mock magic methods by setting the method you are interested in to a function or a mock instance. If you are using a function then it qõ…qö}q÷(h X‰You mock magic methods by setting the method you are interested in to a function or a mock instance. If you are using a function then it qøh"hëubhØ)qù}qú(h X*must*qûh*}qü(h0]qýh2]qþh.]qÿh,]rh4]ruh"hëh]rhUXmustr…r}r(h Uh"hùubah(hæubhUX take r…r}r(h X take r h"hëubh~)r }r (h X``self``r h*}r (h0]rh2]rh.]rh,]rh4]ruh"hëh]rhUXselfr…r}r(h Uh"j ubah(hubhUX as the first argument r…r}r(h X as the first argument rh"hëubhÃ)r}r(h X[#]_rhÇKh"hëh(hÈh*}r(hÊKh,]rUid3r ah.]r!h0]r"h2]r#h4]r$h6huh]r%hUX2…r&}r'(h Uh"jubaubhUX.…r(}r)(h X.h"hëubeubcdocutils.nodes literal_block r*)r+}r,(h X8>>> def __str__(self): ... return 'fooble' ... >>> mock = Mock() >>> mock.__str__ = __str__ >>> str(mock) 'fooble' >>> mock = Mock() >>> mock.__str__ = Mock() >>> mock.__str__.return_value = 'fooble' >>> str(mock) 'fooble' >>> mock = Mock() >>> mock.__iter__ = Mock(return_value=iter([])) >>> list(mock) []r-h"h;h#h&h(U literal_blockr.h*}r/(U testnodetyper0Xdoctestr1U xml:spacer2Upreserver3h,]r4h.]r5h0]r6h2]r7h4]r8Ugroupsr9]r:Udefaultr;aUoptionsr<}r=uh7Kh8hh]r>hUX8>>> def __str__(self): ... return 'fooble' ... >>> mock = Mock() >>> mock.__str__ = __str__ >>> str(mock) 'fooble' >>> mock = Mock() >>> mock.__str__ = Mock() >>> mock.__str__.return_value = 'fooble' >>> str(mock) 'fooble' >>> mock = Mock() >>> mock.__iter__ = Mock(return_value=iter([])) >>> list(mock) []r?…r@}rA(h Uh"j+ubaubhY)rB}rC(h X\One use case for this is for mocking objects used as context managers in a `with` statement:rDh"h;h#h&h(h]h*}rE(h0]rFh2]rGh.]rHh,]rIh4]rJuh7K/h8hh]rK(hUXKOne use case for this is for mocking objects used as context managers in a rL…rM}rN(h XKOne use case for this is for mocking objects used as context managers in a rOh"jBubcdocutils.nodes title_reference rP)rQ}rR(h X`with`rSh*}rT(h0]rUh2]rVh.]rWh,]rXh4]rYuh"jBh]rZhUXwithr[…r\}r](h Uh"jQubah(Utitle_referencer^ubhUX statement:r_…r`}ra(h X statement:rbh"jBubeubj*)rc}rd(h Xý>>> mock = Mock() >>> mock.__enter__ = Mock(return_value='foo') >>> mock.__exit__ = Mock(return_value=False) >>> with mock as m: ... assert m == 'foo' ... >>> mock.__enter__.assert_called_with() >>> mock.__exit__.assert_called_with(None, None, None)reh"h;h#h&h(j.h*}rf(U testnodetypergXdoctestrhj2j3h,]rih.]rjh0]rkh2]rlh4]rmUgroupsrn]roj;aj<}rpuh7K2h8hh]rqhUXý>>> mock = Mock() >>> mock.__enter__ = Mock(return_value='foo') >>> mock.__exit__ = Mock(return_value=False) >>> with mock as m: ... assert m == 'foo' ... >>> mock.__enter__.assert_called_with() >>> mock.__exit__.assert_called_with(None, None, None)rr…rs}rt(h Uh"jcubaubhY)ru}rv(h XvCalls to magic methods do not appear in :attr:`~Mock.method_calls`, but they are recorded in :attr:`~Mock.mock_calls`.rwh"h;h#h&h(h]h*}rx(h0]ryh2]rzh.]r{h,]r|h4]r}uh7K=h8hh]r~(hUX(Calls to magic methods do not appear in r…r€}r(h X(Calls to magic methods do not appear in r‚h"juubhe)rƒ}r„(h X:attr:`~Mock.method_calls`r…h"juh#h&h(hih*}r†(Ureftyper‡Xattrrˆhm‰hnXMock.method_callsr‰U refdomainrŠXpyr‹h,]rŒh.]rU refexplicitrމh0]rh2]rh4]r‘hxhyhzNh{h|uh7K=h]r’h~)r“}r”(h j…h*}r•(h0]r–h2]r—(h„j‹Xpy-attrr˜eh.]r™h,]ršh4]r›uh"jƒh]rœhUX method_callsr…rž}rŸ(h Uh"j“ubah(hubaubhUX, but they are recorded in r …r¡}r¢(h X, but they are recorded in r£h"juubhe)r¤}r¥(h X:attr:`~Mock.mock_calls`r¦h"juh#h&h(hih*}r§(Ureftyper¨Xattrr©hm‰hnXMock.mock_callsrªU refdomainr«Xpyr¬h,]r­h.]r®U refexplicitr¯‰h0]r°h2]r±h4]r²hxhyhzNh{h|uh7K=h]r³h~)r´}rµ(h j¦h*}r¶(h0]r·h2]r¸(h„j¬Xpy-attrr¹eh.]rºh,]r»h4]r¼uh"j¤h]r½hUX mock_callsr¾…r¿}rÀ(h Uh"j´ubah(hubaubhUX.…rÁ}rÂ(h X.h"juubeubcdocutils.nodes note rÃ)rÄ}rÅ(h X”If you use the `spec` keyword argument to create a mock then attempting to set a magic method that isn't in the spec will raise an `AttributeError`.rÆh"h;h#h&h(UnoterÇh*}rÈ(h0]rÉh2]rÊh.]rËh,]rÌh4]rÍuh7Nh8hh]rÎhY)rÏ}rÐ(h X”If you use the `spec` keyword argument to create a mock then attempting to set a magic method that isn't in the spec will raise an `AttributeError`.rÑh"jÄh#h&h(h]h*}rÒ(h0]rÓh2]rÔh.]rÕh,]rÖh4]r×uh7KBh]rØ(hUXIf you use the rÙ…rÚ}rÛ(h XIf you use the rÜh"jÏubjP)rÝ}rÞ(h X`spec`rßh*}rà(h0]ráh2]râh.]rãh,]räh4]råuh"jÏh]ræhUXspecrç…rè}ré(h Uh"jÝubah(j^ubhUXn keyword argument to create a mock then attempting to set a magic method that isn't in the spec will raise an rê…rë}rì(h Xn keyword argument to create a mock then attempting to set a magic method that isn't in the spec will raise an ríh"jÏubjP)rî}rï(h X`AttributeError`rðh*}rñ(h0]ròh2]róh.]rôh,]rõh4]röuh"jÏh]r÷hUXAttributeErrorrø…rù}rú(h Uh"jîubah(j^ubhUX.…rû}rü(h X.h"jÏubeubaubhY)rý}rþ(h X,The full list of supported magic methods is:rÿh"h;h#h&h(h]h*}r(h0]rh2]rh.]rh,]rh4]ruh7KEh8hh]rhUX,The full list of supported magic methods is:r…r}r (h jÿh"jýubaubcdocutils.nodes bullet_list r )r }r (h Uh"h;h#h&h(U bullet_listr h*}r(UbulletrX*h,]rh.]rh0]rh2]rh4]ruh7KGh8hh]r(cdocutils.nodes list_item r)r}r(h X:``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__``rh"j h#h&h(U list_itemrh*}r(h0]rh2]rh.]rh,]rh4]r uh7Nh8hh]r!hY)r"}r#(h jh"jh#h&h(h]h*}r$(h0]r%h2]r&h.]r'h,]r(h4]r)uh7KGh]r*(h~)r+}r,(h X ``__hash__``r-h*}r.(h0]r/h2]r0h.]r1h,]r2h4]r3uh"j"h]r4hUX__hash__r5…r6}r7(h Uh"j+ubah(hubhUX, r8…r9}r:(h X, r;h"j"ubh~)r<}r=(h X``__sizeof__``r>h*}r?(h0]r@h2]rAh.]rBh,]rCh4]rDuh"j"h]rEhUX __sizeof__rF…rG}rH(h Uh"j<ubah(hubhUX, rI…rJ}rK(h X, rLh"j"ubh~)rM}rN(h X ``__repr__``rOh*}rP(h0]rQh2]rRh.]rSh,]rTh4]rUuh"j"h]rVhUX__repr__rW…rX}rY(h Uh"jMubah(hubhUX and rZ…r[}r\(h X and r]h"j"ubh~)r^}r_(h X ``__str__``r`h*}ra(h0]rbh2]rch.]rdh,]reh4]rfuh"j"h]rghUX__str__rh…ri}rj(h Uh"j^ubah(hubeubaubj)rk}rl(h X2``__dir__``, ``__format__`` and ``__subclasses__``rmh"j h#h&h(jh*}rn(h0]roh2]rph.]rqh,]rrh4]rsuh7Nh8hh]rthY)ru}rv(h jmh"jkh#h&h(h]h*}rw(h0]rxh2]ryh.]rzh,]r{h4]r|uh7KHh]r}(h~)r~}r(h X ``__dir__``r€h*}r(h0]r‚h2]rƒh.]r„h,]r…h4]r†uh"juh]r‡hUX__dir__rˆ…r‰}rŠ(h Uh"j~ubah(hubhUX, r‹…rŒ}r(h X, rŽh"juubh~)r}r(h X``__format__``r‘h*}r’(h0]r“h2]r”h.]r•h,]r–h4]r—uh"juh]r˜hUX __format__r™…rš}r›(h Uh"jubah(hubhUX and rœ…r}rž(h X and rŸh"juubh~)r }r¡(h X``__subclasses__``r¢h*}r£(h0]r¤h2]r¥h.]r¦h,]r§h4]r¨uh"juh]r©hUX__subclasses__rª…r«}r¬(h Uh"j ubah(hubeubaubj)r­}r®(h X-``__floor__``, ``__trunc__`` and ``__ceil__``r¯h"j h#h&h(jh*}r°(h0]r±h2]r²h.]r³h,]r´h4]rµuh7Nh8hh]r¶hY)r·}r¸(h j¯h"j­h#h&h(h]h*}r¹(h0]rºh2]r»h.]r¼h,]r½h4]r¾uh7KIh]r¿(h~)rÀ}rÁ(h X ``__floor__``rÂh*}rÃ(h0]rÄh2]rÅh.]rÆh,]rÇh4]rÈuh"j·h]rÉhUX __floor__rÊ…rË}rÌ(h Uh"jÀubah(hubhUX, rÍ…rÎ}rÏ(h X, rÐh"j·ubh~)rÑ}rÒ(h X ``__trunc__``rÓh*}rÔ(h0]rÕh2]rÖh.]r×h,]rØh4]rÙuh"j·h]rÚhUX __trunc__rÛ…rÜ}rÝ(h Uh"jÑubah(hubhUX and rÞ…rß}rà(h X and ráh"j·ubh~)râ}rã(h X ``__ceil__``räh*}rå(h0]ræh2]rçh.]rèh,]réh4]rêuh"j·h]rëhUX__ceil__rì…rí}rî(h Uh"jâubah(hubeubaubj)rï}rð(h XcComparisons: ``__cmp__``, ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and ``__ne__``rñh"j h#h&h(jh*}rò(h0]róh2]rôh.]rõh,]röh4]r÷uh7Nh8hh]røhY)rù}rú(h XcComparisons: ``__cmp__``, ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and ``__ne__``rûh"jïh#h&h(h]h*}rü(h0]rýh2]rþh.]rÿh,]rh4]ruh7KJh]r(hUX Comparisons: r…r}r(h X Comparisons: rh"jùubh~)r}r(h X ``__cmp__``r h*}r (h0]r h2]r h.]r h,]rh4]ruh"jùh]rhUX__cmp__r…r}r(h Uh"jubah(hubhUX, r…r}r(h X, rh"jùubh~)r}r(h X ``__lt__``rh*}r(h0]rh2]rh.]rh,]rh4]r uh"jùh]r!hUX__lt__r"…r#}r$(h Uh"jubah(hubhUX, r%…r&}r'(h X, r(h"jùubh~)r)}r*(h X ``__gt__``r+h*}r,(h0]r-h2]r.h.]r/h,]r0h4]r1uh"jùh]r2hUX__gt__r3…r4}r5(h Uh"j)ubah(hubhUX, r6…r7}r8(h X, r9h"jùubh~)r:}r;(h X ``__le__``r<h*}r=(h0]r>h2]r?h.]r@h,]rAh4]rBuh"jùh]rChUX__le__rD…rE}rF(h Uh"j:ubah(hubhUX, rG…rH}rI(h X, rJh"jùubh~)rK}rL(h X ``__ge__``rMh*}rN(h0]rOh2]rPh.]rQh,]rRh4]rSuh"jùh]rThUX__ge__rU…rV}rW(h Uh"jKubah(hubhUX, rX…rY}rZ(h X, r[h"jùubh~)r\}r](h X ``__eq__``r^h*}r_(h0]r`h2]rah.]rbh,]rch4]rduh"jùh]rehUX__eq__rf…rg}rh(h Uh"j\ubah(hubhUX and ri…rj}rk(h X and rlh"jùubh~)rm}rn(h X ``__ne__``roh*}rp(h0]rqh2]rrh.]rsh,]rth4]ruuh"jùh]rvhUX__ne__rw…rx}ry(h Uh"jmubah(hubeubaubj)rz}r{(h X»Container methods: ``__getitem__``, ``__setitem__``, ``__delitem__``, ``__contains__``, ``__len__``, ``__iter__``, ``__getslice__``, ``__setslice__``, ``__reversed__`` and ``__missing__``r|h"j h#h&h(jh*}r}(h0]r~h2]rh.]r€h,]rh4]r‚uh7Nh8hh]rƒhY)r„}r…(h X»Container methods: ``__getitem__``, ``__setitem__``, ``__delitem__``, ``__contains__``, ``__len__``, ``__iter__``, ``__getslice__``, ``__setslice__``, ``__reversed__`` and ``__missing__``r†h"jzh#h&h(h]h*}r‡(h0]rˆh2]r‰h.]rŠh,]r‹h4]rŒuh7KLh]r(hUXContainer methods: rŽ…r}r(h XContainer methods: r‘h"j„ubh~)r’}r“(h X``__getitem__``r”h*}r•(h0]r–h2]r—h.]r˜h,]r™h4]ršuh"j„h]r›hUX __getitem__rœ…r}rž(h Uh"j’ubah(hubhUX, rŸ…r }r¡(h X, r¢h"j„ubh~)r£}r¤(h X``__setitem__``r¥h*}r¦(h0]r§h2]r¨h.]r©h,]rªh4]r«uh"j„h]r¬hUX __setitem__r­…r®}r¯(h Uh"j£ubah(hubhUX, r°…r±}r²(h X, r³h"j„ubh~)r´}rµ(h X``__delitem__``r¶h*}r·(h0]r¸h2]r¹h.]rºh,]r»h4]r¼uh"j„h]r½hUX __delitem__r¾…r¿}rÀ(h Uh"j´ubah(hubhUX, rÁ…rÂ}rÃ(h X, rÄh"j„ubh~)rÅ}rÆ(h X``__contains__``rÇh*}rÈ(h0]rÉh2]rÊh.]rËh,]rÌh4]rÍuh"j„h]rÎhUX __contains__rÏ…rÐ}rÑ(h Uh"jÅubah(hubhUX, rÒ…rÓ}rÔ(h X, rÕh"j„ubh~)rÖ}r×(h X ``__len__``rØh*}rÙ(h0]rÚh2]rÛh.]rÜh,]rÝh4]rÞuh"j„h]rßhUX__len__rà…rá}râ(h Uh"jÖubah(hubhUX, rã…rä}rå(h X, ræh"j„ubh~)rç}rè(h X ``__iter__``réh*}rê(h0]rëh2]rìh.]ríh,]rîh4]rïuh"j„h]rðhUX__iter__rñ…rò}ró(h Uh"jçubah(hubhUX, rô…rõ}rö(h X, r÷h"j„ubh~)rø}rù(h X``__getslice__``rúh*}rû(h0]rüh2]rýh.]rþh,]rÿh4]ruh"j„h]rhUX __getslice__r…r}r(h Uh"jøubah(hubhUX, r…r}r(h X, rh"j„ubh~)r }r (h X``__setslice__``r h*}r (h0]r h2]rh.]rh,]rh4]ruh"j„h]rhUX __setslice__r…r}r(h Uh"j ubah(hubhUX, r…r}r(h X, rh"j„ubh~)r}r(h X``__reversed__``rh*}r(h0]rh2]rh.]r h,]r!h4]r"uh"j„h]r#hUX __reversed__r$…r%}r&(h Uh"jubah(hubhUX and r'…r(}r)(h X and r*h"j„ubh~)r+}r,(h X``__missing__``r-h*}r.(h0]r/h2]r0h.]r1h,]r2h4]r3uh"j„h]r4hUX __missing__r5…r6}r7(h Uh"j+ubah(hubeubaubj)r8}r9(h X/Context manager: ``__enter__`` and ``__exit__``r:h"j h#h&h(jh*}r;(h0]r<h2]r=h.]r>h,]r?h4]r@uh7Nh8hh]rAhY)rB}rC(h j:h"j8h#h&h(h]h*}rD(h0]rEh2]rFh.]rGh,]rHh4]rIuh7KOh]rJ(hUXContext manager: rK…rL}rM(h XContext manager: rNh"jBubh~)rO}rP(h X ``__enter__``rQh*}rR(h0]rSh2]rTh.]rUh,]rVh4]rWuh"jBh]rXhUX __enter__rY…rZ}r[(h Uh"jOubah(hubhUX and r\…r]}r^(h X and r_h"jBubh~)r`}ra(h X ``__exit__``rbh*}rc(h0]rdh2]reh.]rfh,]rgh4]rhuh"jBh]rihUX__exit__rj…rk}rl(h Uh"j`ubah(hubeubaubj)rm}rn(h XBUnary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__``roh"j h#h&h(jh*}rp(h0]rqh2]rrh.]rsh,]rth4]ruuh7Nh8hh]rvhY)rw}rx(h joh"jmh#h&h(h]h*}ry(h0]rzh2]r{h.]r|h,]r}h4]r~uh7KPh]r(hUXUnary numeric methods: r€…r}r‚(h XUnary numeric methods: rƒh"jwubh~)r„}r…(h X ``__neg__``r†h*}r‡(h0]rˆh2]r‰h.]rŠh,]r‹h4]rŒuh"jwh]rhUX__neg__rŽ…r}r(h Uh"j„ubah(hubhUX, r‘…r’}r“(h X, r”h"jwubh~)r•}r–(h X ``__pos__``r—h*}r˜(h0]r™h2]ršh.]r›h,]rœh4]ruh"jwh]ržhUX__pos__rŸ…r }r¡(h Uh"j•ubah(hubhUX and r¢…r£}r¤(h X and r¥h"jwubh~)r¦}r§(h X``__invert__``r¨h*}r©(h0]rªh2]r«h.]r¬h,]r­h4]r®uh"jwh]r¯hUX __invert__r°…r±}r²(h Uh"j¦ubah(hubeubaubj)r³}r´(h XúThe numeric methods (including right hand and in-place variants): ``__add__``, ``__sub__``, ``__mul__``, ``__div__``, ``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``, ``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and ``__pow__``rµh"j h#h&h(jh*}r¶(h0]r·h2]r¸h.]r¹h,]rºh4]r»uh7Nh8hh]r¼hY)r½}r¾(h XúThe numeric methods (including right hand and in-place variants): ``__add__``, ``__sub__``, ``__mul__``, ``__div__``, ``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``, ``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and ``__pow__``r¿h"j³h#h&h(h]h*}rÀ(h0]rÁh2]rÂh.]rÃh,]rÄh4]rÅuh7KQh]rÆ(hUXBThe numeric methods (including right hand and in-place variants): rÇ…rÈ}rÉ(h XBThe numeric methods (including right hand and in-place variants): rÊh"j½ubh~)rË}rÌ(h X ``__add__``rÍh*}rÎ(h0]rÏh2]rÐh.]rÑh,]rÒh4]rÓuh"j½h]rÔhUX__add__rÕ…rÖ}r×(h Uh"jËubah(hubhUX, rØ…rÙ}rÚ(h X, rÛh"j½ubh~)rÜ}rÝ(h X ``__sub__``rÞh*}rß(h0]ràh2]ráh.]râh,]rãh4]räuh"j½h]råhUX__sub__ræ…rç}rè(h Uh"jÜubah(hubhUX, ré…rê}rë(h X, rìh"j½ubh~)rí}rî(h X ``__mul__``rïh*}rð(h0]rñh2]ròh.]róh,]rôh4]rõuh"j½h]röhUX__mul__r÷…rø}rù(h Uh"jíubah(hubhUX, rú…rû}rü(h X, rýh"j½ubh~)rþ}rÿ(h X ``__div__``rh*}r(h0]rh2]rh.]rh,]rh4]ruh"j½h]rhUX__div__r…r }r (h Uh"jþubah(hubhUX, r …r }r (h X, rh"j½ubh~)r}r(h X``__floordiv__``rh*}r(h0]rh2]rh.]rh,]rh4]ruh"j½h]rhUX __floordiv__r…r}r(h Uh"jubah(hubhUX, r…r}r(h X, rh"j½ubh~)r }r!(h X ``__mod__``r"h*}r#(h0]r$h2]r%h.]r&h,]r'h4]r(uh"j½h]r)hUX__mod__r*…r+}r,(h Uh"j ubah(hubhUX, r-…r.}r/(h X, r0h"j½ubh~)r1}r2(h X``__divmod__``r3h*}r4(h0]r5h2]r6h.]r7h,]r8h4]r9uh"j½h]r:hUX __divmod__r;…r<}r=(h Uh"j1ubah(hubhUX, r>…r?}r@(h X, rAh"j½ubh~)rB}rC(h X``__lshift__``rDh*}rE(h0]rFh2]rGh.]rHh,]rIh4]rJuh"j½h]rKhUX __lshift__rL…rM}rN(h Uh"jBubah(hubhUX, rO…rP}rQ(h X, rRh"j½ubh~)rS}rT(h X``__rshift__``rUh*}rV(h0]rWh2]rXh.]rYh,]rZh4]r[uh"j½h]r\hUX __rshift__r]…r^}r_(h Uh"jSubah(hubhUX, r`…ra}rb(h X, rch"j½ubh~)rd}re(h X ``__and__``rfh*}rg(h0]rhh2]rih.]rjh,]rkh4]rluh"j½h]rmhUX__and__rn…ro}rp(h Uh"jdubah(hubhUX, rq…rr}rs(h X, rth"j½ubh~)ru}rv(h X ``__xor__``rwh*}rx(h0]ryh2]rzh.]r{h,]r|h4]r}uh"j½h]r~hUX__xor__r…r€}r(h Uh"juubah(hubhUX, r‚…rƒ}r„(h X, r…h"j½ubh~)r†}r‡(h X ``__or__``rˆh*}r‰(h0]rŠh2]r‹h.]rŒh,]rh4]rŽuh"j½h]rhUX__or__r…r‘}r’(h Uh"j†ubah(hubhUX, and r“…r”}r•(h X, and r–h"j½ubh~)r—}r˜(h X ``__pow__``r™h*}rš(h0]r›h2]rœh.]rh,]ržh4]rŸuh"j½h]r hUX__pow__r¡…r¢}r£(h Uh"j—ubah(hubeubaubj)r¤}r¥(h XiNumeric conversion methods: ``__complex__``, ``__int__``, ``__float__``, ``__index__`` and ``__coerce__``r¦h"j h#h&h(jh*}r§(h0]r¨h2]r©h.]rªh,]r«h4]r¬uh7Nh8hh]r­hY)r®}r¯(h XiNumeric conversion methods: ``__complex__``, ``__int__``, ``__float__``, ``__index__`` and ``__coerce__``r°h"j¤h#h&h(h]h*}r±(h0]r²h2]r³h.]r´h,]rµh4]r¶uh7KUh]r·(hUXNumeric conversion methods: r¸…r¹}rº(h XNumeric conversion methods: r»h"j®ubh~)r¼}r½(h X``__complex__``r¾h*}r¿(h0]rÀh2]rÁh.]rÂh,]rÃh4]rÄuh"j®h]rÅhUX __complex__rÆ…rÇ}rÈ(h Uh"j¼ubah(hubhUX, rÉ…rÊ}rË(h X, rÌh"j®ubh~)rÍ}rÎ(h X ``__int__``rÏh*}rÐ(h0]rÑh2]rÒh.]rÓh,]rÔh4]rÕuh"j®h]rÖhUX__int__r×…rØ}rÙ(h Uh"jÍubah(hubhUX, rÚ…rÛ}rÜ(h X, rÝh"j®ubh~)rÞ}rß(h X ``__float__``ràh*}rá(h0]râh2]rãh.]räh,]råh4]ræuh"j®h]rçhUX __float__rè…ré}rê(h Uh"jÞubah(hubhUX, rë…rì}rí(h X, rîh"j®ubh~)rï}rð(h X ``__index__``rñh*}rò(h0]róh2]rôh.]rõh,]röh4]r÷uh"j®h]røhUX __index__rù…rú}rû(h Uh"jïubah(hubhUX and rü…rý}rþ(h X and rÿh"j®ubh~)r}r(h X``__coerce__``rh*}r(h0]rh2]rh.]rh,]rh4]ruh"j®h]r hUX __coerce__r …r }r (h Uh"jubah(hubeubaubj)r }r(h X?Descriptor methods: ``__get__``, ``__set__`` and ``__delete__``rh"j h#h&h(jh*}r(h0]rh2]rh.]rh,]rh4]ruh7Nh8hh]rhY)r}r(h jh"j h#h&h(h]h*}r(h0]rh2]rh.]rh,]rh4]ruh7KWh]r(hUXDescriptor methods: r …r!}r"(h XDescriptor methods: r#h"jubh~)r$}r%(h X ``__get__``r&h*}r'(h0]r(h2]r)h.]r*h,]r+h4]r,uh"jh]r-hUX__get__r.…r/}r0(h Uh"j$ubah(hubhUX, r1…r2}r3(h X, r4h"jubh~)r5}r6(h X ``__set__``r7h*}r8(h0]r9h2]r:h.]r;h,]r<h4]r=uh"jh]r>hUX__set__r?…r@}rA(h Uh"j5ubah(hubhUX and rB…rC}rD(h X and rEh"jubh~)rF}rG(h X``__delete__``rHh*}rI(h0]rJh2]rKh.]rLh,]rMh4]rNuh"jh]rOhUX __delete__rP…rQ}rR(h Uh"jFubah(hubeubaubj)rS}rT(h X}Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, ``__getstate__`` and ``__setstate__`` rUh"j h#h&h(jh*}rV(h0]rWh2]rXh.]rYh,]rZh4]r[uh7Nh8hh]r\hY)r]}r^(h X{Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, ``__getstate__`` and ``__setstate__``r_h"jSh#h&h(h]h*}r`(h0]rah2]rbh.]rch,]rdh4]reuh7KXh]rf(hUX Pickling: rg…rh}ri(h X Pickling: rjh"j]ubh~)rk}rl(h X``__reduce__``rmh*}rn(h0]roh2]rph.]rqh,]rrh4]rsuh"j]h]rthUX __reduce__ru…rv}rw(h Uh"jkubah(hubhUX, rx…ry}rz(h X, r{h"j]ubh~)r|}r}(h X``__reduce_ex__``r~h*}r(h0]r€h2]rh.]r‚h,]rƒh4]r„uh"j]h]r…hUX __reduce_ex__r†…r‡}rˆ(h Uh"j|ubah(hubhUX, r‰…rŠ}r‹(h X, rŒh"j]ubh~)r}rŽ(h X``__getinitargs__``rh*}r(h0]r‘h2]r’h.]r“h,]r”h4]r•uh"j]h]r–hUX__getinitargs__r—…r˜}r™(h Uh"jubah(hubhUX, rš…r›}rœ(h X, rh"j]ubh~)rž}rŸ(h X``__getnewargs__``r h*}r¡(h0]r¢h2]r£h.]r¤h,]r¥h4]r¦uh"j]h]r§hUX__getnewargs__r¨…r©}rª(h Uh"jžubah(hubhUX, r«…r¬}r­(h X, r®h"j]ubh~)r¯}r°(h X``__getstate__``r±h*}r²(h0]r³h2]r´h.]rµh,]r¶h4]r·uh"j]h]r¸hUX __getstate__r¹…rº}r»(h Uh"j¯ubah(hubhUX and r¼…r½}r¾(h X and r¿h"j]ubh~)rÀ}rÁ(h X``__setstate__``rÂh*}rÃ(h0]rÄh2]rÅh.]rÆh,]rÇh4]rÈuh"j]h]rÉhUX __setstate__rÊ…rË}rÌ(h Uh"jÀubah(hubeubaubeubhY)rÍ}rÎ(h XLThe following methods are supported in Python 2 but don't exist in Python 3:rÏh"h;h#h&h(h]h*}rÐ(h0]rÑh2]rÒh.]rÓh,]rÔh4]rÕuh7K\h8hh]rÖhUXLThe following methods are supported in Python 2 but don't exist in Python 3:r×…rØ}rÙ(h jÏh"jÍubaubj )rÚ}rÛ(h Uh"h;h#h&h(j h*}rÜ(jX*h,]rÝh.]rÞh0]rßh2]ràh4]ráuh7K^h8hh]râ(j)rã}rä(h XK``__unicode__``, ``__long__``, ``__oct__``, ``__hex__`` and ``__nonzero__``råh"jÚh#h&h(jh*}ræ(h0]rçh2]rèh.]réh,]rêh4]rëuh7Nh8hh]rìhY)rí}rî(h jåh"jãh#h&h(h]h*}rï(h0]rðh2]rñh.]ròh,]róh4]rôuh7K^h]rõ(h~)rö}r÷(h X``__unicode__``røh*}rù(h0]rúh2]rûh.]rüh,]rýh4]rþuh"jíh]rÿhUX __unicode__r…r}r(h Uh"jöubah(hubhUX, r…r}r(h X, rh"jíubh~)r}r(h X ``__long__``r h*}r (h0]r h2]r h.]r h,]rh4]ruh"jíh]rhUX__long__r…r}r(h Uh"jubah(hubhUX, r…r}r(h X, rh"jíubh~)r}r(h X ``__oct__``rh*}r(h0]rh2]rh.]rh,]rh4]r uh"jíh]r!hUX__oct__r"…r#}r$(h Uh"jubah(hubhUX, r%…r&}r'(h X, r(h"jíubh~)r)}r*(h X ``__hex__``r+h*}r,(h0]r-h2]r.h.]r/h,]r0h4]r1uh"jíh]r2hUX__hex__r3…r4}r5(h Uh"j)ubah(hubhUX and r6…r7}r8(h X and r9h"jíubh~)r:}r;(h X``__nonzero__``r<h*}r=(h0]r>h2]r?h.]r@h,]rAh4]rBuh"jíh]rChUX __nonzero__rD…rE}rF(h Uh"j:ubah(hubeubaubj)rG}rH(h X%``__truediv__`` and ``__rtruediv__`` rIh"jÚh#h&h(jh*}rJ(h0]rKh2]rLh.]rMh,]rNh4]rOuh7Nh8hh]rPhY)rQ}rR(h X$``__truediv__`` and ``__rtruediv__``rSh"jGh#h&h(h]h*}rT(h0]rUh2]rVh.]rWh,]rXh4]rYuh7K_h]rZ(h~)r[}r\(h X``__truediv__``r]h*}r^(h0]r_h2]r`h.]rah,]rbh4]rcuh"jQh]rdhUX __truediv__re…rf}rg(h Uh"j[ubah(hubhUX and rh…ri}rj(h X and rkh"jQubh~)rl}rm(h X``__rtruediv__``rnh*}ro(h0]rph2]rqh.]rrh,]rsh4]rtuh"jQh]ruhUX __rtruediv__rv…rw}rx(h Uh"jlubah(hubeubaubeubhY)ry}rz(h XLThe following methods are supported in Python 3 but don't exist in Python 2:r{h"h;h#h&h(h]h*}r|(h0]r}h2]r~h.]rh,]r€h4]ruh7Kah8hh]r‚hUXLThe following methods are supported in Python 3 but don't exist in Python 2:rƒ…r„}r…(h j{h"jyubaubj )r†}r‡(h Uh"h;h#h&h(j h*}rˆ(jX*h,]r‰h.]rŠh0]r‹h2]rŒh4]ruh7Kch8hh]rŽj)r}r(h X``__bool__`` and ``__next__`` r‘h"j†h#h&h(jh*}r’(h0]r“h2]r”h.]r•h,]r–h4]r—uh7Nh8hh]r˜hY)r™}rš(h X``__bool__`` and ``__next__``r›h"jh#h&h(h]h*}rœ(h0]rh2]ržh.]rŸh,]r h4]r¡uh7Kch]r¢(h~)r£}r¤(h X ``__bool__``r¥h*}r¦(h0]r§h2]r¨h.]r©h,]rªh4]r«uh"j™h]r¬hUX__bool__r­…r®}r¯(h Uh"j£ubah(hubhUX and r°…r±}r²(h X and r³h"j™ubh~)r´}rµ(h X ``__next__``r¶h*}r·(h0]r¸h2]r¹h.]rºh,]r»h4]r¼uh"j™h]r½hUX__next__r¾…r¿}rÀ(h Uh"j´ubah(hubeubaubaubhY)rÁ}rÂ(h X‡The following methods exist but are *not* supported as they are either in use by mock, can't be set dynamically, or can cause problems:rÃh"h;h#h&h(h]h*}rÄ(h0]rÅh2]rÆh.]rÇh,]rÈh4]rÉuh7Keh8hh]rÊ(hUX$The following methods exist but are rË…rÌ}rÍ(h X$The following methods exist but are rÎh"jÁubhØ)rÏ}rÐ(h X*not*rÑh*}rÒ(h0]rÓh2]rÔh.]rÕh,]rÖh4]r×uh"jÁh]rØhUXnotrÙ…rÚ}rÛ(h Uh"jÏubah(hæubhUX^ supported as they are either in use by mock, can't be set dynamically, or can cause problems:rÜ…rÝ}rÞ(h X^ supported as they are either in use by mock, can't be set dynamically, or can cause problems:rßh"jÁubeubj )rà}rá(h Uh"h;h#h&h(j h*}râ(jX*h,]rãh.]räh0]råh2]ræh4]rçuh7Khh8hh]rè(j)ré}rê(h X>``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__``rëh"jàh#h&h(jh*}rì(h0]ríh2]rîh.]rïh,]rðh4]rñuh7Nh8hh]ròhY)ró}rô(h jëh"jéh#h&h(h]h*}rõ(h0]röh2]r÷h.]røh,]rùh4]rúuh7Khh]rû(h~)rü}rý(h X``__getattr__``rþh*}rÿ(h0]rh2]rh.]rh,]rh4]ruh"jóh]rhUX __getattr__r…r}r(h Uh"jüubah(hubhUX, r …r }r (h X, r h"jóubh~)r }r(h X``__setattr__``rh*}r(h0]rh2]rh.]rh,]rh4]ruh"jóh]rhUX __setattr__r…r}r(h Uh"j ubah(hubhUX, r…r}r(h X, rh"jóubh~)r}r(h X ``__init__``r h*}r!(h0]r"h2]r#h.]r$h,]r%h4]r&uh"jóh]r'hUX__init__r(…r)}r*(h Uh"jubah(hubhUX and r+…r,}r-(h X and r.h"jóubh~)r/}r0(h X ``__new__``r1h*}r2(h0]r3h2]r4h.]r5h,]r6h4]r7uh"jóh]r8hUX__new__r9…r:}r;(h Uh"j/ubah(hubeubaubj)r<}r=(h XM``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__`` r>h"jàh#h&h(jh*}r?(h0]r@h2]rAh.]rBh,]rCh4]rDuh7Nh8hh]rEhY)rF}rG(h XJ``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``rHh"j<h#h&h(h]h*}rI(h0]rJh2]rKh.]rLh,]rMh4]rNuh7Kih]rO(h~)rP}rQ(h X``__prepare__``rRh*}rS(h0]rTh2]rUh.]rVh,]rWh4]rXuh"jFh]rYhUX __prepare__rZ…r[}r\(h Uh"jPubah(hubhUX, r]…r^}r_(h X, r`h"jFubh~)ra}rb(h X``__instancecheck__``rch*}rd(h0]reh2]rfh.]rgh,]rhh4]riuh"jFh]rjhUX__instancecheck__rk…rl}rm(h Uh"jaubah(hubhUX, rn…ro}rp(h X, rqh"jFubh~)rr}rs(h X``__subclasscheck__``rth*}ru(h0]rvh2]rwh.]rxh,]ryh4]rzuh"jFh]r{hUX__subclasscheck__r|…r}}r~(h Uh"jrubah(hubhUX, r…r€}r(h X, r‚h"jFubh~)rƒ}r„(h X ``__del__``r…h*}r†(h0]r‡h2]rˆh.]r‰h,]rŠh4]r‹uh"jFh]rŒhUX__del__r…rŽ}r(h Uh"jƒubah(hubeubaubeubeubh:)r}r‘(h Uh"hh#h&h(h?h*}r’(h0]r“h2]r”h.]r•h,]r–hah4]r—h auh7Knh8hh]r˜(hI)r™}rš(h X Magic Mockr›h"jh#h&h(hMh*}rœ(h0]rh2]ržh.]rŸh,]r h4]r¡uh7Knh8hh]r¢hUX Magic Mockr£…r¤}r¥(h j›h"j™ubaubhY)r¦}r§(h XKThere are two `MagicMock` variants: `MagicMock` and `NonCallableMagicMock`.r¨h"jh#h&h(h]h*}r©(h0]rªh2]r«h.]r¬h,]r­h4]r®uh7Kph8hh]r¯(hUXThere are two r°…r±}r²(h XThere are two r³h"j¦ubjP)r´}rµ(h X `MagicMock`r¶h*}r·(h0]r¸h2]r¹h.]rºh,]r»h4]r¼uh"j¦h]r½hUX MagicMockr¾…r¿}rÀ(h Uh"j´ubah(j^ubhUX variants: rÁ…rÂ}rÃ(h X variants: rÄh"j¦ubjP)rÅ}rÆ(h X `MagicMock`rÇh*}rÈ(h0]rÉh2]rÊh.]rËh,]rÌh4]rÍuh"j¦h]rÎhUX MagicMockrÏ…rÐ}rÑ(h Uh"jÅubah(j^ubhUX and rÒ…rÓ}rÔ(h X and rÕh"j¦ubjP)rÖ}r×(h X`NonCallableMagicMock`rØh*}rÙ(h0]rÚh2]rÛh.]rÜh,]rÝh4]rÞuh"j¦h]rßhUXNonCallableMagicMockrà…rá}râ(h Uh"jÖubah(j^ubhUX.…rã}rä(h X.h"j¦ubeubcsphinx.addnodes index rå)ræ}rç(h Uh"jh#h&h(Uindexrèh*}ré(h,]rêh.]rëh0]rìh2]ríh4]rîUentriesrï]rð(UsinglerñXMagicMock (class in mock)hUtròauh7Nh8hh]róubcsphinx.addnodes desc rô)rõ}rö(h Uh"jh#h&h(Udescr÷h*}rø(Unoindexrù‰UdomainrúXpyrûh,]rüh.]rýh0]rþh2]rÿh4]r Uobjtyper Xclassr Udesctyper j uh7Nh8hh]r (csphinx.addnodes desc_signature r )r }r (h XMagicMock(*args, **kw)r h"jõh#h&h(Udesc_signaturer h*}r (h,]r haUmoduler h|h.]r h0]r h2]r h4]r haUfullnamer X MagicMockr Uclassr UUfirstr ‰uh7K~h8hh]r (csphinx.addnodes desc_annotation r )r }r (h Xclass r h"j h#h&h(Udesc_annotationr h*}r (h0]r h2]r h.]r h,]r h4]r uh7K~h8hh]r! hUXclass r" …r# }r$ (h Uh"j ubaubcsphinx.addnodes desc_name r% )r& }r' (h j h"j h#h&h(U desc_namer( h*}r) (h0]r* h2]r+ h.]r, h,]r- h4]r. uh7K~h8hh]r/ hUX MagicMockr0 …r1 }r2 (h Uh"j& ubaubcsphinx.addnodes desc_parameterlist r3 )r4 }r5 (h Uh"j h#h&h(Udesc_parameterlistr6 h*}r7 (h0]r8 h2]r9 h.]r: h,]r; h4]r< uh7K~h8hh]r= (csphinx.addnodes desc_parameter r> )r? }r@ (h X*argsrA h*}rB (h0]rC h2]rD h.]rE h,]rF h4]rG uh"j4 h]rH hUX*argsrI …rJ }rK (h Uh"j? ubah(Udesc_parameterrL ubj> )rM }rN (h X**kwrO h*}rP (h0]rQ h2]rR h.]rS h,]rT h4]rU uh"j4 h]rV hUX**kwrW …rX }rY (h Uh"jM ubah(jL ubeubeubcsphinx.addnodes desc_content rZ )r[ }r\ (h Uh"jõh#h&h(U desc_contentr] h*}r^ (h0]r_ h2]r` h.]ra h,]rb h4]rc uh7K~h8hh]rd (hY)re }rf (h X¹``MagicMock`` is a subclass of :class:`Mock` with default implementations of most of the magic methods. You can use ``MagicMock`` without having to configure the magic methods yourself.rg h"j[ h#h&h(h]h*}rh (h0]ri h2]rj h.]rk h,]rl h4]rm uh7Kuh8hh]rn (h~)ro }rp (h X ``MagicMock``rq h*}rr (h0]rs h2]rt h.]ru h,]rv h4]rw uh"je h]rx hUX MagicMockry …rz }r{ (h Uh"jo ubah(hubhUX is a subclass of r| …r} }r~ (h X is a subclass of r h"je ubhe)r€ }r (h X :class:`Mock`r‚ h"je h#h&h(hih*}rƒ (Ureftyper„ Xclassr… hm‰hnXMockr† U refdomainr‡ Xpyrˆ h,]r‰ h.]rŠ U refexplicitr‹ ‰h0]rŒ h2]r h4]rŽ hxhyhzj h{h|uh7Kuh]r h~)r }r‘ (h j‚ h*}r’ (h0]r“ h2]r” (h„jˆ Xpy-classr• eh.]r– h,]r— h4]r˜ uh"j€ h]r™ hUXMockrš …r› }rœ (h Uh"j ubah(hubaubhUXH with default implementations of most of the magic methods. You can use r …rž }rŸ (h XH with default implementations of most of the magic methods. You can use r  h"je ubh~)r¡ }r¢ (h X ``MagicMock``r£ h*}r¤ (h0]r¥ h2]r¦ h.]r§ h,]r¨ h4]r© uh"je h]rª hUX MagicMockr« …r¬ }r­ (h Uh"j¡ ubah(hubhUX8 without having to configure the magic methods yourself.r® …r¯ }r° (h X8 without having to configure the magic methods yourself.r± h"je ubeubhY)r² }r³ (h XFThe constructor parameters have the same meaning as for :class:`Mock`.r´ h"j[ h#h&h(h]h*}rµ (h0]r¶ h2]r· h.]r¸ h,]r¹ h4]rº uh7Kyh8hh]r» (hUX8The constructor parameters have the same meaning as for r¼ …r½ }r¾ (h X8The constructor parameters have the same meaning as for r¿ h"j² ubhe)rÀ }rÁ (h X :class:`Mock`r h"j² h#h&h(hih*}rà (UreftyperÄ XclassrÅ hm‰hnXMockrÆ U refdomainrÇ XpyrÈ h,]rÉ h.]rÊ U refexplicitrË ‰h0]rÌ h2]rÍ h4]rÎ hxhyhzj h{h|uh7Kyh]rÏ h~)rÐ }rÑ (h j h*}rÒ (h0]rÓ h2]rÔ (h„jÈ Xpy-classrÕ eh.]rÖ h,]r× h4]rØ uh"jÀ h]rÙ hUXMockrÚ …rÛ }rÜ (h Uh"jÐ ubah(hubaubhUX.…rÝ }rÞ (h X.h"j² ubeubhY)rß }rà (h XoIf you use the `spec` or `spec_set` arguments then *only* magic methods that exist in the spec will be created.rá h"j[ h#h&h(h]h*}râ (h0]rã h2]rä h.]rå h,]ræ h4]rç uh7K{h8hh]rè (hUXIf you use the ré …rê }rë (h XIf you use the rì h"jß ubjP)rí }rî (h X`spec`rï h*}rð (h0]rñ h2]rò h.]ró h,]rô h4]rõ uh"jß h]rö hUXspecr÷ …rø }rù (h Uh"jí ubah(j^ubhUX or rú …rû }rü (h X or rý h"jß ubjP)rþ }rÿ (h X `spec_set`r h*}r (h0]r h2]r h.]r h,]r h4]r uh"jß h]r hUXspec_setr …r }r (h Uh"jþ ubah(j^ubhUX arguments then r …r }r (h X arguments then r h"jß ubhØ)r }r (h X*only*r h*}r (h0]r h2]r h.]r h,]r h4]r uh"jß h]r hUXonlyr …r }r (h Uh"j ubah(hæubhUX6 magic methods that exist in the spec will be created.r …r }r (h X6 magic methods that exist in the spec will be created.r h"jß ubeubeubeubjå)r }r! (h Uh"jh#h&h(jèh*}r" (h,]r# h.]r$ h0]r% h2]r& h4]r' Uentriesr( ]r) (jñX$NonCallableMagicMock (class in mock)hUtr* auh7Nh8hh]r+ ubjô)r, }r- (h Uh"jh#h&h(j÷h*}r. (jù‰júXpyr/ h,]r0 h.]r1 h0]r2 h2]r3 h4]r4 j Xclassr5 j j5 uh7Nh8hh]r6 (j )r7 }r8 (h X!NonCallableMagicMock(*args, **kw)r9 h"j, h#h&h(j h*}r: (h,]r; haj h|h.]r< h0]r= h2]r> h4]r? haj XNonCallableMagicMockr@ j Uj ‰uh7K†h8hh]rA (j )rB }rC (h Xclass rD h"j7 h#h&h(j h*}rE (h0]rF h2]rG h.]rH h,]rI h4]rJ uh7K†h8hh]rK hUXclass rL …rM }rN (h Uh"jB ubaubj% )rO }rP (h j@ h"j7 h#h&h(j( h*}rQ (h0]rR h2]rS h.]rT h,]rU h4]rV uh7K†h8hh]rW hUXNonCallableMagicMockrX …rY }rZ (h Uh"jO ubaubj3 )r[ }r\ (h Uh"j7 h#h&h(j6 h*}r] (h0]r^ h2]r_ h.]r` h,]ra h4]rb uh7K†h8hh]rc (j> )rd }re (h X*argsrf h*}rg (h0]rh h2]ri h.]rj h,]rk h4]rl uh"j[ h]rm hUX*argsrn …ro }rp (h Uh"jd ubah(jL ubj> )rq }rr (h X**kwrs h*}rt (h0]ru h2]rv h.]rw h,]rx h4]ry uh"j[ h]rz hUX**kwr{ …r| }r} (h Uh"jq ubah(jL ubeubeubjZ )r~ }r (h Uh"j, h#h&h(j] h*}r€ (h0]r h2]r‚ h.]rƒ h,]r„ h4]r… uh7K†h8hh]r† (hY)r‡ }rˆ (h X&A non-callable version of `MagicMock`.r‰ h"j~ h#h&h(h]h*}rŠ (h0]r‹ h2]rŒ h.]r h,]rŽ h4]r uh7Kh8hh]r (hUXA non-callable version of r‘ …r’ }r“ (h XA non-callable version of r” h"j‡ ubjP)r• }r– (h X `MagicMock`r— h*}r˜ (h0]r™ h2]rš h.]r› h,]rœ h4]r uh"j‡ h]rž hUX MagicMockrŸ …r  }r¡ (h Uh"j• ubah(j^ubhUX.…r¢ }r£ (h X.h"j‡ ubeubhY)r¤ }r¥ (h X°The constructor parameters have the same meaning as for :class:`MagicMock`, with the exception of `return_value` and `side_effect` which have no meaning on a non-callable mock.r¦ h"j~ h#h&h(h]h*}r§ (h0]r¨ h2]r© h.]rª h,]r« h4]r¬ uh7Kƒh8hh]r­ (hUX8The constructor parameters have the same meaning as for r® …r¯ }r° (h X8The constructor parameters have the same meaning as for r± h"j¤ ubhe)r² }r³ (h X:class:`MagicMock`r´ h"j¤ h#h&h(hih*}rµ (Ureftyper¶ Xclassr· hm‰hnX MagicMockr¸ U refdomainr¹ Xpyrº h,]r» h.]r¼ U refexplicitr½ ‰h0]r¾ h2]r¿ h4]rÀ hxhyhzj@ h{h|uh7Kƒh]rÁ h~)r }rà (h j´ h*}rÄ (h0]rÅ h2]rÆ (h„jº Xpy-classrÇ eh.]rÈ h,]rÉ h4]rÊ uh"j² h]rË hUX MagicMockrÌ …rÍ }rÎ (h Uh"j ubah(hubaubhUX, with the exception of rÏ …rÐ }rÑ (h X, with the exception of rÒ h"j¤ ubjP)rÓ }rÔ (h X`return_value`rÕ h*}rÖ (h0]r× h2]rØ h.]rÙ h,]rÚ h4]rÛ uh"j¤ h]rÜ hUX return_valuerÝ …rÞ }rß (h Uh"jÓ ubah(j^ubhUX and rà …rá }râ (h X and rã h"j¤ ubjP)rä }rå (h X `side_effect`ræ h*}rç (h0]rè h2]ré h.]rê h,]rë h4]rì uh"j¤ h]rí hUX side_effectrî …rï }rð (h Uh"jä ubah(j^ubhUX. which have no meaning on a non-callable mock.rñ …rò }ró (h X. which have no meaning on a non-callable mock.rô h"j¤ ubeubeubeubhY)rõ }rö (h XnThe magic methods are setup with `MagicMock` objects, so you can configure them and use them in the usual way:r÷ h"jh#h&h(h]h*}rø (h0]rù h2]rú h.]rû h,]rü h4]rý uh7K‡h8hh]rþ (hUX!The magic methods are setup with rÿ …r }r (h X!The magic methods are setup with r h"jõ ubjP)r }r (h X `MagicMock`r h*}r (h0]r h2]r h.]r h,]r h4]r uh"jõ h]r hUX MagicMockr …r }r (h Uh"j ubah(j^ubhUXB objects, so you can configure them and use them in the usual way:r …r }r (h XB objects, so you can configure them and use them in the usual way:r h"jõ ubeubj*)r }r (h X >>> mock = MagicMock() >>> mock[3] = 'fish' >>> mock.__setitem__.assert_called_with(3, 'fish') >>> mock.__getitem__.return_value = 'result' >>> mock[2] 'result'r h"jh#h&h(j.h*}r (U testnodetyper Xdoctestr j2j3h,]r h.]r h0]r h2]r h4]r Ugroupsr ]r j;aj<}r! uh7KŠh8hh]r" hUX >>> mock = MagicMock() >>> mock[3] = 'fish' >>> mock.__setitem__.assert_called_with(3, 'fish') >>> mock.__getitem__.return_value = 'result' >>> mock[2] 'result'r# …r$ }r% (h Uh"j ubaubhY)r& }r' (h XQBy default many of the protocol methods are required to return objects of a specific type. These methods are preconfigured with a default return value, so that they can be used without you having to do anything if you aren't interested in the return value. You can still *set* the return value manually if you want to change the default.r( h"jh#h&h(h]h*}r) (h0]r* h2]r+ h.]r, h,]r- h4]r. uh7K“h8hh]r/ (hUXBy default many of the protocol methods are required to return objects of a specific type. These methods are preconfigured with a default return value, so that they can be used without you having to do anything if you aren't interested in the return value. You can still r0 …r1 }r2 (h XBy default many of the protocol methods are required to return objects of a specific type. These methods are preconfigured with a default return value, so that they can be used without you having to do anything if you aren't interested in the return value. You can still r3 h"j& ubhØ)r4 }r5 (h X*set*r6 h*}r7 (h0]r8 h2]r9 h.]r: h,]r; h4]r< uh"j& h]r= hUXsetr> …r? }r@ (h Uh"j4 ubah(hæubhUX= the return value manually if you want to change the default.rA …rB }rC (h X= the return value manually if you want to change the default.rD h"j& ubeubhY)rE }rF (h XMethods and their defaults:rG h"jh#h&h(h]h*}rH (h0]rI h2]rJ h.]rK h,]rL h4]rM uh7K™h8hh]rN hUXMethods and their defaults:rO …rP }rQ (h jG h"jE ubaubj )rR }rS (h Uh"jh#h&h(j h*}rT (jX*h,]rU h.]rV h0]rW h2]rX h4]rY uh7K›h8hh]rZ (j)r[ }r\ (h X``__lt__``: NotImplementedr] h"jR h#h&h(jh*}r^ (h0]r_ h2]r` h.]ra h,]rb h4]rc uh7Nh8hh]rd hY)re }rf (h j] h"j[ h#h&h(h]h*}rg (h0]rh h2]ri h.]rj h,]rk h4]rl uh7K›h]rm (h~)rn }ro (h X ``__lt__``rp h*}rq (h0]rr h2]rs h.]rt h,]ru h4]rv uh"je h]rw hUX__lt__rx …ry }rz (h Uh"jn ubah(hubhUX: NotImplementedr{ …r| }r} (h X: NotImplementedr~ h"je ubeubaubj)r }r€ (h X``__gt__``: NotImplementedr h"jR h#h&h(jh*}r‚ (h0]rƒ h2]r„ h.]r… h,]r† h4]r‡ uh7Nh8hh]rˆ hY)r‰ }rŠ (h j h"j h#h&h(h]h*}r‹ (h0]rŒ h2]r h.]rŽ h,]r h4]r uh7Kœh]r‘ (h~)r’ }r“ (h X ``__gt__``r” h*}r• (h0]r– h2]r— h.]r˜ h,]r™ h4]rš uh"j‰ h]r› hUX__gt__rœ …r }rž (h Uh"j’ ubah(hubhUX: NotImplementedrŸ …r  }r¡ (h X: NotImplementedr¢ h"j‰ ubeubaubj)r£ }r¤ (h X``__le__``: NotImplementedr¥ h"jR h#h&h(jh*}r¦ (h0]r§ h2]r¨ h.]r© h,]rª h4]r« uh7Nh8hh]r¬ hY)r­ }r® (h j¥ h"j£ h#h&h(h]h*}r¯ (h0]r° h2]r± h.]r² h,]r³ h4]r´ uh7Kh]rµ (h~)r¶ }r· (h X ``__le__``r¸ h*}r¹ (h0]rº h2]r» h.]r¼ h,]r½ h4]r¾ uh"j­ h]r¿ hUX__le__rÀ …rÁ }r (h Uh"j¶ ubah(hubhUX: NotImplementedrà …rÄ }rÅ (h X: NotImplementedrÆ h"j­ ubeubaubj)rÇ }rÈ (h X``__ge__``: NotImplementedrÉ h"jR h#h&h(jh*}rÊ (h0]rË h2]rÌ h.]rÍ h,]rÎ h4]rÏ uh7Nh8hh]rÐ hY)rÑ }rÒ (h jÉ h"jÇ h#h&h(h]h*}rÓ (h0]rÔ h2]rÕ h.]rÖ h,]r× h4]rØ uh7Kžh]rÙ (h~)rÚ }rÛ (h X ``__ge__``rÜ h*}rÝ (h0]rÞ h2]rß h.]rà h,]rá h4]râ uh"jÑ h]rã hUX__ge__rä …rå }ræ (h Uh"jÚ ubah(hubhUX: NotImplementedrç …rè }ré (h X: NotImplementedrê h"jÑ ubeubaubj)rë }rì (h X``__int__`` : 1rí h"jR h#h&h(jh*}rî (h0]rï h2]rð h.]rñ h,]rò h4]ró uh7Nh8hh]rô hY)rõ }rö (h jí h"jë h#h&h(h]h*}r÷ (h0]rø h2]rù h.]rú h,]rû h4]rü uh7KŸh]rý (h~)rþ }rÿ (h X ``__int__``r h*}r (h0]r h2]r h.]r h,]r h4]r uh"jõ h]r hUX__int__r …r }r (h Uh"jþ ubah(hubhUX : 1r …r }r (h X : 1r h"jõ ubeubaubj)r }r (h X``__contains__`` : Falser h"jR h#h&h(jh*}r (h0]r h2]r h.]r h,]r h4]r uh7Nh8hh]r hY)r }r (h j h"j h#h&h(h]h*}r (h0]r h2]r h.]r h,]r h4]r uh7K h]r! (h~)r" }r# (h X``__contains__``r$ h*}r% (h0]r& h2]r' h.]r( h,]r) h4]r* uh"j h]r+ hUX __contains__r, …r- }r. (h Uh"j" ubah(hubhUX : Falser/ …r0 }r1 (h X : Falser2 h"j ubeubaubj)r3 }r4 (h X``__len__`` : 1r5 h"jR h#h&h(jh*}r6 (h0]r7 h2]r8 h.]r9 h,]r: h4]r; uh7Nh8hh]r< hY)r= }r> (h j5 h"j3 h#h&h(h]h*}r? (h0]r@ h2]rA h.]rB h,]rC h4]rD uh7K¡h]rE (h~)rF }rG (h X ``__len__``rH h*}rI (h0]rJ h2]rK h.]rL h,]rM h4]rN uh"j= h]rO hUX__len__rP …rQ }rR (h Uh"jF ubah(hubhUX : 1rS …rT }rU (h X : 1rV h"j= ubeubaubj)rW }rX (h X``__iter__`` : iter([])rY h"jR h#h&h(jh*}rZ (h0]r[ h2]r\ h.]r] h,]r^ h4]r_ uh7Nh8hh]r` hY)ra }rb (h jY h"jW h#h&h(h]h*}rc (h0]rd h2]re h.]rf h,]rg h4]rh uh7K¢h]ri (h~)rj }rk (h X ``__iter__``rl h*}rm (h0]rn h2]ro h.]rp h,]rq h4]rr uh"ja h]rs hUX__iter__rt …ru }rv (h Uh"jj ubah(hubhUX : iter([])rw …rx }ry (h X : iter([])rz h"ja ubeubaubj)r{ }r| (h X``__exit__`` : Falser} h"jR h#h&h(jh*}r~ (h0]r h2]r€ h.]r h,]r‚ h4]rƒ uh7Nh8hh]r„ hY)r… }r† (h j} h"j{ h#h&h(h]h*}r‡ (h0]rˆ h2]r‰ h.]rŠ h,]r‹ h4]rŒ uh7K£h]r (h~)rŽ }r (h X ``__exit__``r h*}r‘ (h0]r’ h2]r“ h.]r” h,]r• h4]r– uh"j… h]r— hUX__exit__r˜ …r™ }rš (h Uh"jŽ ubah(hubhUX : Falser› …rœ }r (h X : Falserž h"j… ubeubaubj)rŸ }r  (h X``__complex__`` : 1jr¡ h"jR h#h&h(jh*}r¢ (h0]r£ h2]r¤ h.]r¥ h,]r¦ h4]r§ uh7Nh8hh]r¨ hY)r© }rª (h j¡ h"jŸ h#h&h(h]h*}r« (h0]r¬ h2]r­ h.]r® h,]r¯ h4]r° uh7K¤h]r± (h~)r² }r³ (h X``__complex__``r´ h*}rµ (h0]r¶ h2]r· h.]r¸ h,]r¹ h4]rº uh"j© h]r» hUX __complex__r¼ …r½ }r¾ (h Uh"j² ubah(hubhUX : 1jr¿ …rÀ }rÁ (h X : 1jr h"j© ubeubaubj)rà }rÄ (h X``__float__`` : 1.0rÅ h"jR h#h&h(jh*}rÆ (h0]rÇ h2]rÈ h.]rÉ h,]rÊ h4]rË uh7Nh8hh]rÌ hY)rÍ }rÎ (h jÅ h"jà h#h&h(h]h*}rÏ (h0]rÐ h2]rÑ h.]rÒ h,]rÓ h4]rÔ uh7K¥h]rÕ (h~)rÖ }r× (h X ``__float__``rØ h*}rÙ (h0]rÚ h2]rÛ h.]rÜ h,]rÝ h4]rÞ uh"jÍ h]rß hUX __float__rà …rá }râ (h Uh"jÖ ubah(hubhUX : 1.0rã …rä }rå (h X : 1.0ræ h"jÍ ubeubaubj)rç }rè (h X``__bool__`` : Trueré h"jR h#h&h(jh*}rê (h0]rë h2]rì h.]rí h,]rî h4]rï uh7Nh8hh]rð hY)rñ }rò (h jé h"jç h#h&h(h]h*}ró (h0]rô h2]rõ h.]rö h,]r÷ h4]rø uh7K¦h]rù (h~)rú }rû (h X ``__bool__``rü h*}rý (h0]rþ h2]rÿ h.]r h,]r h4]r uh"jñ h]r hUX__bool__r …r }r (h Uh"jú ubah(hubhUX : Truer …r }r (h X : Truer h"jñ ubeubaubj)r }r (h X``__nonzero__`` : Truer h"jR h#h&h(jh*}r (h0]r h2]r h.]r h,]r h4]r uh7Nh8hh]r hY)r }r (h j h"j h#h&h(h]h*}r (h0]r h2]r h.]r h,]r h4]r uh7K§h]r (h~)r }r (h X``__nonzero__``r h*}r! (h0]r" h2]r# h.]r$ h,]r% h4]r& uh"j h]r' hUX __nonzero__r( …r) }r* (h Uh"j ubah(hubhUX : Truer+ …r, }r- (h X : Truer. h"j ubeubaubj)r/ }r0 (h X``__oct__`` : '1'r1 h"jR h#h&h(jh*}r2 (h0]r3 h2]r4 h.]r5 h,]r6 h4]r7 uh7Nh8hh]r8 hY)r9 }r: (h j1 h"j/ h#h&h(h]h*}r; (h0]r< h2]r= h.]r> h,]r? h4]r@ uh7K¨h]rA (h~)rB }rC (h X ``__oct__``rD h*}rE (h0]rF h2]rG h.]rH h,]rI h4]rJ uh"j9 h]rK hUX__oct__rL …rM }rN (h Uh"jB ubah(hubhUX : '1'rO …rP }rQ (h X : '1'rR h"j9 ubeubaubj)rS }rT (h X``__hex__`` : '0x1'rU h"jR h#h&h(jh*}rV (h0]rW h2]rX h.]rY h,]rZ h4]r[ uh7Nh8hh]r\ hY)r] }r^ (h jU h"jS h#h&h(h]h*}r_ (h0]r` h2]ra h.]rb h,]rc h4]rd uh7K©h]re (h~)rf }rg (h X ``__hex__``rh h*}ri (h0]rj h2]rk h.]rl h,]rm h4]rn uh"j] h]ro hUX__hex__rp …rq }rr (h Uh"jf ubah(hubhUX : '0x1'rs …rt }ru (h X : '0x1'rv h"j] ubeubaubj)rw }rx (h X``__long__`` : long(1)ry h"jR h#h&h(jh*}rz (h0]r{ h2]r| h.]r} h,]r~ h4]r uh7Nh8hh]r€ hY)r }r‚ (h jy h"jw h#h&h(h]h*}rƒ (h0]r„ h2]r… h.]r† h,]r‡ h4]rˆ uh7Kªh]r‰ (h~)rŠ }r‹ (h X ``__long__``rŒ h*}r (h0]rŽ h2]r h.]r h,]r‘ h4]r’ uh"j h]r“ hUX__long__r” …r• }r– (h Uh"jŠ ubah(hubhUX : long(1)r— …r˜ }r™ (h X : long(1)rš h"j ubeubaubj)r› }rœ (h X``__index__`` : 1r h"jR h#h&h(jh*}rž (h0]rŸ h2]r  h.]r¡ h,]r¢ h4]r£ uh7Nh8hh]r¤ hY)r¥ }r¦ (h j h"j› h#h&h(h]h*}r§ (h0]r¨ h2]r© h.]rª h,]r« h4]r¬ uh7K«h]r­ (h~)r® }r¯ (h X ``__index__``r° h*}r± (h0]r² h2]r³ h.]r´ h,]rµ h4]r¶ uh"j¥ h]r· hUX __index__r¸ …r¹ }rº (h Uh"j® ubah(hubhUX : 1r» …r¼ }r½ (h X : 1r¾ h"j¥ ubeubaubj)r¿ }rÀ (h X(``__hash__`` : default hash for the mockrÁ h"jR h#h&h(jh*}r (h0]rà h2]rÄ h.]rÅ h,]rÆ h4]rÇ uh7Nh8hh]rÈ hY)rÉ }rÊ (h jÁ h"j¿ h#h&h(h]h*}rË (h0]rÌ h2]rÍ h.]rÎ h,]rÏ h4]rÐ uh7K¬h]rÑ (h~)rÒ }rÓ (h X ``__hash__``rÔ h*}rÕ (h0]rÖ h2]r× h.]rØ h,]rÙ h4]rÚ uh"jÉ h]rÛ hUX__hash__rÜ …rÝ }rÞ (h Uh"jÒ ubah(hubhUX : default hash for the mockrß …rà }rá (h X : default hash for the mockrâ h"jÉ ubeubaubj)rã }rä (h X&``__str__`` : default str for the mockrå h"jR h#h&h(jh*}ræ (h0]rç h2]rè h.]ré h,]rê h4]rë uh7Nh8hh]rì hY)rí }rî (h jå h"jã h#h&h(h]h*}rï (h0]rð h2]rñ h.]rò h,]ró h4]rô uh7K­h]rõ (h~)rö }r÷ (h X ``__str__``rø h*}rù (h0]rú h2]rû h.]rü h,]rý h4]rþ uh"jí h]rÿ hUX__str__r…r}r(h Uh"jö ubah(hubhUX : default str for the mockr…r}r(h X : default str for the mockrh"jí ubeubaubj)r}r(h X.``__unicode__`` : default unicode for the mockr h"jR h#h&h(jh*}r (h0]r h2]r h.]r h,]rh4]ruh7Nh8hh]rhY)r}r(h j h"jh#h&h(h]h*}r(h0]rh2]rh.]rh,]rh4]ruh7K®h]r(h~)r}r(h X``__unicode__``rh*}r(h0]rh2]rh.]r h,]r!h4]r"uh"jh]r#hUX __unicode__r$…r%}r&(h Uh"jubah(hubhUX : default unicode for the mockr'…r(}r)(h X : default unicode for the mockr*h"jubeubaubj)r+}r,(h X,``__sizeof__``: default sizeof for the mock r-h"jR h#h&h(jh*}r.(h0]r/h2]r0h.]r1h,]r2h4]r3uh7Nh8hh]r4hY)r5}r6(h X+``__sizeof__``: default sizeof for the mockr7h"j+h#h&h(h]h*}r8(h0]r9h2]r:h.]r;h,]r<h4]r=uh7K¯h]r>(h~)r?}r@(h X``__sizeof__``rAh*}rB(h0]rCh2]rDh.]rEh,]rFh4]rGuh"j5h]rHhUX __sizeof__rI…rJ}rK(h Uh"j?ubah(hubhUX: default sizeof for the mockrL…rM}rN(h X: default sizeof for the mockrOh"j5ubeubaubeubhY)rP}rQ(h X For example:rRh"jh#h&h(h]h*}rS(h0]rTh2]rUh.]rVh,]rWh4]rXuh7K±h8hh]rYhUX For example:rZ…r[}r\(h jRh"jPubaubj*)r]}r^(h Xw>>> mock = MagicMock() >>> int(mock) 1 >>> len(mock) 0 >>> hex(mock) '0x1' >>> list(mock) [] >>> object() in mock Falser_h"jh#h&h(j.h*}r`(U testnodetyperaXdoctestrbj2j3h,]rch.]rdh0]reh2]rfh4]rgUgroupsrh]rij;aj<}rjuh7K³h8hh]rkhUXw>>> mock = MagicMock() >>> int(mock) 1 >>> len(mock) 0 >>> hex(mock) '0x1' >>> list(mock) [] >>> object() in mock Falserl…rm}rn(h Uh"j]ubaubhY)ro}rp(h XØThe two equality method, `__eq__` and `__ne__`, are special (changed in 0.7.2). They do the default equality comparison on identity, using a side effect, unless you change their return value to return something else:rqh"jh#h&h(h]h*}rr(h0]rsh2]rth.]ruh,]rvh4]rwuh7KÁh8hh]rx(hUXThe two equality method, ry…rz}r{(h XThe two equality method, r|h"joubjP)r}}r~(h X`__eq__`rh*}r€(h0]rh2]r‚h.]rƒh,]r„h4]r…uh"joh]r†hUX__eq__r‡…rˆ}r‰(h Uh"j}ubah(j^ubhUX and rŠ…r‹}rŒ(h X and rh"joubjP)rŽ}r(h X`__ne__`rh*}r‘(h0]r’h2]r“h.]r”h,]r•h4]r–uh"joh]r—hUX__ne__r˜…r™}rš(h Uh"jŽubah(j^ubhUXª, are special (changed in 0.7.2). They do the default equality comparison on identity, using a side effect, unless you change their return value to return something else:r›…rœ}r(h Xª, are special (changed in 0.7.2). They do the default equality comparison on identity, using a side effect, unless you change their return value to return something else:ržh"joubeubj*)rŸ}r (h X‚>>> MagicMock() == 3 False >>> MagicMock() != 3 True >>> mock = MagicMock() >>> mock.__eq__.return_value = True >>> mock == 3 Truer¡h"jh#h&h(j.h*}r¢(U testnodetyper£Xdoctestr¤j2j3h,]r¥h.]r¦h0]r§h2]r¨h4]r©Ugroupsrª]r«j;aj<}r¬uh7KÅh8hh]r­hUX‚>>> MagicMock() == 3 False >>> MagicMock() != 3 True >>> mock = MagicMock() >>> mock.__eq__.return_value = True >>> mock == 3 Truer®…r¯}r°(h Uh"jŸubaubhY)r±}r²(h X¾In `0.8` the `__iter__` also gained special handling implemented with a side effect. The return value of `MagicMock.__iter__` can be any iterable object and isn't required to be an iterator:r³h"jh#h&h(h]h*}r´(h0]rµh2]r¶h.]r·h,]r¸h4]r¹uh7KÐh8hh]rº(hUXIn r»…r¼}r½(h XIn r¾h"j±ubjP)r¿}rÀ(h X`0.8`rÁh*}rÂ(h0]rÃh2]rÄh.]rÅh,]rÆh4]rÇuh"j±h]rÈhUX0.8rÉ…rÊ}rË(h Uh"j¿ubah(j^ubhUX the rÌ…rÍ}rÎ(h X the rÏh"j±ubjP)rÐ}rÑ(h X `__iter__`rÒh*}rÓ(h0]rÔh2]rÕh.]rÖh,]r×h4]rØuh"j±h]rÙhUX__iter__rÚ…rÛ}rÜ(h Uh"jÐubah(j^ubhUXR also gained special handling implemented with a side effect. The return value of rÝ…rÞ}rß(h XR also gained special handling implemented with a side effect. The return value of ràh"j±ubjP)rá}râ(h X`MagicMock.__iter__`rãh*}rä(h0]råh2]ræh.]rçh,]rèh4]réuh"j±h]rêhUXMagicMock.__iter__rë…rì}rí(h Uh"jáubah(j^ubhUXA can be any iterable object and isn't required to be an iterator:rî…rï}rð(h XA can be any iterable object and isn't required to be an iterator:rñh"j±ubeubj*)rò}ró(h X…>>> mock = MagicMock() >>> mock.__iter__.return_value = ['a', 'b', 'c'] >>> list(mock) ['a', 'b', 'c'] >>> list(mock) ['a', 'b', 'c']rôh"jh#h&h(j.h*}rõ(U testnodetyperöXdoctestr÷j2j3h,]røh.]rùh0]rúh2]rûh4]rüUgroupsrý]rþj;aj<}rÿuh7KÔh8hh]rhUX…>>> mock = MagicMock() >>> mock.__iter__.return_value = ['a', 'b', 'c'] >>> list(mock) ['a', 'b', 'c'] >>> list(mock) ['a', 'b', 'c']r…r}r(h Uh"jòubaubhY)r}r(h X‰If the return value *is* an iterator, then iterating over it once will consume it and subsequent iterations will result in an empty list:rh"jh#h&h(h]h*}r(h0]rh2]r h.]r h,]r h4]r uh7KÝh8hh]r (hUXIf the return value r…r}r(h XIf the return value rh"jubhØ)r}r(h X*is*rh*}r(h0]rh2]rh.]rh,]rh4]ruh"jh]rhUXisr…r}r(h Uh"jubah(hæubhUXq an iterator, then iterating over it once will consume it and subsequent iterations will result in an empty list:r…r }r!(h Xq an iterator, then iterating over it once will consume it and subsequent iterations will result in an empty list:r"h"jubeubj*)r#}r$(h Xg>>> mock.__iter__.return_value = iter(['a', 'b', 'c']) >>> list(mock) ['a', 'b', 'c'] >>> list(mock) []r%h"jh#h&h(j.h*}r&(U testnodetyper'Xdoctestr(j2j3h,]r)h.]r*h0]r+h2]r,h4]r-Ugroupsr.]r/j;aj<}r0uh7Kàh8hh]r1hUXg>>> mock.__iter__.return_value = iter(['a', 'b', 'c']) >>> list(mock) ['a', 'b', 'c'] >>> list(mock) []r2…r3}r4(h Uh"j#ubaubhY)r5}r6(h X™``MagicMock`` has all of the supported magic methods configured except for some of the obscure and obsolete ones. You can still set these up if you want.r7h"jh#h&h(h]h*}r8(h0]r9h2]r:h.]r;h,]r<h4]r=uh7Kèh8hh]r>(h~)r?}r@(h X ``MagicMock``rAh*}rB(h0]rCh2]rDh.]rEh,]rFh4]rGuh"j5h]rHhUX MagicMockrI…rJ}rK(h Uh"j?ubah(hubhUXŒ has all of the supported magic methods configured except for some of the obscure and obsolete ones. You can still set these up if you want.rL…rM}rN(h XŒ has all of the supported magic methods configured except for some of the obscure and obsolete ones. You can still set these up if you want.rOh"j5ubeubhY)rP}rQ(h XOMagic methods that are supported but not setup by default in ``MagicMock`` are:rRh"jh#h&h(h]h*}rS(h0]rTh2]rUh.]rVh,]rWh4]rXuh7Këh8hh]rY(hUX=Magic methods that are supported but not setup by default in rZ…r[}r\(h X=Magic methods that are supported but not setup by default in r]h"jPubh~)r^}r_(h X ``MagicMock``r`h*}ra(h0]rbh2]rch.]rdh,]reh4]rfuh"jPh]rghUX MagicMockrh…ri}rj(h Uh"j^ubah(hubhUX are:rk…rl}rm(h X are:rnh"jPubeubj )ro}rp(h Uh"jh#h&h(j h*}rq(jX*h,]rrh.]rsh0]rth2]ruh4]rvuh7Kíh8hh]rw(j)rx}ry(h X ``__cmp__``rzh"joh#h&h(jh*}r{(h0]r|h2]r}h.]r~h,]rh4]r€uh7Nh8hh]rhY)r‚}rƒ(h jzh"jxh#h&h(h]h*}r„(h0]r…h2]r†h.]r‡h,]rˆh4]r‰uh7Kíh]rŠh~)r‹}rŒ(h jzh*}r(h0]rŽh2]rh.]rh,]r‘h4]r’uh"j‚h]r“hUX__cmp__r”…r•}r–(h Uh"j‹ubah(hubaubaubj)r—}r˜(h X%``__getslice__`` and ``__setslice__``r™h"joh#h&h(jh*}rš(h0]r›h2]rœh.]rh,]ržh4]rŸuh7Nh8hh]r hY)r¡}r¢(h j™h"j—h#h&h(h]h*}r£(h0]r¤h2]r¥h.]r¦h,]r§h4]r¨uh7Kîh]r©(h~)rª}r«(h X``__getslice__``r¬h*}r­(h0]r®h2]r¯h.]r°h,]r±h4]r²uh"j¡h]r³hUX __getslice__r´…rµ}r¶(h Uh"jªubah(hubhUX and r·…r¸}r¹(h X and rºh"j¡ubh~)r»}r¼(h X``__setslice__``r½h*}r¾(h0]r¿h2]rÀh.]rÁh,]rÂh4]rÃuh"j¡h]rÄhUX __setslice__rÅ…rÆ}rÇ(h Uh"j»ubah(hubeubaubj)rÈ}rÉ(h X``__coerce__``rÊh"joh#h&h(jh*}rË(h0]rÌh2]rÍh.]rÎh,]rÏh4]rÐuh7Nh8hh]rÑhY)rÒ}rÓ(h jÊh"jÈh#h&h(h]h*}rÔ(h0]rÕh2]rÖh.]r×h,]rØh4]rÙuh7Kïh]rÚh~)rÛ}rÜ(h jÊh*}rÝ(h0]rÞh2]rßh.]ràh,]ráh4]râuh"jÒh]rãhUX __coerce__rä…rå}ræ(h Uh"jÛubah(hubaubaubj)rç}rè(h X``__subclasses__``réh"joh#h&h(jh*}rê(h0]rëh2]rìh.]ríh,]rîh4]rïuh7Nh8hh]rðhY)rñ}rò(h jéh"jçh#h&h(h]h*}ró(h0]rôh2]rõh.]röh,]r÷h4]røuh7Kðh]rùh~)rú}rû(h jéh*}rü(h0]rýh2]rþh.]rÿh,]rh4]ruh"jñh]rhUX__subclasses__r…r}r(h Uh"júubah(hubaubaubj)r}r(h X ``__dir__``rh"joh#h&h(jh*}r (h0]r h2]r h.]r h,]r h4]ruh7Nh8hh]rhY)r}r(h jh"jh#h&h(h]h*}r(h0]rh2]rh.]rh,]rh4]ruh7Kñh]rh~)r}r(h jh*}r(h0]rh2]rh.]rh,]rh4]r uh"jh]r!hUX__dir__r"…r#}r$(h Uh"jubah(hubaubaubj)r%}r&(h X``__format__``r'h"joh#h&h(jh*}r((h0]r)h2]r*h.]r+h,]r,h4]r-uh7Nh8hh]r.hY)r/}r0(h j'h"j%h#h&h(h]h*}r1(h0]r2h2]r3h.]r4h,]r5h4]r6uh7Kòh]r7h~)r8}r9(h j'h*}r:(h0]r;h2]r<h.]r=h,]r>h4]r?uh"j/h]r@hUX __format__rA…rB}rC(h Uh"j8ubah(hubaubaubj)rD}rE(h X+``__get__``, ``__set__`` and ``__delete__``rFh"joh#h&h(jh*}rG(h0]rHh2]rIh.]rJh,]rKh4]rLuh7Nh8hh]rMhY)rN}rO(h jFh"jDh#h&h(h]h*}rP(h0]rQh2]rRh.]rSh,]rTh4]rUuh7Kóh]rV(h~)rW}rX(h X ``__get__``rYh*}rZ(h0]r[h2]r\h.]r]h,]r^h4]r_uh"jNh]r`hUX__get__ra…rb}rc(h Uh"jWubah(hubhUX, rd…re}rf(h X, rgh"jNubh~)rh}ri(h X ``__set__``rjh*}rk(h0]rlh2]rmh.]rnh,]roh4]rpuh"jNh]rqhUX__set__rr…rs}rt(h Uh"jhubah(hubhUX and ru…rv}rw(h X and rxh"jNubh~)ry}rz(h X``__delete__``r{h*}r|(h0]r}h2]r~h.]rh,]r€h4]ruh"jNh]r‚hUX __delete__rƒ…r„}r…(h Uh"jyubah(hubeubaubj)r†}r‡(h X$``__reversed__`` and ``__missing__``rˆh"joh#h&h(jh*}r‰(h0]rŠh2]r‹h.]rŒh,]rh4]rŽuh7Nh8hh]rhY)r}r‘(h jˆh"j†h#h&h(h]h*}r’(h0]r“h2]r”h.]r•h,]r–h4]r—uh7Kôh]r˜(h~)r™}rš(h X``__reversed__``r›h*}rœ(h0]rh2]ržh.]rŸh,]r h4]r¡uh"jh]r¢hUX __reversed__r£…r¤}r¥(h Uh"j™ubah(hubhUX and r¦…r§}r¨(h X and r©h"jubh~)rª}r«(h X``__missing__``r¬h*}r­(h0]r®h2]r¯h.]r°h,]r±h4]r²uh"jh]r³hUX __missing__r´…rµ}r¶(h Uh"jªubah(hubeubaubj)r·}r¸(h Xq``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, ``__getstate__`` and ``__setstate__``r¹h"joh#h&h(jh*}rº(h0]r»h2]r¼h.]r½h,]r¾h4]r¿uh7Nh8hh]rÀhY)rÁ}rÂ(h Xq``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, ``__getstate__`` and ``__setstate__``rÃh"j·h#h&h(h]h*}rÄ(h0]rÅh2]rÆh.]rÇh,]rÈh4]rÉuh7Kõh]rÊ(h~)rË}rÌ(h X``__reduce__``rÍh*}rÎ(h0]rÏh2]rÐh.]rÑh,]rÒh4]rÓuh"jÁh]rÔhUX __reduce__rÕ…rÖ}r×(h Uh"jËubah(hubhUX, rØ…rÙ}rÚ(h X, rÛh"jÁubh~)rÜ}rÝ(h X``__reduce_ex__``rÞh*}rß(h0]ràh2]ráh.]râh,]rãh4]räuh"jÁh]råhUX __reduce_ex__ræ…rç}rè(h Uh"jÜubah(hubhUX, ré…rê}rë(h X, rìh"jÁubh~)rí}rî(h X``__getinitargs__``rïh*}rð(h0]rñh2]ròh.]róh,]rôh4]rõuh"jÁh]röhUX__getinitargs__r÷…rø}rù(h Uh"jíubah(hubhUX, rú…rû}rü(h X, rýh"jÁubh~)rþ}rÿ(h X``__getnewargs__``rh*}r(h0]rh2]rh.]rh,]rh4]ruh"jÁh]rhUX__getnewargs__r…r }r (h Uh"jþubah(hubhUX, r …r }r (h X, rh"jÁubh~)r}r(h X``__getstate__``rh*}r(h0]rh2]rh.]rh,]rh4]ruh"jÁh]rhUX __getstate__r…r}r(h Uh"jubah(hubhUX and r…r}r(h X and rh"jÁubh~)r }r!(h X``__setstate__``r"h*}r#(h0]r$h2]r%h.]r&h,]r'h4]r(uh"jÁh]r)hUX __setstate__r*…r+}r,(h Uh"j ubah(hubeubaubj)r-}r.(h X*``__getformat__`` and ``__setformat__`` r/h"joh#h&h(jh*}r0(h0]r1h2]r2h.]r3h,]r4h4]r5uh7Nh8hh]r6hY)r7}r8(h X'``__getformat__`` and ``__setformat__``r9h"j-h#h&h(h]h*}r:(h0]r;h2]r<h.]r=h,]r>h4]r?uh7K÷h]r@(h~)rA}rB(h X``__getformat__``rCh*}rD(h0]rEh2]rFh.]rGh,]rHh4]rIuh"j7h]rJhUX __getformat__rK…rL}rM(h Uh"jAubah(hubhUX and rN…rO}rP(h X and rQh"j7ubh~)rR}rS(h X``__setformat__``rTh*}rU(h0]rVh2]rWh.]rXh,]rYh4]rZuh"j7h]r[hUX __setformat__r\…r]}r^(h Uh"jRubah(hubeubaubeubcdocutils.nodes transition r_)r`}ra(h X ------------rbh"jh#h&h(U transitionrch*}rd(h0]reh2]rfh.]rgh,]rhh4]riuh7Kûh8hh]rjubcdocutils.nodes footnote rk)rl}rm(h XäMagic methods *should* be looked up on the class rather than the instance. Different versions of Python are inconsistent about applying this rule. The supported protocol methods should work with all supported versions of Python.rnh"jh#h&h(Ufootnoteroh*}rp(hÊKh,]rqhah.]rrhÌah0]rsh2]rth4]ruU1auh7Kýh8hh]rv(cdocutils.nodes label rw)rx}ry(h Uh"jlh#Nh(Ulabelrzh*}r{(h0]r|h2]r}h.]r~h,]rh4]r€uh7Nh8hh]rhUX1…r‚}rƒ(h Uh"jxubaubhY)r„}r…(h XäMagic methods *should* be looked up on the class rather than the instance. Different versions of Python are inconsistent about applying this rule. The supported protocol methods should work with all supported versions of Python.r†h"jlh#h&h(h]h*}r‡(h0]rˆh2]r‰h.]rŠh,]r‹h4]rŒuh7Kýh]r(hUXMagic methods rŽ…r}r(h XMagic methods r‘h"j„ubhØ)r’}r“(h X*should*r”h*}r•(h0]r–h2]r—h.]r˜h,]r™h4]ršuh"j„h]r›hUXshouldrœ…r}rž(h Uh"j’ubah(hæubhUXÎ be looked up on the class rather than the instance. Different versions of Python are inconsistent about applying this rule. The supported protocol methods should work with all supported versions of Python.rŸ…r }r¡(h XÎ be looked up on the class rather than the instance. Different versions of Python are inconsistent about applying this rule. The supported protocol methods should work with all supported versions of Python.r¢h"j„ubeubeubjk)r£}r¤(h XnThe function is basically hooked up to the class, but each ``Mock`` instance is kept isolated from the others.r¥h"jh#h&h(joh*}r¦(hÊKh,]r§hah.]r¨j ah0]r©h2]rªh4]r«U2auh7Mh8hh]r¬(jw)r­}r®(h Uh"j£h#Nh(jzh*}r¯(h0]r°h2]r±h.]r²h,]r³h4]r´uh7Nh8hh]rµhUX2…r¶}r·(h Uh"j­ubaubhY)r¸}r¹(h XnThe function is basically hooked up to the class, but each ``Mock`` instance is kept isolated from the others.rºh"j£h#h&h(h]h*}r»(h0]r¼h2]r½h.]r¾h,]r¿h4]rÀuh7Mh]rÁ(hUX;The function is basically hooked up to the class, but each rÂ…rÃ}rÄ(h X;The function is basically hooked up to the class, but each rÅh"j¸ubh~)rÆ}rÇ(h X``Mock``rÈh*}rÉ(h0]rÊh2]rËh.]rÌh,]rÍh4]rÎuh"j¸h]rÏhUXMockrÐ…rÑ}rÒ(h Uh"jÆubah(hubhUX+ instance is kept isolated from the others.rÓ…rÔ}rÕ(h X+ instance is kept isolated from the others.rÖh"j¸ubeubeubeubeh UU transformerr×NU footnote_refsrØ}rÙUrefnamesrÚ}rÛUsymbol_footnotesrÜ]rÝUautofootnote_refsrÞ]rß(hÄjeUsymbol_footnote_refsrà]ráU citationsrâ]rãh8hU current_lineräNUtransform_messagesrå]ræcdocutils.nodes system_message rç)rè}ré(h Uh*}rê(h0]rëUlevelrìKh,]ríh.]rîUsourcerïh&h2]rðh4]rñUlineròKUtyperóUINFOrôuh]rõhY)rö}r÷(h Uh*}rø(h0]rùh2]rúh.]rûh,]rüh4]rýuh"jèh]rþhUX3Hyperlink target "magic-methods" is not referenced.rÿ…r}r(h Uh"jöubah(h]ubah(Usystem_messagerubaUreporterrNUid_startrKU autofootnotesr]r(jlj£eU citation_refsr}rUindirect_targetsr ]r Usettingsr (cdocutils.frontend Values r or }r(Ufootnote_backlinksrKUrecord_dependenciesrNU rfc_base_urlrUhttp://tools.ietf.org/html/rU tracebackrˆUpep_referencesrNUstrip_commentsrNU toc_backlinksrUentryrU language_coderUenrU datestamprNU report_levelrKU _destinationrNU halt_levelrKU strip_classesrNhMNUerror_encoding_error_handlerrUbackslashreplacer Udebugr!NUembed_stylesheetr"‰Uoutput_encoding_error_handlerr#Ustrictr$U sectnum_xformr%KUdump_transformsr&NU docinfo_xformr'KUwarning_streamr(NUpep_file_url_templater)Upep-%04dr*Uexit_status_levelr+KUconfigr,NUstrict_visitorr-NUcloak_email_addressesr.ˆUtrim_footnote_reference_spacer/‰Uenvr0NUdump_pseudo_xmlr1NUexpose_internalsr2NUsectsubtitle_xformr3‰U source_linkr4NUrfc_referencesr5NUoutput_encodingr6Uutf-8r7U source_urlr8NUinput_encodingr9U utf-8-sigr:U_disable_configr;NU id_prefixr<UU tab_widthr=KUerror_encodingr>U mac-romanr?U_sourcer@U /compile/mock/docs/magicmock.txtrAUgettext_compactrBˆU generatorrCNUdump_internalsrDNU pep_base_urlrEUhttp://www.python.org/dev/peps/rFUsyntax_highlightrGUshortrHUinput_encoding_error_handlerrIj$Uauto_id_prefixrJUidrKUdoctitle_xformrL‰Ustrip_elements_with_classesrMNU _config_filesrN]rOUfile_insertion_enabledrPKU raw_enabledrQKU dump_settingsrRNubUsymbol_footnote_startrSKUidsrT}rU(hj hj7 hjhh;hjlhj£hÌhÄj jhh¥hh;uUsubstitution_namesrV}rWh(h8h*}rX(h0]rYh,]rZh.]r[Usourcer\h&h2]r]h4]r^uU footnotesr_]r`Urefidsra}rb(h]rchah]rdhÄah]rejauub.mock-1.0.1/html/.doctrees/mock.doctree0000644000076500001200000045105712046030507020314 0ustar michaeladmin00000000000000€cdocutils.nodes document q)q}q(U nametypesq}q(Xdeleting-attributesqˆXmock.NonCallableMockqˆXmock.Mock.attach_mockqˆX mock.Mockq ˆXmock.Mock.__class__q ˆXmock.Mock.method_callsq ˆXmock.Mock._get_child_mockq ˆXmock.Mock.mock_add_specq ˆXmock.Mock.__dir__qˆXthe mock classqNXmock.Mock.return_valueqˆU1ˆXmock.Mock.side_effectqˆXmock.Mock.mock_callsqˆXmock.Mock.reset_mockqˆXmock.Mock.call_countqˆXmock.Mock.assert_any_callqˆXattaching mocks as attributesqNXmock.Mock.call_args_listqˆXmock.Mock.calledqˆXmock.PropertyMockqˆXmock.Mock.assert_has_callsqˆXmock.Mock.configure_mockqˆXcallingqNXmock.Mock.assert_called_withqˆXmock.Mock.call_argsqˆX!mock.Mock.assert_called_once_withqˆXdeleting attributesq NuUsubstitution_defsq!}q"Uparse_messagesq#]q$Ucurrent_sourceq%NU decorationq&NUautofootnote_startq'KUnameidsq(}q)(hUdeleting-attributesq*hhhhh h h h h h h h h h hhhUthe-mock-classq+hhU1Uid3q,hhhhhhhhhhhUattaching-mocks-as-attributesq-hhhhhhhhhhhUcallingq.hhhhhhh Uid2q/uUchildrenq0]q1(cdocutils.nodes section q2)q3}q4(U rawsourceq5UUparentq6hUsourceq7cdocutils.nodes reprunicode q8X/compile/mock/docs/mock.txtq9…q:}q;bUtagnameq}q?(Udupnamesq@]qAUclassesqB]qCUbackrefsqD]qEUidsqF]qGh+aUnamesqH]qIhauUlineqJKUdocumentqKhh0]qL(cdocutils.nodes title qM)qN}qO(h5XThe Mock ClassqPh6h3h7h:h}qR(h@]qShB]qThD]qUhF]qVhH]qWuhJKhKhh0]qXcdocutils.nodes Text qYXThe Mock ClassqZ…q[}q\(h5hPh6hNubaubcdocutils.nodes comment q])q^}q_(h5Xclass SomeClass: passq`h6h3h7h:h}qb(U testnodetypeqcX testsetupqdU xml:spaceqeUpreserveqfhF]qghD]qhh@]qihB]qjhH]qkUgroupsql]qmUdefaultqnaUoptionsqo}qpuhJKhKhh0]qqhYXclass SomeClass: passqr…qs}qt(h5Uh6h^ubaubcdocutils.nodes paragraph qu)qv}qw(h5Xb`Mock` is a flexible mock object intended to replace the use of stubs and test doubles throughout your code. Mocks are callable and create attributes as new mocks when you access them [#]_. Accessing the same attribute will always return the same mock. Mocks record how you use them, allowing you to make assertions about what your code has done to them.qxh6h3h7h:h}qz(h@]q{hB]q|hD]q}hF]q~hH]quhJK hKhh0]q€(cdocutils.nodes title_reference q)q‚}qƒ(h5X`Mock`q„h>}q…(h@]q†hB]q‡hD]qˆhF]q‰hH]qŠuh6hvh0]q‹hYXMockqŒ…q}qŽ(h5Uh6h‚ubah}qš(Uautoq›KhF]qœUid1qahD]qžh@]qŸhB]q hH]q¡Urefidq¢h,uh0]q£hYX1…q¤}q¥(h5Uh6h•ubaubhYX¦. Accessing the same attribute will always return the same mock. Mocks record how you use them, allowing you to make assertions about what your code has done to them.q¦…q§}q¨(h5X¦. Accessing the same attribute will always return the same mock. Mocks record how you use them, allowing you to make assertions about what your code has done to them.q©h6hvubeubhu)qª}q«(h5X:class:`MagicMock` is a subclass of `Mock` with all the magic methods pre-created and ready to use. There are also non-callable variants, useful when you are mocking out objects that aren't callable: :class:`NonCallableMock` and :class:`NonCallableMagicMock`q¬h6h3h7h:h}q­(h@]q®hB]q¯hD]q°hF]q±hH]q²uhJKhKhh0]q³(csphinx.addnodes pending_xref q´)qµ}q¶(h5X:class:`MagicMock`q·h6hªh7h:h}q¹(UreftypeqºXclassq»Urefwarnq¼‰U reftargetq½X MagicMockq¾U refdomainq¿XpyqÀhF]qÁhD]qÂU refexplicitqÉh@]qÄhB]qÅhH]qÆUrefdocqÇUmockqÈUpy:classqÉNU py:moduleqÊXmockqËuhJKh0]qÌcdocutils.nodes literal qÍ)qÎ}qÏ(h5h·h>}qÐ(h@]qÑhB]qÒ(UxrefqÓhÀXpy-classqÔehD]qÕhF]qÖhH]q×uh6hµh0]qØhYX MagicMockqÙ…qÚ}qÛ(h5Uh6hÎubah}qä(h@]qåhB]qæhD]qçhF]qèhH]qéuh6hªh0]qêhYXMockqë…qì}qí(h5Uh6háubah}qõ(UreftypeqöXclassq÷h¼‰h½XNonCallableMockqøU refdomainqùXpyqúhF]qûhD]qüU refexplicitqý‰h@]qþhB]qÿhH]rhÇhÈhÉNhÊhËuhJKh0]rhÍ)r}r(h5hôh>}r(h@]rhB]r(hÓhúXpy-classrehD]rhF]r hH]r uh6hòh0]r hYXNonCallableMockr …r }r(h5Uh6jubah}r(UreftyperXclassrh¼‰h½XNonCallableMagicMockrU refdomainrXpyrhF]rhD]rU refexplicitr‰h@]rhB]r hH]r!hÇhÈhÉNhÊhËuhJKh0]r"hÍ)r#}r$(h5jh>}r%(h@]r&hB]r'(hÓjXpy-classr(ehD]r)hF]r*hH]r+uh6jh0]r,hYXNonCallableMagicMockr-…r.}r/(h5Uh6j#ubah}r3(h@]r4hB]r5hD]r6hF]r7hH]r8uhJKhKhh0]r9(hYXThe r:…r;}r<(h5XThe r=h6j0ubh´)r>}r?(h5X :func:`patch`r@h6j0h7h:h}rA(UreftyperBXfuncrCh¼‰h½XpatchrDU refdomainrEXpyrFhF]rGhD]rHU refexplicitrI‰h@]rJhB]rKhH]rLhÇhÈhÉNhÊhËuhJKh0]rMhÍ)rN}rO(h5j@h>}rP(h@]rQhB]rR(hÓjFXpy-funcrSehD]rThF]rUhH]rVuh6j>h0]rWhYXpatch()rX…rY}rZ(h5Uh6jNubah}rb(h@]rchB]rdhD]rehF]rfhH]rguh6j0h0]rhhYXMockri…rj}rk(h5Uh6j_ubah}rs(h@]rthB]ruhD]rvhF]rwhH]rxuh6j0h0]ryhYXpatchrz…r{}r|(h5Uh6jpubah}r„(h@]r…hB]r†hD]r‡hF]rˆhH]r‰uh6j0h0]rŠhYX MagicMockr‹…rŒ}r(h5Uh6jubah}r•(h@]r–hB]r—hD]r˜hF]r™hH]ršuh6j0h0]r›hYXMockrœ…r}rž(h5Uh6j’ubah}r¦(h@]r§hB]r¨hD]r©hF]rªhH]r«uh6j0h0]r¬hYX new_callabler­…r®}r¯(h5Uh6j£ubah}r·(h@]r¸hB]r¹hD]rºhF]r»hH]r¼uh6j0h0]r½hYXpatchr¾…r¿}rÀ(h5Uh6j´ubah}rÇ(hF]rÈhD]rÉh@]rÊhB]rËhH]rÌUentriesrÍ]rÎ(UsinglerÏX side_effectUindex-0rÐUtrÑaUinlinerÒ‰uhJKhKhh0]rÓubcdocutils.nodes target rÔ)rÕ}rÖ(h5Uh6h3h7h:h}rØ(h@]rÙhB]rÚhD]rÛhF]rÜjÐahH]rÝuhJKhKhh0]rÞubjÃ)rß}rà(h5Uh6h3h7h:h}rá(hF]râhD]rãh@]rähB]råhH]ræjÍ]rç(jÏX return_valueUindex-1rèUtréajÒ‰uhJKhKhh0]rêubjÔ)rë}rì(h5Uh6h3h7h:h}rí(h@]rîhB]rïhD]rðhF]rñjèahH]ròuhJKhKhh0]róubjÃ)rô}rõ(h5Uh6h3h7h:h}rö(hF]r÷hD]røh@]rùhB]rúhH]rûjÍ]rü(jÏXwrapsUindex-2rýUtrþajÒ‰uhJKhKhh0]rÿubjÔ)r}r(h5Uh6h3h7h:h}r(h@]rhB]rhD]rhF]rjýahH]ruhJKhKhh0]rubjÃ)r }r (h5Uh6h3h7h:h}r (hF]r hD]r h@]rhB]rhH]rjÍ]r(jÏXnameUindex-3rUtrajÒ‰uhJK hKhh0]rubjÔ)r}r(h5Uh6h3h7h:h}r(h@]rhB]rhD]rhF]rjahH]ruhJK hKhh0]rubjÃ)r}r(h5Uh6h3h7h:h}r (hF]r!hD]r"h@]r#hB]r$hH]r%jÍ]r&(jÏXspecUindex-4r'Utr(ajÒ‰uhJK"hKhh0]r)ubjÔ)r*}r+(h5Uh6h3h7h:h}r,(h@]r-hB]r.hD]r/hF]r0j'ahH]r1uhJK"hKhh0]r2ubjÃ)r3}r4(h5Uh6h3h7Nh}r5(hF]r6hD]r7h@]r8hB]r9hH]r:Uentriesr;]r<(jÏXMock (class in mock)h Utr=auhJNhKhh0]r>ubcsphinx.addnodes desc r?)r@}rA(h5Uh6h3h7Nh}rC(UnoindexrD‰UdomainrEXpyrFhF]rGhD]rHh@]rIhB]rJhH]rKUobjtyperLXclassrMUdesctyperNjMuhJNhKhh0]rO(csphinx.addnodes desc_signature rP)rQ}rR(h5XgMock(spec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec_set=None, **kwargs)rSh6j@h7h:h}rU(hF]rVh aUmodulerWhËhD]rXh@]rYhB]rZhH]r[h aUfullnamer\XMockr]Uclassr^UUfirstr_‰uhJM hKhh0]r`(csphinx.addnodes desc_annotation ra)rb}rc(h5Xclass rdh6jQh7h:h}rf(h@]rghB]rhhD]rihF]rjhH]rkuhJM hKhh0]rlhYXclass rm…rn}ro(h5Uh6jbubaubcsphinx.addnodes desc_name rp)rq}rr(h5j]h6jQh7h:h}rt(h@]ruhB]rvhD]rwhF]rxhH]ryuhJM hKhh0]rzhYXMockr{…r|}r}(h5Uh6jqubaubcsphinx.addnodes desc_parameterlist r~)r}r€(h5Uh6jQh7h:h}r‚(h@]rƒhB]r„hD]r…hF]r†hH]r‡uhJM hKhh0]rˆ(csphinx.addnodes desc_parameter r‰)rŠ}r‹(h5X spec=NonerŒh>}r(h@]rŽhB]rhD]rhF]r‘hH]r’uh6jh0]r“hYX spec=Noner”…r•}r–(h5Uh6jŠubah}r›(h@]rœhB]rhD]ržhF]rŸhH]r uh6jh0]r¡hYXside_effect=Noner¢…r£}r¤(h5Uh6j˜ubah}r¨(h@]r©hB]rªhD]r«hF]r¬hH]r­uh6jh0]r®hYXreturn_value=DEFAULTr¯…r°}r±(h5Uh6j¥ubah}rµ(h@]r¶hB]r·hD]r¸hF]r¹hH]rºuh6jh0]r»hYX wraps=Noner¼…r½}r¾(h5Uh6j²ubah}rÂ(h@]rÃhB]rÄhD]rÅhF]rÆhH]rÇuh6jh0]rÈhYX name=NonerÉ…rÊ}rË(h5Uh6j¿ubah}rÏ(h@]rÐhB]rÑhD]rÒhF]rÓhH]rÔuh6jh0]rÕhYX spec_set=NonerÖ…r×}rØ(h5Uh6jÌubah}rÜ(h@]rÝhB]rÞhD]rßhF]ràhH]ráuh6jh0]râhYX**kwargsrã…rä}rå(h5Uh6jÙubah}rê(h@]rëhB]rìhD]ríhF]rîhH]rïuhJM hKhh0]rð(hu)rñ}rò(h5XrCreate a new `Mock` object. `Mock` takes several optional arguments that specify the behaviour of the Mock object:róh6jçh7h:h}rô(h@]rõhB]röhD]r÷hF]røhH]rùuhJK%hKhh0]rú(hYX Create a new rû…rü}rý(h5X Create a new rþh6jñubh)rÿ}r(h5X`Mock`rh>}r(h@]rhB]rhD]rhF]rhH]ruh6jñh0]rhYXMockr …r }r (h5Uh6jÿubah}r(h@]rhB]rhD]rhF]rhH]ruh6jñh0]rhYXMockr…r}r(h5Uh6jubah}r%(Ubulletr&X*hF]r'hD]r(h@]r)hB]r*hH]r+uhJK(hKhh0]r,(cdocutils.nodes list_item r-)r.}r/(h5X`spec`: This can be either a list of strings or an existing object (a class or instance) that acts as the specification for the mock object. If you pass in an object then a list of strings is formed by calling dir on the object (excluding unsupported magic attributes and methods). Accessing any attribute not in this list will raise an `AttributeError`. If `spec` is an object (rather than a list of strings) then :attr:`__class__` returns the class of the spec object. This allows mocks to pass `isinstance` tests. r0h6j"h7h:h}r2(h@]r3hB]r4hD]r5hF]r6hH]r7uhJNhKhh0]r8(hu)r9}r:(h5Xb`spec`: This can be either a list of strings or an existing object (a class or instance) that acts as the specification for the mock object. If you pass in an object then a list of strings is formed by calling dir on the object (excluding unsupported magic attributes and methods). Accessing any attribute not in this list will raise an `AttributeError`.r;h6j.h7h:h}r<(h@]r=hB]r>hD]r?hF]r@hH]rAuhJK(h0]rB(h)rC}rD(h5X`spec`rEh>}rF(h@]rGhB]rHhD]rIhF]rJhH]rKuh6j9h0]rLhYXspecrM…rN}rO(h5Uh6jCubah}rW(h@]rXhB]rYhD]rZhF]r[hH]r\uh6j9h0]r]hYXAttributeErrorr^…r_}r`(h5Uh6jTubah}rf(h@]rghB]rhhD]rihF]rjhH]rkuhJK.h0]rl(hYXIf rm…rn}ro(h5XIf rph6jcubh)rq}rr(h5X`spec`rsh>}rt(h@]ruhB]rvhD]rwhF]rxhH]ryuh6jch0]rzhYXspecr{…r|}r}(h5Uh6jqubah}r…(Ureftyper†Xattrr‡h¼‰h½X __class__rˆU refdomainr‰XpyrŠhF]r‹hD]rŒU refexplicitr‰h@]rŽhB]rhH]rhÇhÈhÉj]hÊhËuhJK.h0]r‘hÍ)r’}r“(h5j„h>}r”(h@]r•hB]r–(hÓjŠXpy-attrr—ehD]r˜hF]r™hH]ršuh6j‚h0]r›hYX __class__rœ…r}rž(h5Uh6j’ubah}r¦(h@]r§hB]r¨hD]r©hF]rªhH]r«uh6jch0]r¬hYX isinstancer­…r®}r¯(h5Uh6j£ubah}r·(h@]r¸hB]r¹hD]rºhF]r»hH]r¼uhJNhKhh0]r½hu)r¾}r¿(h5X´`spec_set`: A stricter variant of `spec`. If used, attempting to *set* or get an attribute on the mock that isn't on the object passed as `spec_set` will raise an `AttributeError`.rÀh6j´h7h:h}rÁ(h@]rÂhB]rÃhD]rÄhF]rÅhH]rÆuhJK2h0]rÇ(h)rÈ}rÉ(h5X `spec_set`rÊh>}rË(h@]rÌhB]rÍhD]rÎhF]rÏhH]rÐuh6j¾h0]rÑhYXspec_setrÒ…rÓ}rÔ(h5Uh6jÈubah}rÜ(h@]rÝhB]rÞhD]rßhF]ràhH]ráuh6j¾h0]râhYXspecrã…rä}rå(h5Uh6jÙubah}rî(h@]rïhB]rðhD]rñhF]ròhH]róuh6j¾h0]rôhYXsetrõ…rö}r÷(h5Uh6jëubah}r(h@]rhB]rhD]rhF]rhH]ruh6j¾h0]rhYXspec_setr…r}r (h5Uh6jýubah}r(h@]rhB]rhD]rhF]rhH]ruh6j¾h0]rhYXAttributeErrorr…r}r(h5Uh6jubah}r (h@]r!hB]r"hD]r#hF]r$hH]r%uhJNhKhh0]r&(hu)r'}r((h5XW`side_effect`: A function to be called whenever the Mock is called. See the :attr:`~Mock.side_effect` attribute. Useful for raising exceptions or dynamically changing return values. The function is called with the same arguments as the mock, and unless it returns :data:`DEFAULT`, the return value of this function is used as the return value.r)h6jh7h:h}r*(h@]r+hB]r,hD]r-hF]r.hH]r/uhJK6h0]r0(h)r1}r2(h5X `side_effect`r3h>}r4(h@]r5hB]r6hD]r7hF]r8hH]r9uh6j'h0]r:hYX side_effectr;…r<}r=(h5Uh6j1ubah…r?}r@(h5X?: A function to be called whenever the Mock is called. See the rAh6j'ubh´)rB}rC(h5X:attr:`~Mock.side_effect`rDh6j'h7h:h}rE(UreftyperFXattrrGh¼‰h½XMock.side_effectrHU refdomainrIXpyrJhF]rKhD]rLU refexplicitrM‰h@]rNhB]rOhH]rPhÇhÈhÉj]hÊhËuhJK6h0]rQhÍ)rR}rS(h5jDh>}rT(h@]rUhB]rV(hÓjJXpy-attrrWehD]rXhF]rYhH]rZuh6jBh0]r[hYX side_effectr\…r]}r^(h5Uh6jRubah}rf(UreftypergXdatarhh¼‰h½XDEFAULTriU refdomainrjXpyrkhF]rlhD]rmU refexplicitrn‰h@]rohB]rphH]rqhÇhÈhÉj]hÊhËuhJK6h0]rrhÍ)rs}rt(h5jeh>}ru(h@]rvhB]rw(hÓjkXpy-datarxehD]ryhF]rzhH]r{uh6jch0]r|hYXDEFAULTr}…r~}r(h5Uh6jsubah}r‡(h@]rˆhB]r‰hD]rŠhF]r‹hH]rŒuhJK}r•(h@]r–hB]r—hD]r˜hF]r™hH]ršuh6j„h0]r›hYX side_effectrœ…r}rž(h5Uh6j’ubah}r¦(h@]r§hB]r¨hD]r©hF]rªhH]r«uhJK?h0]r¬(hYXIf r­…r®}r¯(h5XIf r°h6j£ubh)r±}r²(h5X `side_effect`r³h>}r´(h@]rµhB]r¶hD]r·hF]r¸hH]r¹uh6j£h0]rºhYX side_effectr»…r¼}r½(h5Uh6j±ubah}rÅ(h@]rÆhB]rÇhD]rÈhF]rÉhH]rÊuhJKCh0]rË(hYXA rÌ…rÍ}rÎ(h5XA rÏh6jÂubh)rÐ}rÑ(h5X `side_effect`rÒh>}rÓ(h@]rÔhB]rÕhD]rÖhF]r×hH]rØuh6jÂh0]rÙhYX side_effectrÚ…rÛ}rÜ(h5Uh6jÐubah}rä(h@]råhB]ræhD]rçhF]rèhH]réuh6jÂh0]rêhYXNonerë…rì}rí(h5Uh6jáubah}ró(h@]rôhB]rõhD]röhF]r÷hH]røuhJNhKhh0]rùhu)rú}rû(h5Xœ`return_value`: The value returned when the mock is called. By default this is a new Mock (created on first access). See the :attr:`return_value` attribute.rüh6jðh7h:h}rý(h@]rþhB]rÿhD]rhF]rhH]ruhJKEh0]r(h)r}r(h5X`return_value`rh>}r(h@]rhB]r hD]r hF]r hH]r uh6júh0]r hYX return_valuer…r}r(h5Uh6jubah}r(UreftyperXattrrh¼‰h½X return_valuerU refdomainrXpyrhF]rhD]rU refexplicitr ‰h@]r!hB]r"hH]r#hÇhÈhÉj]hÊhËuhJKEh0]r$hÍ)r%}r&(h5jh>}r'(h@]r(hB]r)(hÓjXpy-attrr*ehD]r+hF]r,hH]r-uh6jh0]r.hYX return_valuer/…r0}r1(h5Uh6j%ubah}r9(h@]r:hB]r;hD]r<hF]r=hH]r>uhJNhKhh0]r?(hu)r@}rA(h5X`wraps`: Item for the mock object to wrap. If `wraps` is not None then calling the Mock will pass the call through to the wrapped object (returning the real result and ignoring `return_value`). Attribute access on the mock will return a Mock object that wraps the corresponding attribute of the wrapped object (so attempting to access an attribute that doesn't exist will raise an `AttributeError`).rBh6j6h7h:h}rC(h@]rDhB]rEhD]rFhF]rGhH]rHuhJKIh0]rI(h)rJ}rK(h5X`wraps`rLh>}rM(h@]rNhB]rOhD]rPhF]rQhH]rRuh6j@h0]rShYXwrapsrT…rU}rV(h5Uh6jJubah}r^(h@]r_hB]r`hD]rahF]rbhH]rcuh6j@h0]rdhYXwrapsre…rf}rg(h5Uh6j[ubah}ro(h@]rphB]rqhD]rrhF]rshH]rtuh6j@h0]ruhYX return_valuerv…rw}rx(h5Uh6jlubah}r€(h@]rhB]r‚hD]rƒhF]r„hH]r…uh6j@h0]r†hYXAttributeErrorr‡…rˆ}r‰(h5Uh6j}ubah}r‘(h@]r’hB]r“hD]r”hF]r•hH]r–uhJKPh0]r—(hYXIf the mock has an explicit r˜…r™}rš(h5XIf the mock has an explicit r›h6jŽubh)rœ}r(h5X`return_value`ržh>}rŸ(h@]r hB]r¡hD]r¢hF]r£hH]r¤uh6jŽh0]r¥hYX return_valuer¦…r§}r¨(h5Uh6jœubah}r°(h@]r±hB]r²hD]r³hF]r´hH]rµuh6jŽh0]r¶hYX return_valuer·…r¸}r¹(h5Uh6j­ubah}rÁ(h@]rÂhB]rÃhD]rÄhF]rÅhH]rÆuhJNhKhh0]rÇhu)rÈ}rÉ(h5X•`name`: If the mock has a name then it will be used in the repr of the mock. This can be useful for debugging. The name is propagated to child mocks.rÊh6j¾h7h:h}rË(h@]rÌhB]rÍhD]rÎhF]rÏhH]rÐuhJKSh0]rÑ(h)rÒ}rÓ(h5X`name`rÔh>}rÕ(h@]rÖhB]r×hD]rØhF]rÙhH]rÚuh6jÈh0]rÛhYXnamerÜ…rÝ}rÞ(h5Uh6jÒubah}ræ(h@]rçhB]rèhD]réhF]rêhH]rëuhJKWhKhh0]rì(hYX‰Mocks can also be called with arbitrary keyword arguments. These will be used to set attributes on the mock after it is created. See the rí…rî}rï(h5X‰Mocks can also be called with arbitrary keyword arguments. These will be used to set attributes on the mock after it is created. See the rðh6jãubh´)rñ}rò(h5X:meth:`configure_mock`róh6jãh7h:h}rô(UreftyperõXmethröh¼‰h½Xconfigure_mockr÷U refdomainrøXpyrùhF]rúhD]rûU refexplicitrü‰h@]rýhB]rþhH]rÿhÇhÈhÉj]hÊhËuhJKWh0]rhÍ)r}r(h5jóh>}r(h@]rhB]r(hÓjùXpy-methrehD]rhF]rhH]r uh6jñh0]r hYXconfigure_mock()r …r }r (h5Uh6jubah}r(hF]rhD]rh@]rhB]rhH]rUentriesr]r(jÏX"assert_called_with() (Mock method)hUtrauhJNhKhh0]rubj?)r}r(h5Uh6jçh7Nh}r (jD‰jEXpyr!hF]r"hD]r#h@]r$hB]r%hH]r&jLXmethodr'jNj'uhJNhKhh0]r((jP)r)}r*(h5X#assert_called_with(*args, **kwargs)r+h6jh7h:h}r,(hF]r-hajWhËhD]r.h@]r/hB]r0hH]r1haj\XMock.assert_called_withr2j^j]j_‰uhJKhhKhh0]r3(jp)r4}r5(h5Xassert_called_withr6h6j)h7h:h}r7(h@]r8hB]r9hD]r:hF]r;hH]r<uhJKhhKhh0]r=hYXassert_called_withr>…r?}r@(h5Uh6j4ubaubj~)rA}rB(h5Uh6j)h7h:h}rC(h@]rDhB]rEhD]rFhF]rGhH]rHuhJKhhKhh0]rI(j‰)rJ}rK(h5X*argsrLh>}rM(h@]rNhB]rOhD]rPhF]rQhH]rRuh6jAh0]rShYX*argsrT…rU}rV(h5Uh6jJubah}rZ(h@]r[hB]r\hD]r]hF]r^hH]r_uh6jAh0]r`hYX**kwargsra…rb}rc(h5Uh6jWubah}rf(h@]rghB]rhhD]rihF]rjhH]rkuhJKhhKhh0]rl(hu)rm}rn(h5XUThis method is a convenient way of asserting that calls are made in a particular way:roh6jdh7h:h}rp(h@]rqhB]rrhD]rshF]rthH]ruuhJK^hKhh0]rvhYXUThis method is a convenient way of asserting that calls are made in a particular way:rw…rx}ry(h5joh6jmubaubcdocutils.nodes literal_block rz)r{}r|(h5X“>>> mock = Mock() >>> mock.method(1, 2, 3, test='wow') >>> mock.method.assert_called_with(1, 2, 3, test='wow')r}h6jdh7h:h}r(U testnodetyper€XdoctestrhehfhF]r‚hD]rƒh@]r„hB]r…hH]r†Ugroupsr‡]rˆhnaho}r‰uhJKahKhh0]rŠhYX“>>> mock = Mock() >>> mock.method(1, 2, 3, test='wow') >>> mock.method.assert_called_with(1, 2, 3, test='wow')r‹…rŒ}r(h5Uh6j{ubaubeubeubjÃ)rŽ}r(h5Uh6jçh7Nh}r(hF]r‘hD]r’h@]r“hB]r”hH]r•Uentriesr–]r—(jÏX'assert_called_once_with() (Mock method)hUtr˜auhJNhKhh0]r™ubj?)rš}r›(h5Uh6jçh7Nh}rœ(jD‰jEXpyrhF]ržhD]rŸh@]r hB]r¡hH]r¢jLXmethodr£jNj£uhJNhKhh0]r¤(jP)r¥}r¦(h5X(assert_called_once_with(*args, **kwargs)r§h6jšh7h:h}r¨(hF]r©hajWhËhD]rªh@]r«hB]r¬hH]r­haj\XMock.assert_called_once_withr®j^j]j_‰uhJKyhKhh0]r¯(jp)r°}r±(h5Xassert_called_once_withr²h6j¥h7h:h}r³(h@]r´hB]rµhD]r¶hF]r·hH]r¸uhJKyhKhh0]r¹hYXassert_called_once_withrº…r»}r¼(h5Uh6j°ubaubj~)r½}r¾(h5Uh6j¥h7h:h}r¿(h@]rÀhB]rÁhD]rÂhF]rÃhH]rÄuhJKyhKhh0]rÅ(j‰)rÆ}rÇ(h5X*argsrÈh>}rÉ(h@]rÊhB]rËhD]rÌhF]rÍhH]rÎuh6j½h0]rÏhYX*argsrÐ…rÑ}rÒ(h5Uh6jÆubah}rÖ(h@]r×hB]rØhD]rÙhF]rÚhH]rÛuh6j½h0]rÜhYX**kwargsrÝ…rÞ}rß(h5Uh6jÓubah}râ(h@]rãhB]rähD]råhF]ræhH]rçuhJKyhKhh0]rè(hu)ré}rê(h5XNAssert that the mock was called exactly once and with the specified arguments.rëh6jàh7h:h}rì(h@]ríhB]rîhD]rïhF]rðhH]rñuhJKkhKhh0]ròhYXNAssert that the mock was called exactly once and with the specified arguments.ró…rô}rõ(h5jëh6jéubaubjz)rö}r÷(h5X#>>> mock = Mock(return_value=None) >>> mock('foo', bar='baz') >>> mock.assert_called_once_with('foo', bar='baz') >>> mock('foo', bar='baz') >>> mock.assert_called_once_with('foo', bar='baz') Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times.røh6jàh7h:h}rù(U testnodetyperúXdoctestrûhehfhF]rühD]rýh@]rþhB]rÿhH]rUgroupsr]rhnaho}ruhJKnhKhh0]rhYX#>>> mock = Mock(return_value=None) >>> mock('foo', bar='baz') >>> mock.assert_called_once_with('foo', bar='baz') >>> mock('foo', bar='baz') >>> mock.assert_called_once_with('foo', bar='baz') Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times.r…r}r(h5Uh6jöubaubeubeubjÃ)r}r (h5Uh6jçh7Nh}r (hF]r hD]r h@]r hB]rhH]rUentriesr]r(jÏXassert_any_call() (Mock method)hUtrauhJNhKhh0]rubj?)r}r(h5Uh6jçh7Nh}r(jD‰jEXpyrhF]rhD]rh@]rhB]rhH]rjLXmethodrjNjuhJNhKhh0]r(jP)r}r (h5X assert_any_call(*args, **kwargs)r!h6jh7h:h}r"(hF]r#hajWhËhD]r$h@]r%hB]r&hH]r'haj\XMock.assert_any_callr(j^j]j_‰uhJK‰hKhh0]r)(jp)r*}r+(h5Xassert_any_callr,h6jh7h:h}r-(h@]r.hB]r/hD]r0hF]r1hH]r2uhJK‰hKhh0]r3hYXassert_any_callr4…r5}r6(h5Uh6j*ubaubj~)r7}r8(h5Uh6jh7h:h}r9(h@]r:hB]r;hD]r<hF]r=hH]r>uhJK‰hKhh0]r?(j‰)r@}rA(h5X*argsrBh>}rC(h@]rDhB]rEhD]rFhF]rGhH]rHuh6j7h0]rIhYX*argsrJ…rK}rL(h5Uh6j@ubah}rP(h@]rQhB]rRhD]rShF]rThH]rUuh6j7h0]rVhYX**kwargsrW…rX}rY(h5Uh6jMubah}r\(h@]r]hB]r^hD]r_hF]r`hH]rauhJK‰hKhh0]rb(hu)rc}rd(h5X=assert the mock has been called with the specified arguments.reh6jZh7h:h}rf(h@]rghB]rhhD]rihF]rjhH]rkuhJK|hKhh0]rlhYX=assert the mock has been called with the specified arguments.rm…rn}ro(h5jeh6jcubaubhu)rp}rq(h5X®The assert passes if the mock has *ever* been called, unlike :meth:`assert_called_with` and :meth:`assert_called_once_with` that only pass if the call is the most recent one.rrh6jZh7h:h}rs(h@]rthB]ruhD]rvhF]rwhH]rxuhJK~hKhh0]ry(hYX"The assert passes if the mock has rz…r{}r|(h5X"The assert passes if the mock has r}h6jpubjê)r~}r(h5X*ever*r€h>}r(h@]r‚hB]rƒhD]r„hF]r…hH]r†uh6jph0]r‡hYXeverrˆ…r‰}rŠ(h5Uh6j~ubah}r’(Ureftyper“Xmethr”h¼‰h½Xassert_called_withr•U refdomainr–Xpyr—hF]r˜hD]r™U refexplicitrš‰h@]r›hB]rœhH]rhÇhÈhÉj]hÊhËuhJK~h0]ržhÍ)rŸ}r (h5j‘h>}r¡(h@]r¢hB]r£(hÓj—Xpy-methr¤ehD]r¥hF]r¦hH]r§uh6jh0]r¨hYXassert_called_with()r©…rª}r«(h5Uh6jŸubah}r³(Ureftyper´Xmethrµh¼‰h½Xassert_called_once_withr¶U refdomainr·Xpyr¸hF]r¹hD]rºU refexplicitr»‰h@]r¼hB]r½hH]r¾hÇhÈhÉj]hÊhËuhJK~h0]r¿hÍ)rÀ}rÁ(h5j²h>}rÂ(h@]rÃhB]rÄ(hÓj¸Xpy-methrÅehD]rÆhF]rÇhH]rÈuh6j°h0]rÉhYXassert_called_once_with()rÊ…rË}rÌ(h5Uh6jÀubah>> mock = Mock(return_value=None) >>> mock(1, 2, arg='thing') >>> mock('some', 'thing', 'else') >>> mock.assert_any_call(1, 2, arg='thing')rÓh6jZh7h:h}rÔ(U testnodetyperÕXdoctestrÖhehfhF]r×hD]rØh@]rÙhB]rÚhH]rÛUgroupsrÜ]rÝhnaho}rÞuhJK‚hKhh0]rßhYXŒ>>> mock = Mock(return_value=None) >>> mock(1, 2, arg='thing') >>> mock('some', 'thing', 'else') >>> mock.assert_any_call(1, 2, arg='thing')rà…rá}râ(h5Uh6jÑubaubeubeubjÃ)rã}rä(h5Uh6jçh7Nh}rå(hF]ræhD]rçh@]rèhB]réhH]rêUentriesrë]rì(jÏX assert_has_calls() (Mock method)hUtríauhJNhKhh0]rîubj?)rï}rð(h5Uh6jçh7Nh}rñ(jD‰jEXpyròhF]róhD]rôh@]rõhB]röhH]r÷jLXmethodrøjNjøuhJNhKhh0]rù(jP)rú}rû(h5X(assert_has_calls(calls, any_order=False)rüh6jïh7h:h}rý(hF]rþhajWhËhD]rÿh@]rhB]rhH]rhaj\XMock.assert_has_callsrj^j]j_‰uhJK¢hKhh0]r(jp)r}r(h5Xassert_has_callsrh6júh7h:h}r(h@]r hB]r hD]r hF]r hH]r uhJK¢hKhh0]rhYXassert_has_callsr…r}r(h5Uh6jubaubj~)r}r(h5Uh6júh7h:h}r(h@]rhB]rhD]rhF]rhH]ruhJK¢hKhh0]r(j‰)r}r(h5Xcallsrh>}r(h@]rhB]r hD]r!hF]r"hH]r#uh6jh0]r$hYXcallsr%…r&}r'(h5Uh6jubah}r+(h@]r,hB]r-hD]r.hF]r/hH]r0uh6jh0]r1hYXany_order=Falser2…r3}r4(h5Uh6j(ubah}r7(h@]r8hB]r9hD]r:hF]r;hH]r<uhJK¢hKhh0]r=(hu)r>}r?(h5Xiassert the mock has been called with the specified calls. The `mock_calls` list is checked for the calls.r@h6j5h7h:h}rA(h@]rBhB]rChD]rDhF]rEhH]rFuhJKŒhKhh0]rG(hYX>assert the mock has been called with the specified calls. The rH…rI}rJ(h5X>assert the mock has been called with the specified calls. The rKh6j>ubh)rL}rM(h5X `mock_calls`rNh>}rO(h@]rPhB]rQhD]rRhF]rShH]rTuh6j>h0]rUhYX mock_callsrV…rW}rX(h5Uh6jLubahubeubhu)r]}r^(h5X†If `any_order` is False (the default) then the calls must be sequential. There can be extra calls before or after the specified calls.r_h6j5h7h:h}r`(h@]rahB]rbhD]rchF]rdhH]reuhJKhKhh0]rf(hYXIf rg…rh}ri(h5XIf rjh6j]ubh)rk}rl(h5X `any_order`rmh>}rn(h@]rohB]rphD]rqhF]rrhH]rsuh6j]h0]rthYX any_orderru…rv}rw(h5Uh6jkubah}r(h@]r€hB]rhD]r‚hF]rƒhH]r„uhJK“hKhh0]r…(hYXIf r†…r‡}rˆ(h5XIf r‰h6j|ubh)rŠ}r‹(h5X `any_order`rŒh>}r(h@]rŽhB]rhD]rhF]r‘hH]r’uh6j|h0]r“hYX any_orderr”…r•}r–(h5Uh6jŠubah}rž(UreftyperŸXattrr h¼‰h½X mock_callsr¡U refdomainr¢Xpyr£hF]r¤hD]r¥U refexplicitr¦‰h@]r§hB]r¨hH]r©hÇhÈhÉj]hÊhËuhJK“h0]rªhÍ)r«}r¬(h5jh>}r­(h@]r®hB]r¯(hÓj£Xpy-attrr°ehD]r±hF]r²hH]r³uh6j›h0]r´hYX mock_callsrµ…r¶}r·(h5Uh6j«ubah>> mock = Mock(return_value=None) >>> mock(1) >>> mock(2) >>> mock(3) >>> mock(4) >>> calls = [call(2), call(3)] >>> mock.assert_has_calls(calls) >>> calls = [call(4), call(2), call(3)] >>> mock.assert_has_calls(calls, any_order=True)r¼h6j5h7h:h}r½(U testnodetyper¾Xdoctestr¿hehfhF]rÀhD]rÁh@]rÂhB]rÃhH]rÄUgroupsrÅ]rÆhnaho}rÇuhJK–hKhh0]rÈhYXë>>> mock = Mock(return_value=None) >>> mock(1) >>> mock(2) >>> mock(3) >>> mock(4) >>> calls = [call(2), call(3)] >>> mock.assert_has_calls(calls) >>> calls = [call(4), call(2), call(3)] >>> mock.assert_has_calls(calls, any_order=True)rÉ…rÊ}rË(h5Uh6jºubaubeubeubjÃ)rÌ}rÍ(h5Uh6jçh7h:h}rÎ(hF]rÏhD]rÐh@]rÑhB]rÒhH]rÓUentriesrÔ]rÕ(jÏXreset_mock() (Mock method)hUtrÖauhJNhKhh0]r×ubj?)rØ}rÙ(h5Uh6jçh7h:h}rÚ(jD‰jEXpyrÛhF]rÜhD]rÝh@]rÞhB]rßhH]ràjLXmethodrájNjáuhJNhKhh0]râ(jP)rã}rä(h5X reset_mock()råh6jØh7h:h}ræ(hF]rçhajWhËhD]rèh@]réhB]rêhH]rëhaj\XMock.reset_mockrìj^j]j_‰uhJK·hKhh0]rí(jp)rî}rï(h5X reset_mockrðh6jãh7h:h}rñ(h@]ròhB]róhD]rôhF]rõhH]röuhJK·hKhh0]r÷hYX reset_mockrø…rù}rú(h5Uh6jîubaubj~)rû}rü(h5Uh6jãh7h:h}rý(h@]rþhB]rÿhD]r hF]r hH]r uhJK·hKhh0]r ubeubjæ)r }r (h5Uh6jØh7h:h}r (h@]r hB]r hD]r hF]r hH]r uhJK·hKhh0]r (hu)r }r (h5XFThe reset_mock method resets all the call attributes on a mock object:r h6j h7h:h}r (h@]r hB]r hD]r hF]r hH]r uhJK¥hKhh0]r hYXFThe reset_mock method resets all the call attributes on a mock object:r …r }r (h5j h6j ubaubjz)r }r (h5Xu>>> mock = Mock(return_value=None) >>> mock('hello') >>> mock.called True >>> mock.reset_mock() >>> mock.called Falser h6j h7h:h}r (U testnodetyper Xdoctestr hehfhF]r hD]r! h@]r" hB]r# hH]r$ Ugroupsr% ]r& hnaho}r' uhJK§hKhh0]r( hYXu>>> mock = Mock(return_value=None) >>> mock('hello') >>> mock.called True >>> mock.reset_mock() >>> mock.called Falser) …r* }r+ (h5Uh6j ubaubhu)r, }r- (h5X)This can be useful where you want to make a series of assertions that reuse the same object. Note that `reset_mock` *doesn't* clear the return value, :attr:`side_effect` or any child attributes you have set using normal assignment. Child mocks and the return value mock (if any) are reset as well.r. h6j h7h:h}r/ (h@]r0 hB]r1 hD]r2 hF]r3 hH]r4 uhJK±hKhh0]r5 (hYXgThis can be useful where you want to make a series of assertions that reuse the same object. Note that r6 …r7 }r8 (h5XgThis can be useful where you want to make a series of assertions that reuse the same object. Note that r9 h6j, ubh)r: }r; (h5X `reset_mock`r< h>}r= (h@]r> hB]r? hD]r@ hF]rA hH]rB uh6j, h0]rC hYX reset_mockrD …rE }rF (h5Uh6j: ubah}rL (h@]rM hB]rN hD]rO hF]rP hH]rQ uh6j, h0]rR hYXdoesn'trS …rT }rU (h5Uh6jI ubah}r] (Ureftyper^ Xattrr_ h¼‰h½X side_effectr` U refdomainra Xpyrb hF]rc hD]rd U refexplicitre ‰h@]rf hB]rg hH]rh hÇhÈhÉj]hÊhËuhJK±h0]ri hÍ)rj }rk (h5j\ h>}rl (h@]rm hB]rn (hÓjb Xpy-attrro ehD]rp hF]rq hH]rr uh6jZ h0]rs hYX side_effectrt …ru }rv (h5Uh6jj ubah}r} (hF]r~ hD]r h@]r€ hB]r hH]r‚ Uentriesrƒ ]r„ (jÏXmock_add_spec() (Mock method)h Utr… auhJNhKhh0]r† ubj?)r‡ }rˆ (h5Uh6jçh7h:h}r‰ (jD‰jEXpyrŠ hF]r‹ hD]rŒ h@]r hB]rŽ hH]r jLXmethodr jNj uhJNhKhh0]r‘ (jP)r’ }r“ (h5X#mock_add_spec(spec, spec_set=False)r” h6j‡ h7h:h}r• (hF]r– h ajWhËhD]r— h@]r˜ hB]r™ hH]rš h aj\XMock.mock_add_specr› j^j]j_‰uhJKÀhKhh0]rœ (jp)r }rž (h5X mock_add_specrŸ h6j’ h7h:h}r  (h@]r¡ hB]r¢ hD]r£ hF]r¤ hH]r¥ uhJKÀhKhh0]r¦ hYX mock_add_specr§ …r¨ }r© (h5Uh6j ubaubj~)rª }r« (h5Uh6j’ h7h:h}r¬ (h@]r­ hB]r® hD]r¯ hF]r° hH]r± uhJKÀhKhh0]r² (j‰)r³ }r´ (h5Xspecrµ h>}r¶ (h@]r· hB]r¸ hD]r¹ hF]rº hH]r» uh6jª h0]r¼ hYXspecr½ …r¾ }r¿ (h5Uh6j³ ubah}rà (h@]rÄ hB]rÅ hD]rÆ hF]rÇ hH]rÈ uh6jª h0]rÉ hYXspec_set=FalserÊ …rË }rÌ (h5Uh6jÀ ubah}rÏ (h@]rÐ hB]rÑ hD]rÒ hF]rÓ hH]rÔ uhJKÀhKhh0]rÕ (hu)rÖ }r× (h5X”Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock.rØ h6jÍ h7h:h}rÙ (h@]rÚ hB]rÛ hD]rÜ hF]rÝ hH]rÞ uhJKºhKhh0]rß (hYXAdd a spec to a mock. rà …rá }râ (h5XAdd a spec to a mock. rã h6jÖ ubh)rä }rå (h5X`spec`ræ h>}rç (h@]rè hB]ré hD]rê hF]rë hH]rì uh6jÖ h0]rí hYXspecrî …rï }rð (h5Uh6jä ubah}rø (h@]rù hB]rú hD]rû hF]rü hH]rý uh6jÖ h0]rþ hYXspecrÿ …r }r (h5Uh6jõ ubah}r (h@]r hB]r hD]r hF]r hH]r uhJK¾hKhh0]r (hYXIf r …r }r (h5XIf r h6j ubh)r }r (h5X `spec_set`r h>}r (h@]r hB]r hD]r hF]r hH]r uh6j h0]r hYXspec_setr …r }r (h5Uh6j ubah}r( (h@]r) hB]r* hD]r+ hF]r, hH]r- uh6j h0]r. hYXTruer/ …r0 }r1 (h5Uh6j% ubah}r8 (hF]r9 hD]r: h@]r; hB]r< hH]r= Uentriesr> ]r? (jÏXattach_mock() (Mock method)hUtr@ auhJNhKhh0]rA ubj?)rB }rC (h5Uh6jçh7h:h}rD (jD‰jEXpyrE hF]rF hD]rG h@]rH hB]rI hH]rJ jLXmethodrK jNjK uhJNhKhh0]rL (jP)rM }rN (h5Xattach_mock(mock, attribute)rO h6jB h7h:h}rP (hF]rQ hajWhËhD]rR h@]rS hB]rT hH]rU haj\XMock.attach_mockrV j^j]j_‰uhJKÇhKhh0]rW (jp)rX }rY (h5X attach_mockrZ h6jM h7h:h}r[ (h@]r\ hB]r] hD]r^ hF]r_ hH]r` uhJKÇhKhh0]ra hYX attach_mockrb …rc }rd (h5Uh6jX ubaubj~)re }rf (h5Uh6jM h7h:h}rg (h@]rh hB]ri hD]rj hF]rk hH]rl uhJKÇhKhh0]rm (j‰)rn }ro (h5Xmockrp h>}rq (h@]rr hB]rs hD]rt hF]ru hH]rv uh6je h0]rw hYXmockrx …ry }rz (h5Uh6jn ubah}r~ (h@]r hB]r€ hD]r hF]r‚ hH]rƒ uh6je h0]r„ hYX attributer… …r† }r‡ (h5Uh6j{ ubah}rŠ (h@]r‹ hB]rŒ hD]r hF]rŽ hH]r uhJKÇhKhh0]r hu)r‘ }r’ (h5XÀAttach a mock as an attribute of this one, replacing its name and parent. Calls to the attached mock will be recorded in the :attr:`method_calls` and :attr:`mock_calls` attributes of this one.r“ h6jˆ h7h:h}r” (h@]r• hB]r– hD]r— hF]r˜ hH]r™ uhJKÃhKhh0]rš (hYX}Attach a mock as an attribute of this one, replacing its name and parent. Calls to the attached mock will be recorded in the r› …rœ }r (h5X}Attach a mock as an attribute of this one, replacing its name and parent. Calls to the attached mock will be recorded in the rž h6j‘ ubh´)rŸ }r  (h5X:attr:`method_calls`r¡ h6j‘ h7h:h}r¢ (Ureftyper£ Xattrr¤ h¼‰h½X method_callsr¥ U refdomainr¦ Xpyr§ hF]r¨ hD]r© U refexplicitrª ‰h@]r« hB]r¬ hH]r­ hÇhÈhÉj]hÊhËuhJKÃh0]r® hÍ)r¯ }r° (h5j¡ h>}r± (h@]r² hB]r³ (hÓj§ Xpy-attrr´ ehD]rµ hF]r¶ hH]r· uh6jŸ h0]r¸ hYX method_callsr¹ …rº }r» (h5Uh6j¯ ubah}rà (UreftyperÄ XattrrÅ h¼‰h½X mock_callsrÆ U refdomainrÇ XpyrÈ hF]rÉ hD]rÊ U refexplicitrË ‰h@]rÌ hB]rÍ hH]rÎ hÇhÈhÉj]hÊhËuhJKÃh0]rÏ hÍ)rÐ }rÑ (h5j h>}rÒ (h@]rÓ hB]rÔ (hÓjÈ Xpy-attrrÕ ehD]rÖ hF]r× hH]rØ uh6jÀ h0]rÙ hYX mock_callsrÚ …rÛ }rÜ (h5Uh6jÐ ubah}rã (hF]rä hD]rå h@]ræ hB]rç hH]rè Uentriesré ]rê (jÏXconfigure_mock() (Mock method)hUtrë auhJNhKhh0]rì ubj?)rí }rî (h5Uh6jçh7h:h}rï (jD‰jEXpyrð hF]rñ hD]rò h@]ró hB]rô hH]rõ jLXmethodrö jNjö uhJNhKhh0]r÷ (jP)rø }rù (h5Xconfigure_mock(**kwargs)rú h6jí h7h:h}rû (hF]rü hajWhËhD]rý h@]rþ hB]rÿ hH]r haj\XMock.configure_mockr j^j]j_‰uhJKîhKhh0]r (jp)r }r (h5Xconfigure_mockr h6jø h7h:h}r (h@]r hB]r hD]r hF]r hH]r uhJKîhKhh0]r hYXconfigure_mockr …r }r (h5Uh6j ubaubj~)r }r (h5Uh6jø h7h:h}r (h@]r hB]r hD]r hF]r hH]r uhJKîhKhh0]r j‰)r }r (h5X**kwargsr h>}r (h@]r hB]r hD]r hF]r hH]r! uh6j h0]r" hYX**kwargsr# …r$ }r% (h5Uh6j ubah}r( (h@]r) hB]r* hD]r+ hF]r, hH]r- uhJKîhKhh0]r. (hu)r/ }r0 (h5X5Set attributes on the mock through keyword arguments.r1 h6j& h7h:h}r2 (h@]r3 hB]r4 hD]r5 hF]r6 hH]r7 uhJKÊhKhh0]r8 hYX5Set attributes on the mock through keyword arguments.r9 …r: }r; (h5j1 h6j/ ubaubhu)r< }r= (h5X“Attributes plus return values and side effects can be set on child mocks using standard dot notation and unpacking a dictionary in the method call:r> h6j& h7h:h}r? (h@]r@ hB]rA hD]rB hF]rC hH]rD uhJKÌhKhh0]rE hYX“Attributes plus return values and side effects can be set on child mocks using standard dot notation and unpacking a dictionary in the method call:rF …rG }rH (h5j> h6j< ubaubjz)rI }rJ (h5XÏ>>> mock = Mock() >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock.configure_mock(**attrs) >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyErrorrK h6j& h7h:h}rL (U testnodetyperM XdoctestrN hehfhF]rO hD]rP h@]rQ hB]rR hH]rS UgroupsrT ]rU hnaho}rV uhJKÐhKhh0]rW hYXÏ>>> mock = Mock() >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock.configure_mock(**attrs) >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyErrorrX …rY }rZ (h5Uh6jI ubaubhu)r[ }r\ (h5X@The same thing can be achieved in the constructor call to mocks:r] h6j& h7h:h}r^ (h@]r_ hB]r` hD]ra hF]rb hH]rc uhJKÜhKhh0]rd hYX@The same thing can be achieved in the constructor call to mocks:re …rf }rg (h5j] h6j[ ubaubjz)rh }ri (h5Xë>>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock = Mock(some_attribute='eggs', **attrs) >>> mock.some_attribute 'eggs' >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyErrorrj h6j& h7h:h}rk (U testnodetyperl Xdoctestrm hehfhF]rn hD]ro h@]rp hB]rq hH]rr Ugroupsrs ]rt hnaho}ru uhJKÞhKhh0]rv hYXë>>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock = Mock(some_attribute='eggs', **attrs) >>> mock.some_attribute 'eggs' >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyErrorrw …rx }ry (h5Uh6jh ubaubhu)rz }r{ (h5X^`configure_mock` exists to make it easier to do configuration after the mock has been created.r| h6j& h7h:h}r} (h@]r~ hB]r hD]r€ hF]r hH]r‚ uhJKëhKhh0]rƒ (h)r„ }r… (h5X`configure_mock`r† h>}r‡ (h@]rˆ hB]r‰ hD]rŠ hF]r‹ hH]rŒ uh6jz h0]r hYXconfigure_mockrŽ …r }r (h5Uh6j„ ubah}r— (hF]r˜ hD]r™ h@]rš hB]r› hH]rœ Uentriesr ]rž (jÏX__dir__() (Mock method)hUtrŸ auhJNhKhh0]r  ubj?)r¡ }r¢ (h5Uh6jçh7h:h}r£ (jD‰jEXpyr¤ hF]r¥ hD]r¦ h@]r§ hB]r¨ hH]r© jLXmethodrª jNjª uhJNhKhh0]r« (jP)r¬ }r­ (h5X __dir__()r® h6j¡ h7h:h}r¯ (hF]r° hajWhËhD]r± h@]r² hB]r³ hH]r´ haj\X Mock.__dir__rµ j^j]j_‰uhJKøhKhh0]r¶ (jp)r· }r¸ (h5X__dir__r¹ h6j¬ h7h:h}rº (h@]r» hB]r¼ hD]r½ hF]r¾ hH]r¿ uhJKøhKhh0]rÀ hYX__dir__rÁ …r }rà (h5Uh6j· ubaubj~)rÄ }rÅ (h5Uh6j¬ h7h:h}rÆ (h@]rÇ hB]rÈ hD]rÉ hF]rÊ hH]rË uhJKøhKhh0]rÌ ubeubjæ)rÍ }rÎ (h5Uh6j¡ h7h:h}rÏ (h@]rÐ hB]rÑ hD]rÒ hF]rÓ hH]rÔ uhJKøhKhh0]rÕ (hu)rÖ }r× (h5X˜`Mock` objects limit the results of `dir(some_mock)` to useful results. For mocks with a `spec` this includes all the permitted attributes for the mock.rØ h6jÍ h7h:h}rÙ (h@]rÚ hB]rÛ hD]rÜ hF]rÝ hH]rÞ uhJKñhKhh0]rß (h)rà }rá (h5X`Mock`râ h>}rã (h@]rä hB]rå hD]ræ hF]rç hH]rè uh6jÖ h0]ré hYXMockrê …rë }rì (h5Uh6jà ubah}rô (h@]rõ hB]rö hD]r÷ hF]rø hH]rù uh6jÖ h0]rú hYXdir(some_mock)rû …rü }rý (h5Uh6jñ ubah}r (h@]r hB]r hD]r hF]r hH]r uh6jÖ h0]r hYXspecr …r }r (h5Uh6j ubah}r (h@]r hB]r hD]r hF]r hH]r uhJKõhKhh0]r (hYXSee r …r }r (h5XSee r h6j ubh´)r! }r" (h5X:data:`FILTER_DIR`r# h6j h7h:h}r$ (Ureftyper% Xdatar& h¼‰h½X FILTER_DIRr' U refdomainr( Xpyr) hF]r* hD]r+ U refexplicitr, ‰h@]r- hB]r. hH]r/ hÇhÈhÉj]hÊhËuhJKõh0]r0 hÍ)r1 }r2 (h5j# h>}r3 (h@]r4 hB]r5 (hÓj) Xpy-datar6 ehD]r7 hF]r8 hH]r9 uh6j! h0]r: hYX FILTER_DIRr; …r< }r= (h5Uh6j1 ubah …r? }r@ (h5X8 for what this filtering does, and how to switch it off.rA h6j ubeubeubeubjÃ)rB }rC (h5Uh6jçh7h:h}rD (hF]rE hD]rF h@]rG hB]rH hH]rI UentriesrJ ]rK (jÏX_get_child_mock() (Mock method)h UtrL auhJNhKhh0]rM ubj?)rN }rO (h5Uh6jçh7h:h}rP (jD‰jEXpyrQ hF]rR hD]rS h@]rT hB]rU hH]rV jLXmethodrW jNjW uhJNhKhh0]rX (jP)rY }rZ (h5X_get_child_mock(**kw)r[ h6jN h7h:h}r\ (hF]r] h ajWhËhD]r^ h@]r_ hB]r` hH]ra h aj\XMock._get_child_mockrb j^j]j_‰uhJMhKhh0]rc (jp)rd }re (h5X_get_child_mockrf h6jY h7h:h}rg (h@]rh hB]ri hD]rj hF]rk hH]rl uhJMhKhh0]rm hYX_get_child_mockrn …ro }rp (h5Uh6jd ubaubj~)rq }rr (h5Uh6jY h7h:h}rs (h@]rt hB]ru hD]rv hF]rw hH]rx uhJMhKhh0]ry j‰)rz }r{ (h5X**kwr| h>}r} (h@]r~ hB]r hD]r€ hF]r hH]r‚ uh6jq h0]rƒ hYX**kwr„ …r… }r† (h5Uh6jz ubah}r‰ (h@]rŠ hB]r‹ hD]rŒ hF]r hH]rŽ uhJMhKhh0]r (hu)r }r‘ (h5XËCreate the child mocks for attributes and return value. By default child mocks will be the same type as the parent. Subclasses of Mock may want to override this to customize the way child mocks are made.r’ h6j‡ h7h:h}r“ (h@]r” hB]r• hD]r– hF]r— hH]r˜ uhJKûhKhh0]r™ hYXËCreate the child mocks for attributes and return value. By default child mocks will be the same type as the parent. Subclasses of Mock may want to override this to customize the way child mocks are made.rš …r› }rœ (h5j’ h6j ubaubhu)r }rž (h5X[For non-callable mocks the callable variant will be used (rather than any custom subclass).rŸ h6j‡ h7h:h}r  (h@]r¡ hB]r¢ hD]r£ hF]r¤ hH]r¥ uhJMhKhh0]r¦ hYX[For non-callable mocks the callable variant will be used (rather than any custom subclass).r§ …r¨ }r© (h5jŸ h6j ubaubeubeubjÃ)rª }r« (h5Uh6jçh7Nh}r¬ (hF]r­ hD]r® h@]r¯ hB]r° hH]r± Uentriesr² ]r³ (jÏXcalled (Mock attribute)hUtr´ auhJNhKhh0]rµ ubj?)r¶ }r· (h5Uh6jçh7Nh}r¸ (jD‰jEXpyr¹ hF]rº hD]r» h@]r¼ hB]r½ hH]r¾ jLX attributer¿ jNj¿ uhJNhKhh0]rÀ (jP)rÁ }r (h5Xcalledrà h6j¶ h7h:h}rÄ (hF]rÅ hajWhËhD]rÆ h@]rÇ hB]rÈ hH]rÉ haj\X Mock.calledrÊ j^j]j_‰uhJMhKhh0]rË jp)rÌ }rÍ (h5jà h6jÁ h7h:h}rÎ (h@]rÏ hB]rÐ hD]rÑ hF]rÒ hH]rÓ uhJMhKhh0]rÔ hYXcalledrÕ …rÖ }r× (h5Uh6jÌ ubaubaubjæ)rØ }rÙ (h5Uh6j¶ h7h:h}rÚ (h@]rÛ hB]rÜ hD]rÝ hF]rÞ hH]rß uhJMhKhh0]rà (hu)rá }râ (h5XFA boolean representing whether or not the mock object has been called:rã h6jØ h7h:h}rä (h@]rå hB]ræ hD]rç hF]rè hH]ré uhJMhKhh0]rê hYXFA boolean representing whether or not the mock object has been called:rë …rì }rí (h5jã h6já ubaubjz)rî }rï (h5XX>>> mock = Mock(return_value=None) >>> mock.called False >>> mock() >>> mock.called Truerð h6jØ h7h:h}rñ (U testnodetyperò Xdoctestró hehfhF]rô hD]rõ h@]rö hB]r÷ hH]rø Ugroupsrù ]rú hnaho}rû uhJMhKhh0]rü hYXX>>> mock = Mock(return_value=None) >>> mock.called False >>> mock() >>> mock.called Truerý …rþ }rÿ (h5Uh6jî ubaubeubeubjÃ)r }r (h5Uh6jçh7Nh}r (hF]r hD]r h@]r hB]r hH]r Uentriesr ]r (jÏXcall_count (Mock attribute)hUtr auhJNhKhh0]r ubj?)r }r (h5Uh6jçh7Nh}r (jD‰jEXpyr hF]r hD]r h@]r hB]r hH]r jLX attributer jNj uhJNhKhh0]r (jP)r }r (h5X call_countr h6j h7h:h}r (hF]r hajWhËhD]r h@]r hB]r hH]r haj\XMock.call_countr j^j]j_‰uhJMhKhh0]r! jp)r" }r# (h5j h6j h7h:h}r$ (h@]r% hB]r& hD]r' hF]r( hH]r) uhJMhKhh0]r* hYX call_countr+ …r, }r- (h5Uh6j" ubaubaubjæ)r. }r/ (h5Uh6j h7h:h}r0 (h@]r1 hB]r2 hD]r3 hF]r4 hH]r5 uhJMhKhh0]r6 (hu)r7 }r8 (h5XFAn integer telling you how many times the mock object has been called:r9 h6j. h7h:h}r: (h@]r; hB]r< hD]r= hF]r> hH]r? uhJMhKhh0]r@ hYXFAn integer telling you how many times the mock object has been called:rA …rB }rC (h5j9 h6j7 ubaubjz)rD }rE (h5Xd>>> mock = Mock(return_value=None) >>> mock.call_count 0 >>> mock() >>> mock() >>> mock.call_count 2rF h6j. h7h:h}rG (U testnodetyperH XdoctestrI hehfhF]rJ hD]rK h@]rL hB]rM hH]rN UgroupsrO ]rP hnaho}rQ uhJMhKhh0]rR hYXd>>> mock = Mock(return_value=None) >>> mock.call_count 0 >>> mock() >>> mock() >>> mock.call_count 2rS …rT }rU (h5Uh6jD ubaubeubeubjÃ)rV }rW (h5Uh6jçh7Nh}rX (hF]rY hD]rZ h@]r[ hB]r\ hH]r] Uentriesr^ ]r_ (jÏXreturn_value (Mock attribute)hUtr` auhJNhKhh0]ra ubj?)rb }rc (h5Uh6jçh7Nh}rd (jD‰jEXpyre hF]rf hD]rg h@]rh hB]ri hH]rj jLX attributerk jNjk uhJNhKhh0]rl (jP)rm }rn (h5X return_valuero h6jb h7h:h}rp (hF]rq hajWhËhD]rr h@]rs hB]rt hH]ru haj\XMock.return_valuerv j^j]j_‰uhJM@hKhh0]rw jp)rx }ry (h5jo h6jm h7h:h}rz (h@]r{ hB]r| hD]r} hF]r~ hH]r uhJM@hKhh0]r€ hYX return_valuer …r‚ }rƒ (h5Uh6jx ubaubaubjæ)r„ }r… (h5Uh6jb h7h:h}r† (h@]r‡ hB]rˆ hD]r‰ hF]rŠ hH]r‹ uhJM@hKhh0]rŒ (hu)r }rŽ (h5X=Set this to configure the value returned by calling the mock:r h6j„ h7h:h}r (h@]r‘ hB]r’ hD]r“ hF]r” hH]r• uhJM"hKhh0]r– hYX=Set this to configure the value returned by calling the mock:r— …r˜ }r™ (h5j h6j ubaubjz)rš }r› (h5XB>>> mock = Mock() >>> mock.return_value = 'fish' >>> mock() 'fish'rœ h6j„ h7h:h}r (U testnodetyperž XdoctestrŸ hehfhF]r  hD]r¡ h@]r¢ hB]r£ hH]r¤ Ugroupsr¥ ]r¦ hnaho}r§ uhJM$hKhh0]r¨ hYXB>>> mock = Mock() >>> mock.return_value = 'fish' >>> mock() 'fish'r© …rª }r« (h5Uh6jš ubaubhu)r¬ }r­ (h5XUThe default return value is a mock object and you can configure it in the normal way:r® h6j„ h7h:h}r¯ (h@]r° hB]r± hD]r² hF]r³ hH]r´ uhJM+hKhh0]rµ hYXUThe default return value is a mock object and you can configure it in the normal way:r¶ …r· }r¸ (h5j® h6j¬ ubaubjz)r¹ }rº (h5X©>>> mock = Mock() >>> mock.return_value.attribute = sentinel.Attribute >>> mock.return_value() >>> mock.return_value.assert_called_with()r» h6j„ h7h:h}r¼ (U testnodetyper½ Xdoctestr¾ hehfhF]r¿ hD]rÀ h@]rÁ hB]r hH]rà UgroupsrÄ ]rÅ hnaho}rÆ uhJM.hKhh0]rÇ hYX©>>> mock = Mock() >>> mock.return_value.attribute = sentinel.Attribute >>> mock.return_value() >>> mock.return_value.assert_called_with()rÈ …rÉ }rÊ (h5Uh6j¹ ubaubhu)rË }rÌ (h5X2`return_value` can also be set in the constructor:rÍ h6j„ h7h:h}rÎ (h@]rÏ hB]rÐ hD]rÑ hF]rÒ hH]rÓ uhJM6hKhh0]rÔ (h)rÕ }rÖ (h5X`return_value`r× h>}rØ (h@]rÙ hB]rÚ hD]rÛ hF]rÜ hH]rÝ uh6jË h0]rÞ hYX return_valuerß …rà }rá (h5Uh6jÕ ubah>> mock = Mock(return_value=3) >>> mock.return_value 3 >>> mock() 3rè h6j„ h7h:h}ré (U testnodetyperê Xdoctestrë hehfhF]rì hD]rí h@]rî hB]rï hH]rð Ugroupsrñ ]rò hnaho}ró uhJM8hKhh0]rô hYXD>>> mock = Mock(return_value=3) >>> mock.return_value 3 >>> mock() 3rõ …rö }r÷ (h5Uh6jæ ubaubeubeubjÃ)rø }rù (h5Uh6jçh7Nh}rú (hF]rû hD]rü h@]rý hB]rþ hH]rÿ Uentriesr]r(jÏXside_effect (Mock attribute)hUtrauhJNhKhh0]rubj?)r}r(h5Uh6jçh7Nh}r(jD‰jEXpyrhF]rhD]r h@]r hB]r hH]r jLX attributer jNj uhJNhKhh0]r(jP)r}r(h5X side_effectrh6jh7h:h}r(hF]rhajWhËhD]rh@]rhB]rhH]rhaj\XMock.side_effectrj^j]j_‰uhJM‹hKhh0]rjp)r}r(h5jh6jh7h:h}r(h@]rhB]rhD]rhF]r hH]r!uhJM‹hKhh0]r"hYX side_effectr#…r$}r%(h5Uh6jubaubaubjæ)r&}r'(h5Uh6jh7h:h}r((h@]r)hB]r*hD]r+hF]r,hH]r-uhJM‹hKhh0]r.(hu)r/}r0(h5XuThis can either be a function to be called when the mock is called, or an exception (class or instance) to be raised.r1h6j&h7h:h}r2(h@]r3hB]r4hD]r5hF]r6hH]r7uhJMChKhh0]r8hYXuThis can either be a function to be called when the mock is called, or an exception (class or instance) to be raised.r9…r:}r;(h5j1h6j/ubaubhu)r<}r=(h5XAIf you pass in a function it will be called with same arguments as the mock and unless the function returns the :data:`DEFAULT` singleton the call to the mock will then return whatever the function returns. If the function returns :data:`DEFAULT` then the mock will return its normal value (from the :attr:`return_value`.r>h6j&h7h:h}r?(h@]r@hB]rAhD]rBhF]rChH]rDuhJMFhKhh0]rE(hYXpIf you pass in a function it will be called with same arguments as the mock and unless the function returns the rF…rG}rH(h5XpIf you pass in a function it will be called with same arguments as the mock and unless the function returns the rIh6j<ubh´)rJ}rK(h5X:data:`DEFAULT`rLh6j<h7h:h}rM(UreftyperNXdatarOh¼‰h½XDEFAULTrPU refdomainrQXpyrRhF]rShD]rTU refexplicitrU‰h@]rVhB]rWhH]rXhÇhÈhÉj]hÊhËuhJMFh0]rYhÍ)rZ}r[(h5jLh>}r\(h@]r]hB]r^(hÓjRXpy-datar_ehD]r`hF]rahH]rbuh6jJh0]rchYXDEFAULTrd…re}rf(h5Uh6jZubah}rn(UreftyperoXdatarph¼‰h½XDEFAULTrqU refdomainrrXpyrshF]rthD]ruU refexplicitrv‰h@]rwhB]rxhH]ryhÇhÈhÉj]hÊhËuhJMFh0]rzhÍ)r{}r|(h5jmh>}r}(h@]r~hB]r(hÓjsXpy-datar€ehD]rhF]r‚hH]rƒuh6jkh0]r„hYXDEFAULTr……r†}r‡(h5Uh6j{ubah}r(UreftyperXattrr‘h¼‰h½X return_valuer’U refdomainr“Xpyr”hF]r•hD]r–U refexplicitr—‰h@]r˜hB]r™hH]ršhÇhÈhÉj]hÊhËuhJMFh0]r›hÍ)rœ}r(h5jŽh>}rž(h@]rŸhB]r (hÓj”Xpy-attrr¡ehD]r¢hF]r£hH]r¤uh6jŒh0]r¥hYX return_valuer¦…r§}r¨(h5Uh6jœubah}r®(h@]r¯hB]r°hD]r±hF]r²hH]r³uhJMLhKhh0]r´hYXUAn example of a mock that raises an exception (to test exception handling of an API):rµ…r¶}r·(h5j­h6j«ubaubjz)r¸}r¹(h5X€>>> mock = Mock() >>> mock.side_effect = Exception('Boom!') >>> mock() Traceback (most recent call last): ... Exception: Boom!rºh6j&h7h:h}r»(U testnodetyper¼Xdoctestr½hehfhF]r¾hD]r¿h@]rÀhB]rÁhH]rÂUgroupsrÃ]rÄhnaho}rÅuhJMOhKhh0]rÆhYX€>>> mock = Mock() >>> mock.side_effect = Exception('Boom!') >>> mock() Traceback (most recent call last): ... Exception: Boom!rÇ…rÈ}rÉ(h5Uh6j¸ubaubhu)rÊ}rË(h5X3Using `side_effect` to return a sequence of values:rÌh6j&h7h:h}rÍ(h@]rÎhB]rÏhD]rÐhF]rÑhH]rÒuhJMXhKhh0]rÓ(hYXUsing rÔ…rÕ}rÖ(h5XUsing r×h6jÊubh)rØ}rÙ(h5X `side_effect`rÚh>}rÛ(h@]rÜhB]rÝhD]rÞhF]rßhH]ràuh6jÊh0]ráhYX side_effectrâ…rã}rä(h5Uh6jØubah>> mock = Mock() >>> mock.side_effect = [3, 2, 1] >>> mock(), mock(), mock() (3, 2, 1)rëh6j&h7h:h}rì(U testnodetyperíXdoctestrîhehfhF]rïhD]rðh@]rñhB]ròhH]róUgroupsrô]rõhnaho}röuhJMZhKhh0]r÷hYXW>>> mock = Mock() >>> mock.side_effect = [3, 2, 1] >>> mock(), mock(), mock() (3, 2, 1)rø…rù}rú(h5Uh6jéubaubhu)rû}rü(h5X@The `side_effect` function is called with the same arguments as the mock (so it is wise for it to take arbitrary args and keyword arguments) and whatever it returns is used as the return value for the call. The exception is if `side_effect` returns :data:`DEFAULT`, in which case the normal :attr:`return_value` is used.rýh6j&h7h:h}rþ(h@]rÿhB]rhD]rhF]rhH]ruhJMahKhh0]r(hYXThe r…r}r(h5XThe rh6jûubh)r }r (h5X `side_effect`r h>}r (h@]r hB]rhD]rhF]rhH]ruh6jûh0]rhYX side_effectr…r}r(h5Uh6j ubah}r(h@]rhB]rhD]r hF]r!hH]r"uh6jûh0]r#hYX side_effectr$…r%}r&(h5Uh6jubah}r.(Ureftyper/Xdatar0h¼‰h½XDEFAULTr1U refdomainr2Xpyr3hF]r4hD]r5U refexplicitr6‰h@]r7hB]r8hH]r9hÇhÈhÉj]hÊhËuhJMah0]r:hÍ)r;}r<(h5j-h>}r=(h@]r>hB]r?(hÓj3Xpy-datar@ehD]rAhF]rBhH]rCuh6j+h0]rDhYXDEFAULTrE…rF}rG(h5Uh6j;ubah}rO(UreftyperPXattrrQh¼‰h½X return_valuerRU refdomainrSXpyrThF]rUhD]rVU refexplicitrW‰h@]rXhB]rYhH]rZhÇhÈhÉj]hÊhËuhJMah0]r[hÍ)r\}r](h5jNh>}r^(h@]r_hB]r`(hÓjTXpy-attrraehD]rbhF]rchH]rduh6jLh0]rehYX return_valuerf…rg}rh(h5Uh6j\ubah>> mock = Mock(return_value=3) >>> def side_effect(*args, **kwargs): ... return DEFAULT ... >>> mock.side_effect = side_effect >>> mock() 3roh6j&h7h:h}rp(U testnodetyperqXdoctestrrhehfhF]rshD]rth@]ruhB]rvhH]rwUgroupsrx]ryhnaho}rzuhJMghKhh0]r{hYX>>> mock = Mock(return_value=3) >>> def side_effect(*args, **kwargs): ... return DEFAULT ... >>> mock.side_effect = side_effect >>> mock() 3r|…r}}r~(h5Uh6jmubaubhu)r}r€(h5X`side_effect` can be set in the constructor. Here's an example that adds one to the value the mock is called with and returns it:rh6j&h7h:h}r‚(h@]rƒhB]r„hD]r…hF]r†hH]r‡uhJMqhKhh0]rˆ(h)r‰}rŠ(h5X `side_effect`r‹h>}rŒ(h@]rhB]rŽhD]rhF]rhH]r‘uh6jh0]r’hYX side_effectr“…r”}r•(h5Uh6j‰ubah>> side_effect = lambda value: value + 1 >>> mock = Mock(side_effect=side_effect) >>> mock(3) 4 >>> mock(-8) -7rœh6j&h7h:h}r(U testnodetyperžXdoctestrŸhehfhF]r hD]r¡h@]r¢hB]r£hH]r¤Ugroupsr¥]r¦hnaho}r§uhJMthKhh0]r¨hYXp>>> side_effect = lambda value: value + 1 >>> mock = Mock(side_effect=side_effect) >>> mock(3) 4 >>> mock(-8) -7r©…rª}r«(h5Uh6jšubaubhu)r¬}r­(h5X*Setting `side_effect` to `None` clears it:r®h6j&h7h:h}r¯(h@]r°hB]r±hD]r²hF]r³hH]r´uhJM}hKhh0]rµ(hYXSetting r¶…r·}r¸(h5XSetting r¹h6j¬ubh)rº}r»(h5X `side_effect`r¼h>}r½(h@]r¾hB]r¿hD]rÀhF]rÁhH]rÂuh6j¬h0]rÃhYX side_effectrÄ…rÅ}rÆ(h5Uh6jºubah}rÎ(h@]rÏhB]rÐhD]rÑhF]rÒhH]rÓuh6j¬h0]rÔhYXNonerÕ…rÖ}r×(h5Uh6jËubah>> from mock import Mock >>> m = Mock(side_effect=KeyError, return_value=3) >>> m() Traceback (most recent call last): ... KeyError >>> m.side_effect = None >>> m() 3rÞh6j&h7h:h}rß(U testnodetyperàXdoctestráhehfhF]râhD]rãh@]rähB]råhH]ræUgroupsrç]rèhnaho}réuhJMhKhh0]rêhYX¨>>> from mock import Mock >>> m = Mock(side_effect=KeyError, return_value=3) >>> m() Traceback (most recent call last): ... KeyError >>> m.side_effect = None >>> m() 3rë…rì}rí(h5Uh6jÜubaubeubeubjÃ)rî}rï(h5Uh6jçh7h:h}rð(hF]rñhD]ròh@]róhB]rôhH]rõUentriesrö]r÷(jÏXcall_args (Mock attribute)hUtrøauhJNhKhh0]rùubj?)rú}rû(h5Uh6jçh7h:h}rü(jD‰jEXpyrýhF]rþhD]rÿh@]rhB]rhH]rjLX attributerjNjuhJNhKhh0]r(jP)r}r(h5X call_argsrh6júh7h:h}r(hF]r hajWhËhD]r h@]r hB]r hH]r haj\XMock.call_argsrj^j]j_‰uhJM­hKhh0]rjp)r}r(h5jh6jh7h:h}r(h@]rhB]rhD]rhF]rhH]ruhJM­hKhh0]rhYX call_argsr…r}r(h5Uh6jubaubaubjæ)r}r(h5Uh6júh7h:h}r(h@]rhB]r hD]r!hF]r"hH]r#uhJM­hKhh0]r$(hu)r%}r&(h5X1This is either `None` (if the mock hasn't been called), or the arguments that the mock was last called with. This will be in the form of a tuple: the first member is any ordered arguments the mock was called with (or an empty tuple) and the second member is any keyword arguments (or an empty dictionary).r'h6jh7h:h}r((h@]r)hB]r*hD]r+hF]r,hH]r-uhJMŽhKhh0]r.(hYXThis is either r/…r0}r1(h5XThis is either r2h6j%ubh)r3}r4(h5X`None`r5h>}r6(h@]r7hB]r8hD]r9hF]r:hH]r;uh6j%h0]r<hYXNoner=…r>}r?(h5Uh6j3ubah>> mock = Mock(return_value=None) >>> print mock.call_args None >>> mock() >>> mock.call_args call() >>> mock.call_args == () True >>> mock(3, 4) >>> mock.call_args call(3, 4) >>> mock.call_args == ((3, 4),) True >>> mock(3, 4, 5, key='fish', next='w00t!') >>> mock.call_args call(3, 4, 5, key='fish', next='w00t!')rFh6jh7h:h}rG(U testnodetyperHXdoctestrIhehfhF]rJhD]rKh@]rLhB]rMhH]rNUgroupsrO]rPhnaho}rQuhJM”hKhh0]rRhYX<>>> mock = Mock(return_value=None) >>> print mock.call_args None >>> mock() >>> mock.call_args call() >>> mock.call_args == () True >>> mock(3, 4) >>> mock.call_args call(3, 4) >>> mock.call_args == ((3, 4),) True >>> mock(3, 4, 5, key='fish', next='w00t!') >>> mock.call_args call(3, 4, 5, key='fish', next='w00t!')rS…rT}rU(h5Uh6jDubaubhu)rV}rW(h5X'`call_args`, along with members of the lists :attr:`call_args_list`, :attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These are tuples, so they can be unpacked to get at the individual arguments and make more complex assertions. See :ref:`calls as tuples `.rXh6jh7h:h}rY(h@]rZhB]r[hD]r\hF]r]hH]r^uhJM§hKhh0]r_(h)r`}ra(h5X `call_args`rbh>}rc(h@]rdhB]rehD]rfhF]rghH]rhuh6jVh0]rihYX call_argsrj…rk}rl(h5Uh6j`ubah}rt(UreftyperuXattrrvh¼‰h½Xcall_args_listrwU refdomainrxXpyryhF]rzhD]r{U refexplicitr|‰h@]r}hB]r~hH]rhÇhÈhÉj]hÊhËuhJM§h0]r€hÍ)r}r‚(h5jsh>}rƒ(h@]r„hB]r…(hÓjyXpy-attrr†ehD]r‡hF]rˆhH]r‰uh6jqh0]rŠhYXcall_args_listr‹…rŒ}r(h5Uh6jubah}r•(Ureftyper–Xattrr—h¼‰h½X method_callsr˜U refdomainr™XpyršhF]r›hD]rœU refexplicitr‰h@]ržhB]rŸhH]r hÇhÈhÉj]hÊhËuhJM§h0]r¡hÍ)r¢}r£(h5j”h>}r¤(h@]r¥hB]r¦(hÓjšXpy-attrr§ehD]r¨hF]r©hH]rªuh6j’h0]r«hYX method_callsr¬…r­}r®(h5Uh6j¢ubah}r¶(Ureftyper·Xattrr¸h¼‰h½X mock_callsr¹U refdomainrºXpyr»hF]r¼hD]r½U refexplicitr¾‰h@]r¿hB]rÀhH]rÁhÇhÈhÉj]hÊhËuhJM§h0]rÂhÍ)rÃ}rÄ(h5jµh>}rÅ(h@]rÆhB]rÇ(hÓj»Xpy-attrrÈehD]rÉhF]rÊhH]rËuh6j³h0]rÌhYX mock_callsrÍ…rÎ}rÏ(h5Uh6jÃubah}r×(UreftyperØXdatarÙh¼‰h½XcallrÚU refdomainrÛXpyrÜhF]rÝhD]rÞU refexplicitr߉h@]ràhB]ráhH]râhÇhÈhÉj]hÊhËuhJM§h0]rãhÍ)rä}rå(h5jÖh>}ræ(h@]rçhB]rè(hÓjÜXpy-dataréehD]rêhF]rëhH]rìuh6jÔh0]ríhYXcallrî…rï}rð(h5Uh6jäubah`r÷h6jVh7h:h}rø(UreftyperùXrefrúh¼ˆh½Xcalls-as-tuplesrûU refdomainrüXstdrýhF]rþhD]rÿU refexplicitrˆh@]rhB]rhH]rhÇhÈuhJM§h0]rjê)r}r(h5j÷h>}r(h@]rhB]r (hÓjýXstd-refr ehD]r hF]r hH]r uh6jõh0]rhYXcalls as tuplesr…r}r(h5Uh6jubah}r(hF]rhD]rh@]rhB]rhH]rUentriesr]r(jÏXcall_args_list (Mock attribute)hUtrauhJNhKhh0]rubj?)r }r!(h5Uh6jçh7h:h}r"(jD‰jEXpyr#hF]r$hD]r%h@]r&hB]r'hH]r(jLX attributer)jNj)uhJNhKhh0]r*(jP)r+}r,(h5Xcall_args_listr-h6j h7h:h}r.(hF]r/hajWhËhD]r0h@]r1hB]r2hH]r3haj\XMock.call_args_listr4j^j]j_‰uhJMÆhKhh0]r5jp)r6}r7(h5j-h6j+h7h:h}r8(h@]r9hB]r:hD]r;hF]r<hH]r=uhJMÆhKhh0]r>hYXcall_args_listr?…r@}rA(h5Uh6j6ubaubaubjæ)rB}rC(h5Uh6j h7h:h}rD(h@]rEhB]rFhD]rGhF]rHhH]rIuhJMÆhKhh0]rJ(hu)rK}rL(h5X2This is a list of all the calls made to the mock object in sequence (so the length of the list is the number of times it has been called). Before any calls have been made it is an empty list. The :data:`call` object can be used for conveniently constructing lists of calls to compare with `call_args_list`.rMh6jBh7h:h}rN(h@]rOhB]rPhD]rQhF]rRhH]rSuhJM°hKhh0]rT(hYXÄThis is a list of all the calls made to the mock object in sequence (so the length of the list is the number of times it has been called). Before any calls have been made it is an empty list. The rU…rV}rW(h5XÄThis is a list of all the calls made to the mock object in sequence (so the length of the list is the number of times it has been called). Before any calls have been made it is an empty list. The rXh6jKubh´)rY}rZ(h5X :data:`call`r[h6jKh7h:h}r\(Ureftyper]Xdatar^h¼‰h½Xcallr_U refdomainr`XpyrahF]rbhD]rcU refexplicitrd‰h@]rehB]rfhH]rghÇhÈhÉj]hÊhËuhJM°h0]rhhÍ)ri}rj(h5j[h>}rk(h@]rlhB]rm(hÓjaXpy-datarnehD]rohF]rphH]rquh6jYh0]rrhYXcallrs…rt}ru(h5Uh6jiubah}r}(h@]r~hB]rhD]r€hF]rhH]r‚uh6jKh0]rƒhYXcall_args_listr„…r…}r†(h5Uh6jzubah>> mock = Mock(return_value=None) >>> mock() >>> mock(3, 4) >>> mock(key='fish', next='w00t!') >>> mock.call_args_list [call(), call(3, 4), call(key='fish', next='w00t!')] >>> expected = [(), ((3, 4),), ({'key': 'fish', 'next': 'w00t!'},)] >>> mock.call_args_list == expected Truer‹h6jBh7h:h}rŒ(U testnodetyperXdoctestrŽhehfhF]rhD]rh@]r‘hB]r’hH]r“Ugroupsr”]r•hnaho}r–uhJM¶hKhh0]r—hYX>>> mock = Mock(return_value=None) >>> mock() >>> mock(3, 4) >>> mock(key='fish', next='w00t!') >>> mock.call_args_list [call(), call(3, 4), call(key='fish', next='w00t!')] >>> expected = [(), ((3, 4),), ({'key': 'fish', 'next': 'w00t!'},)] >>> mock.call_args_list == expected Truer˜…r™}rš(h5Uh6j‰ubaubhu)r›}rœ(h5X§Members of `call_args_list` are :data:`call` objects. These can be unpacked as tuples to get at the individual arguments. See :ref:`calls as tuples `.rh6jBh7h:h}rž(h@]rŸhB]r hD]r¡hF]r¢hH]r£uhJMÂhKhh0]r¤(hYX Members of r¥…r¦}r§(h5X Members of r¨h6j›ubh)r©}rª(h5X`call_args_list`r«h>}r¬(h@]r­hB]r®hD]r¯hF]r°hH]r±uh6j›h0]r²hYXcall_args_listr³…r´}rµ(h5Uh6j©ubah}r½(Ureftyper¾Xdatar¿h¼‰h½XcallrÀU refdomainrÁXpyrÂhF]rÃhD]rÄU refexplicitrʼnh@]rÆhB]rÇhH]rÈhÇhÈhÉj]hÊhËuhJMÂh0]rÉhÍ)rÊ}rË(h5j¼h>}rÌ(h@]rÍhB]rÎ(hÓjÂXpy-datarÏehD]rÐhF]rÑhH]rÒuh6jºh0]rÓhYXcallrÔ…rÕ}rÖ(h5Uh6jÊubah`rÝh6j›h7h:h}rÞ(UreftyperßXrefràh¼ˆh½Xcalls-as-tuplesráU refdomainrâXstdrãhF]rähD]råU refexplicitræˆh@]rçhB]rèhH]réhÇhÈuhJMÂh0]rêjê)rë}rì(h5jÝh>}rí(h@]rîhB]rï(hÓjãXstd-refrðehD]rñhF]ròhH]róuh6jÛh0]rôhYXcalls as tuplesrõ…rö}r÷(h5Uh6jëubah}rü(hF]rýhD]rþh@]rÿhB]rhH]rUentriesr]r(jÏXmethod_calls (Mock attribute)h UtrauhJNhKhh0]rubj?)r}r(h5Uh6jçh7h:h}r(jD‰jEXpyr hF]r hD]r h@]r hB]r hH]rjLX attributerjNjuhJNhKhh0]r(jP)r}r(h5X method_callsrh6jh7h:h}r(hF]rh ajWhËhD]rh@]rhB]rhH]rh aj\XMock.method_callsrj^j]j_‰uhJMÚhKhh0]rjp)r}r(h5jh6jh7h:h}r(h@]rhB]r hD]r!hF]r"hH]r#uhJMÚhKhh0]r$hYX method_callsr%…r&}r'(h5Uh6jubaubaubjæ)r(}r)(h5Uh6jh7h:h}r*(h@]r+hB]r,hD]r-hF]r.hH]r/uhJMÚhKhh0]r0(hu)r1}r2(h5X~As well as tracking calls to themselves, mocks also track calls to methods and attributes, and *their* methods and attributes:r3h6j(h7h:h}r4(h@]r5hB]r6hD]r7hF]r8hH]r9uhJMÉhKhh0]r:(hYX_As well as tracking calls to themselves, mocks also track calls to methods and attributes, and r;…r<}r=(h5X_As well as tracking calls to themselves, mocks also track calls to methods and attributes, and r>h6j1ubjê)r?}r@(h5X*their*rAh>}rB(h@]rChB]rDhD]rEhF]rFhH]rGuh6j1h0]rHhYXtheirrI…rJ}rK(h5Uh6j?ubah>> mock = Mock() >>> mock.method() >>> mock.property.method.attribute() >>> mock.method_calls [call.method(), call.property.method.attribute()]rRh6j(h7h:h}rS(U testnodetyperTXdoctestrUhehfhF]rVhD]rWh@]rXhB]rYhH]rZUgroupsr[]r\hnaho}r]uhJMÌhKhh0]r^hYXí>>> mock = Mock() >>> mock.method() >>> mock.property.method.attribute() >>> mock.method_calls [call.method(), call.property.method.attribute()]r_…r`}ra(h5Uh6jPubaubhu)rb}rc(h5X¥Members of `method_calls` are :data:`call` objects. These can be unpacked as tuples to get at the individual arguments. See :ref:`calls as tuples `.rdh6j(h7h:h}re(h@]rfhB]rghD]rhhF]rihH]rjuhJMÖhKhh0]rk(hYX Members of rl…rm}rn(h5X Members of roh6jbubh)rp}rq(h5X`method_calls`rrh>}rs(h@]rthB]ruhD]rvhF]rwhH]rxuh6jbh0]ryhYX method_callsrz…r{}r|(h5Uh6jpubah}r„(Ureftyper…Xdatar†h¼‰h½Xcallr‡U refdomainrˆXpyr‰hF]rŠhD]r‹U refexplicitrŒ‰h@]rhB]rŽhH]rhÇhÈhÉj]hÊhËuhJMÖh0]rhÍ)r‘}r’(h5jƒh>}r“(h@]r”hB]r•(hÓj‰Xpy-datar–ehD]r—hF]r˜hH]r™uh6jh0]ršhYXcallr›…rœ}r(h5Uh6j‘ubah`r¤h6jbh7h:h}r¥(Ureftyper¦Xrefr§h¼ˆh½Xcalls-as-tuplesr¨U refdomainr©XstdrªhF]r«hD]r¬U refexplicitr­ˆh@]r®hB]r¯hH]r°hÇhÈuhJMÖh0]r±jê)r²}r³(h5j¤h>}r´(h@]rµhB]r¶(hÓjªXstd-refr·ehD]r¸hF]r¹hH]rºuh6j¢h0]r»hYXcalls as tuplesr¼…r½}r¾(h5Uh6j²ubah}rÃ(hF]rÄhD]rÅh@]rÆhB]rÇhH]rÈUentriesrÉ]rÊ(jÏXmock_calls (Mock attribute)hUtrËauhJNhKhh0]rÌubj?)rÍ}rÎ(h5Uh6jçh7h:h}rÏ(jD‰jEXpyrÐhF]rÑhD]rÒh@]rÓhB]rÔhH]rÕjLX attributerÖjNjÖuhJNhKhh0]r×(jP)rØ}rÙ(h5X mock_callsrÚh6jÍh7h:h}rÛ(hF]rÜhajWhËhD]rÝh@]rÞhB]rßhH]ràhaj\XMock.mock_callsráj^j]j_‰uhJMõhKhh0]râjp)rã}rä(h5jÚh6jØh7h:h}rå(h@]ræhB]rçhD]rèhF]réhH]rêuhJMõhKhh0]rëhYX mock_callsrì…rí}rî(h5Uh6jãubaubaubjæ)rï}rð(h5Uh6jÍh7h:h}rñ(h@]ròhB]róhD]rôhF]rõhH]röuhJMõhKhh0]r÷(hu)rø}rù(h5Xi`mock_calls` records *all* calls to the mock object, its methods, magic methods *and* return value mocks.rúh6jïh7h:h}rû(h@]rühB]rýhD]rþhF]rÿhH]ruhJMÝhKhh0]r(h)r}r(h5X `mock_calls`rh>}r(h@]rhB]rhD]rhF]r hH]r uh6jøh0]r hYX mock_callsr …r }r(h5Uh6jubah}r(h@]rhB]rhD]rhF]rhH]ruh6jøh0]rhYXallr…r}r(h5Uh6jubah}r'(h@]r(hB]r)hD]r*hF]r+hH]r,uh6jøh0]r-hYXandr.…r/}r0(h5Uh6j$ubah>> mock = MagicMock() >>> result = mock(1, 2, 3) >>> mock.first(a=3) >>> mock.second() >>> int(mock) 1 >>> result(1) >>> expected = [call(1, 2, 3), call.first(a=3), call.second(), ... call.__int__(), call()(1)] >>> mock.mock_calls == expected Truer7h6jïh7h:h}r8(U testnodetyper9Xdoctestr:hehfhF]r;hD]r<h@]r=hB]r>hH]r?Ugroupsr@]rAhnaho}rBuhJMàhKhh0]rChYXp>>> mock = MagicMock() >>> result = mock(1, 2, 3) >>> mock.first(a=3) >>> mock.second() >>> int(mock) 1 >>> result(1) >>> expected = [call(1, 2, 3), call.first(a=3), call.second(), ... call.__int__(), call()(1)] >>> mock.mock_calls == expected TruerD…rE}rF(h5Uh6j5ubaubhu)rG}rH(h5X£Members of `mock_calls` are :data:`call` objects. These can be unpacked as tuples to get at the individual arguments. See :ref:`calls as tuples `.rIh6jïh7h:h}rJ(h@]rKhB]rLhD]rMhF]rNhH]rOuhJMñhKhh0]rP(hYX Members of rQ…rR}rS(h5X Members of rTh6jGubh)rU}rV(h5X `mock_calls`rWh>}rX(h@]rYhB]rZhD]r[hF]r\hH]r]uh6jGh0]r^hYX mock_callsr_…r`}ra(h5Uh6jUubah}ri(UreftyperjXdatarkh¼‰h½XcallrlU refdomainrmXpyrnhF]rohD]rpU refexplicitrq‰h@]rrhB]rshH]rthÇhÈhÉj]hÊhËuhJMñh0]ruhÍ)rv}rw(h5jhh>}rx(h@]ryhB]rz(hÓjnXpy-datar{ehD]r|hF]r}hH]r~uh6jfh0]rhYXcallr€…r}r‚(h5Uh6jvubah`r‰h6jGh7h:h}rŠ(Ureftyper‹XrefrŒh¼ˆh½Xcalls-as-tuplesrU refdomainrŽXstdrhF]rhD]r‘U refexplicitr’ˆh@]r“hB]r”hH]r•hÇhÈuhJMñh0]r–jê)r—}r˜(h5j‰h>}r™(h@]ršhB]r›(hÓjXstd-refrœehD]rhF]ržhH]rŸuh6j‡h0]r hYXcalls as tuplesr¡…r¢}r£(h5Uh6j—ubah}r¨(hF]r©hD]rªh@]r«hB]r¬hH]r­Uentriesr®]r¯(jÏX__class__ (Mock attribute)h Utr°auhJNhKhh0]r±ubj?)r²}r³(h5Uh6jçh7Nh}r´(jD‰jEXpyrµhF]r¶hD]r·h@]r¸hB]r¹hH]rºjLX attributer»jNj»uhJNhKhh0]r¼(jP)r½}r¾(h5X __class__r¿h6j²h7h:h}rÀ(hF]rÁh ajWhËhD]rÂh@]rÃhB]rÄhH]rÅh aj\XMock.__class__rÆj^j]j_‰uhJM hKhh0]rÇjp)rÈ}rÉ(h5j¿h6j½h7h:h}rÊ(h@]rËhB]rÌhD]rÍhF]rÎhH]rÏuhJM hKhh0]rÐhYX __class__rÑ…rÒ}rÓ(h5Uh6jÈubaubaubjæ)rÔ}rÕ(h5Uh6j²h7h:h}rÖ(h@]r×hB]rØhD]rÙhF]rÚhH]rÛuhJM hKhh0]rÜ(hu)rÝ}rÞ(h5XúNormally the `__class__` attribute of an object will return its type. For a mock object with a `spec` `__class__` returns the spec class instead. This allows mock objects to pass `isinstance` tests for the object they are replacing / masquerading as:rßh6jÔh7h:h}rà(h@]ráhB]râhD]rãhF]rähH]råuhJMøhKhh0]ræ(hYX Normally the rç…rè}ré(h5X Normally the rêh6jÝubh)rë}rì(h5X `__class__`ríh>}rî(h@]rïhB]rðhD]rñhF]ròhH]róuh6jÝh0]rôhYX __class__rõ…rö}r÷(h5Uh6jëubah}rÿ(h@]rhB]rhD]rhF]rhH]ruh6jÝh0]rhYXspecr…r}r(h5Uh6jüubah}r(h@]rhB]rhD]rhF]rhH]ruh6jÝh0]rhYX __class__r…r}r(h5Uh6j ubah}r(h@]r hB]r!hD]r"hF]r#hH]r$uh6jÝh0]r%hYX isinstancer&…r'}r((h5Uh6jubah>> mock = Mock(spec=3) >>> isinstance(mock, int) Truer/h6jÔh7h:h}r0(U testnodetyper1Xdoctestr2hehfhF]r3hD]r4h@]r5hB]r6hH]r7Ugroupsr8]r9hnaho}r:uhJMýhKhh0]r;hYX6>>> mock = Mock(spec=3) >>> isinstance(mock, int) Truer<…r=}r>(h5Uh6j-ubaubhu)r?}r@(h5Xq`__class__` is assignable to, this allows a mock to pass an `isinstance` check without forcing you to use a spec:rAh6jÔh7h:h}rB(h@]rChB]rDhD]rEhF]rFhH]rGuhJMhKhh0]rH(h)rI}rJ(h5X `__class__`rKh>}rL(h@]rMhB]rNhD]rOhF]rPhH]rQuh6j?h0]rRhYX __class__rS…rT}rU(h5Uh6jIubah}r](h@]r^hB]r_hD]r`hF]rahH]rbuh6j?h0]rchYX isinstancerd…re}rf(h5Uh6jZubah>> mock = Mock() >>> mock.__class__ = dict >>> isinstance(mock, dict) Truermh6jÔh7h:h}rn(U testnodetyperoXdoctestrphehfhF]rqhD]rrh@]rshB]rthH]ruUgroupsrv]rwhnaho}rxuhJMhKhh0]ryhYXK>>> mock = Mock() >>> mock.__class__ = dict >>> isinstance(mock, dict) Truerz…r{}r|(h5Uh6jkubaubeubeubeubeubjÃ)r}}r~(h5Uh6h3h7h:h}r(hF]r€hD]rh@]r‚hB]rƒhH]r„Uentriesr…]r†(jÏXNonCallableMock (class in mock)hUtr‡auhJNhKhh0]rˆubj?)r‰}rŠ(h5Uh6h3h7h:h}r‹(jD‰jEXpyrŒhF]rhD]rŽh@]rhB]rhH]r‘jLXclassr’jNj’uhJNhKhh0]r“(jP)r”}r•(h5XJNonCallableMock(spec=None, wraps=None, name=None, spec_set=None, **kwargs)r–h6j‰h7h:h}r—(hF]r˜hajWhËhD]r™h@]ršhB]r›hH]rœhaj\XNonCallableMockrj^Uj_‰uhJMhKhh0]rž(ja)rŸ}r (h5Xclass r¡h6j”h7h:h}r¢(h@]r£hB]r¤hD]r¥hF]r¦hH]r§uhJMhKhh0]r¨hYXclass r©…rª}r«(h5Uh6jŸubaubjp)r¬}r­(h5jh6j”h7h:h}r®(h@]r¯hB]r°hD]r±hF]r²hH]r³uhJMhKhh0]r´hYXNonCallableMockrµ…r¶}r·(h5Uh6j¬ubaubj~)r¸}r¹(h5Uh6j”h7h:h}rº(h@]r»hB]r¼hD]r½hF]r¾hH]r¿uhJMhKhh0]rÀ(j‰)rÁ}rÂ(h5X spec=NonerÃh>}rÄ(h@]rÅhB]rÆhD]rÇhF]rÈhH]rÉuh6j¸h0]rÊhYX spec=NonerË…rÌ}rÍ(h5Uh6jÁubah}rÑ(h@]rÒhB]rÓhD]rÔhF]rÕhH]rÖuh6j¸h0]r×hYX wraps=NonerØ…rÙ}rÚ(h5Uh6jÎubah}rÞ(h@]rßhB]ràhD]ráhF]râhH]rãuh6j¸h0]rähYX name=Nonerå…ræ}rç(h5Uh6jÛubah}rë(h@]rìhB]ríhD]rîhF]rïhH]rðuh6j¸h0]rñhYX spec_set=Nonerò…ró}rô(h5Uh6jèubah}rø(h@]rùhB]rúhD]rûhF]rühH]rýuh6j¸h0]rþhYX**kwargsrÿ…r}r(h5Uh6jõubah}r(h@]rhB]rhD]rhF]rhH]r uhJMhKhh0]r hu)r }r (h5XÂA non-callable version of `Mock`. The constructor parameters have the same meaning of `Mock`, with the exception of `return_value` and `side_effect` which have no meaning on a non-callable mock.r h6jh7h:h}r(h@]rhB]rhD]rhF]rhH]ruhJMhKhh0]r(hYXA non-callable version of r…r}r(h5XA non-callable version of rh6j ubh)r}r(h5X`Mock`rh>}r(h@]rhB]rhD]rhF]r hH]r!uh6j h0]r"hYXMockr#…r$}r%(h5Uh6jubah}r-(h@]r.hB]r/hD]r0hF]r1hH]r2uh6j h0]r3hYXMockr4…r5}r6(h5Uh6j*ubah}r>(h@]r?hB]r@hD]rAhF]rBhH]rCuh6j h0]rDhYX return_valuerE…rF}rG(h5Uh6j;ubah}rO(h@]rPhB]rQhD]rRhF]rShH]rTuh6j h0]rUhYX side_effectrV…rW}rX(h5Uh6jLubah}r`(h@]rahB]rbhD]rchF]rdhH]reuhJMhKhh0]rf(hYX2Mock objects that use a class or an instance as a rg…rh}ri(h5X2Mock objects that use a class or an instance as a rjh6j]ubh)rk}rl(h5X`spec`rmh>}rn(h@]rohB]rphD]rqhF]rrhH]rsuh6j]h0]rthYXspecru…rv}rw(h5Uh6jkubah}r(h@]r€hB]rhD]r‚hF]rƒhH]r„uh6j]h0]r…hYXspec_setr†…r‡}rˆ(h5Uh6j|ubah}r(h@]r‘hB]r’hD]r“hF]r”hH]r•uh6j]h0]r–hYX isintancer—…r˜}r™(h5Uh6jubah>> mock = Mock(spec=SomeClass) >>> isinstance(mock, SomeClass) True >>> mock = Mock(spec_set=SomeClass()) >>> isinstance(mock, SomeClass) Truer h6h3h7h:h}r¡(U testnodetyper¢Xdoctestr£hehfhF]r¤hD]r¥h@]r¦hB]r§hH]r¨Ugroupsr©]rªhnaho}r«uhJMhKhh0]r¬hYX>>> mock = Mock(spec=SomeClass) >>> isinstance(mock, SomeClass) True >>> mock = Mock(spec_set=SomeClass()) >>> isinstance(mock, SomeClass) Truer­…r®}r¯(h5Uh6jžubaubhu)r°}r±(h5XyThe `Mock` classes have support for mocking magic methods. See :ref:`magic methods ` for the full details.r²h6h3h7h:h}r³(h@]r´hB]rµhD]r¶hF]r·hH]r¸uhJMhKhh0]r¹(hYXThe rº…r»}r¼(h5XThe r½h6j°ubh)r¾}r¿(h5X`Mock`rÀh>}rÁ(h@]rÂhB]rÃhD]rÄhF]rÅhH]rÆuh6j°h0]rÇhYXMockrÈ…rÉ}rÊ(h5Uh6j¾ubah`rÑh6j°h7h:h}rÒ(UreftyperÓXrefrÔh¼ˆh½X magic-methodsrÕU refdomainrÖXstdr×hF]rØhD]rÙU refexplicitrÚˆh@]rÛhB]rÜhH]rÝhÇhÈuhJMh0]rÞjê)rß}rà(h5jÑh>}rá(h@]râhB]rã(hÓj×Xstd-refräehD]råhF]ræhH]rçuh6jÏh0]rèhYX magic methodsré…rê}rë(h5Uh6jßubah}ró(h@]rôhB]rõhD]röhF]r÷hH]røuhJM"hKhh0]rù(hYXThe mock classes and the rú…rû}rü(h5XThe mock classes and the rýh6jðubh´)rþ}rÿ(h5X :func:`patch`rh6jðh7h:h}r(UreftyperXfuncrh¼‰h½XpatchrU refdomainrXpyrhF]rhD]rU refexplicitr ‰h@]r hB]r hH]r hÇhÈhÉNhÊhËuhJM"h0]r hÍ)r}r(h5jh>}r(h@]rhB]r(hÓjXpy-funcrehD]rhF]rhH]ruh6jþh0]rhYXpatch()r…r}r(h5Uh6jubah}r"(h@]r#hB]r$hD]r%hF]r&hH]r'uh6jðh0]r(hYXpatchr)…r*}r+(h5Uh6jubah>> m = MagicMock(attribute=3, other='fish') >>> m.attribute 3 >>> m.other 'fish'r2h6h3h7h:h}r3(U testnodetyper4Xdoctestr5hehfhF]r6hD]r7h@]r8hB]r9hH]r:Ugroupsr;]r<hnaho}r=uhJM'hKhh0]r>hYXQ>>> m = MagicMock(attribute=3, other='fish') >>> m.attribute 3 >>> m.other 'fish'r?…r@}rA(h5Uh6j0ubaubhu)rB}rC(h5XÍThe return value and side effect of child mocks can be set in the same way, using dotted notation. As you can't use dotted names directly in a call you have to create a dictionary and unpack it using `**`:rDh6h3h7h:h}rE(h@]rFhB]rGhD]rHhF]rIhH]rJuhJM/hKhh0]rK(hYXÈThe return value and side effect of child mocks can be set in the same way, using dotted notation. As you can't use dotted names directly in a call you have to create a dictionary and unpack it using rL…rM}rN(h5XÈThe return value and side effect of child mocks can be set in the same way, using dotted notation. As you can't use dotted names directly in a call you have to create a dictionary and unpack it using rOh6jBubh)rP}rQ(h5X`**`rRh>}rS(h@]rThB]rUhD]rVhF]rWhH]rXuh6jBh0]rYhYX**rZ…r[}r\(h5Uh6jPubah>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock = Mock(some_attribute='eggs', **attrs) >>> mock.some_attribute 'eggs' >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyErrorrah6h3h7h:h}rb(U testnodetypercXdoctestrdhehfhF]rehD]rfh@]rghB]rhhH]riUgroupsrj]rkhnaho}rluhJM3hKhh0]rmhYXë>>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock = Mock(some_attribute='eggs', **attrs) >>> mock.some_attribute 'eggs' >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyErrorrn…ro}rp(h5Uh6j_ubaubjÃ)rq}rr(h5Uh6h3h7Nh}rs(hF]rthD]ruh@]rvhB]rwhH]rxUentriesry]rz(jÏXPropertyMock (class in mock)hUtr{auhJNhKhh0]r|ubj?)r}}r~(h5Uh6h3h7Nh}r(jD‰jEXpyr€hF]rhD]r‚h@]rƒhB]r„hH]r…jLXclassr†jNj†uhJNhKhh0]r‡(jP)rˆ}r‰(h5XPropertyMock(*args, **kwargs)rŠh6j}h7h:h}r‹(hF]rŒhajWhËhD]rh@]rŽhB]rhH]rhaj\X PropertyMockr‘j^Uj_‰uhJM]hKhh0]r’(ja)r“}r”(h5Xclass r•h6jˆh7h:h}r–(h@]r—hB]r˜hD]r™hF]ršhH]r›uhJM]hKhh0]rœhYXclass r…rž}rŸ(h5Uh6j“ubaubjp)r }r¡(h5j‘h6jˆh7h:h}r¢(h@]r£hB]r¤hD]r¥hF]r¦hH]r§uhJM]hKhh0]r¨hYX PropertyMockr©…rª}r«(h5Uh6j ubaubj~)r¬}r­(h5Uh6jˆh7h:h}r®(h@]r¯hB]r°hD]r±hF]r²hH]r³uhJM]hKhh0]r´(j‰)rµ}r¶(h5X*argsr·h>}r¸(h@]r¹hB]rºhD]r»hF]r¼hH]r½uh6j¬h0]r¾hYX*argsr¿…rÀ}rÁ(h5Uh6jµubah}rÅ(h@]rÆhB]rÇhD]rÈhF]rÉhH]rÊuh6j¬h0]rËhYX**kwargsrÌ…rÍ}rÎ(h5Uh6jÂubah}rÑ(h@]rÒhB]rÓhD]rÔhF]rÕhH]rÖuhJM]hKhh0]r×(hu)rØ}rÙ(h5X¸A mock intended to be used as a property, or other descriptor, on a class. `PropertyMock` provides `__get__` and `__set__` methods so you can specify a return value when it is fetched.rÚh6jÏh7h:h}rÛ(h@]rÜhB]rÝhD]rÞhF]rßhH]ràuhJMChKhh0]rá(hYXKA mock intended to be used as a property, or other descriptor, on a class. râ…rã}rä(h5XKA mock intended to be used as a property, or other descriptor, on a class. råh6jØubh)ræ}rç(h5X`PropertyMock`rèh>}ré(h@]rêhB]rëhD]rìhF]ríhH]rîuh6jØh0]rïhYX PropertyMockrð…rñ}rò(h5Uh6jæubah}rú(h@]rûhB]rühD]rýhF]rþhH]rÿuh6jØh0]rhYX__get__r…r}r(h5Uh6j÷ubah}r (h@]r hB]r hD]rhF]rhH]ruh6jØh0]rhYX__set__r…r}r(h5Uh6jubah methods so you can specify a return value when it is fetched.r…r}r(h5X> methods so you can specify a return value when it is fetched.rh6jØubeubhu)r}r(h5XƒFetching a `PropertyMock` instance from an object calls the mock, with no args. Setting it calls the mock with the value being set.rh6jÏh7h:h}r(h@]rhB]rhD]rhF]r hH]r!uhJMGhKhh0]r"(hYX Fetching a r#…r$}r%(h5X Fetching a r&h6jubh)r'}r((h5X`PropertyMock`r)h>}r*(h@]r+hB]r,hD]r-hF]r.hH]r/uh6jh0]r0hYX PropertyMockr1…r2}r3(h5Uh6j'ubah>> class Foo(object): ... @property ... def foo(self): ... return 'something' ... @foo.setter ... def foo(self, value): ... pass ... >>> with patch('__main__.Foo.foo', new_callable=PropertyMock) as mock_foo: ... mock_foo.return_value = 'mockity-mock' ... this_foo = Foo() ... print this_foo.foo ... this_foo.foo = 6 ... mockity-mock >>> mock_foo.mock_calls [call(), call(6)]r:h6jÏh7h:h}r;(U testnodetyper<Xdoctestr=hehfhF]r>hD]r?h@]r@hB]rAhH]rBUgroupsrC]rDhnaho}rEuhJMJhKhh0]rFhYX§>>> class Foo(object): ... @property ... def foo(self): ... return 'something' ... @foo.setter ... def foo(self, value): ... pass ... >>> with patch('__main__.Foo.foo', new_callable=PropertyMock) as mock_foo: ... mock_foo.return_value = 'mockity-mock' ... this_foo = Foo() ... print this_foo.foo ... this_foo.foo = 6 ... mockity-mock >>> mock_foo.mock_calls [call(), call(6)]rG…rH}rI(h5Uh6j8ubaubeubeubhu)rJ}rK(h5XBecause of the way mock attributes are stored you can't directly attach a `PropertyMock` to a mock object. Instead you can attach it to the mock type object:rLh6h3h7h:h}rM(h@]rNhB]rOhD]rPhF]rQhH]rRuhJM^hKhh0]rS(hYXJBecause of the way mock attributes are stored you can't directly attach a rT…rU}rV(h5XJBecause of the way mock attributes are stored you can't directly attach a rWh6jJubh)rX}rY(h5X`PropertyMock`rZh>}r[(h@]r\hB]r]hD]r^hF]r_hH]r`uh6jJh0]rahYX PropertyMockrb…rc}rd(h5Uh6jXubah>> m = MagicMock() >>> p = PropertyMock(return_value=3) >>> type(m).foo = p >>> m.foo 3 >>> p.assert_called_once_with()rkh6h3h7h:h}rl(U testnodetypermXdoctestrnhehfhF]rohD]rph@]rqhB]rrhH]rsUgroupsrt]ruhnaho}rvuhJMbhKhh0]rwhYXx>>> m = MagicMock() >>> p = PropertyMock(return_value=3) >>> type(m).foo = p >>> m.foo 3 >>> p.assert_called_once_with()rx…ry}rz(h5Uh6jiubaubjÃ)r{}r|(h5Uh6h3h7h:h}r}(hF]r~hD]rh@]r€hB]rhH]r‚jÍ]rƒ(jÏX__call__Uindex-5r„Utr…ajÒ‰uhJMlhKhh0]r†ubjÔ)r‡}rˆ(h5Uh6h3h7h:h}r‰(h@]rŠhB]r‹hD]rŒhF]rj„ahH]rŽuhJMlhKhh0]rubjÃ)r}r‘(h5Uh6h3h7h:h}r’(hF]r“hD]r”h@]r•hB]r–hH]r—jÍ]r˜(jÏXcallingUindex-6r™UtršajÒ‰uhJMnhKhh0]r›ubjÔ)rœ}r(h5Uh6h3h7h:h}rž(hF]rŸhD]r h@]r¡hB]r¢hH]r£h¢j™uhJMnhKhh0]r¤ubeubh2)r¥}r¦(h5Uh6hh7h:Uexpect_referenced_by_namer§}r¨h}r©(h@]rªhB]r«hD]r¬hF]r­(h.j™ehH]r®hauhJMphKhUexpect_referenced_by_idr¯}r°j™jœsh0]r±(hM)r²}r³(h5XCallingr´h6j¥h7h:h}rµ(h@]r¶hB]r·hD]r¸hF]r¹hH]rºuhJMphKhh0]r»hYXCallingr¼…r½}r¾(h5j´h6j²ubaubhu)r¿}rÀ(h5X6Mock objects are callable. The call will return the value set as the :attr:`~Mock.return_value` attribute. The default return value is a new Mock object; it is created the first time the return value is accessed (either explicitly or by calling the Mock) - but it is stored and the same one returned each time.rÁh6j¥h7h:h}rÂ(h@]rÃhB]rÄhD]rÅhF]rÆhH]rÇuhJMrhKhh0]rÈ(hYXEMock objects are callable. The call will return the value set as the rÉ…rÊ}rË(h5XEMock objects are callable. The call will return the value set as the rÌh6j¿ubh´)rÍ}rÎ(h5X:attr:`~Mock.return_value`rÏh6j¿h7h:h}rÐ(UreftyperÑXattrrÒh¼‰h½XMock.return_valuerÓU refdomainrÔXpyrÕhF]rÖhD]r×U refexplicitr؉h@]rÙhB]rÚhH]rÛhÇhÈhÉNhÊhËuhJMrh0]rÜhÍ)rÝ}rÞ(h5jÏh>}rß(h@]ràhB]rá(hÓjÕXpy-attrrâehD]rãhF]rähH]råuh6jÍh0]ræhYX return_valuerç…rè}ré(h5Uh6jÝubah}rñ(h@]ròhB]róhD]rôhF]rõhH]röuhJMxhKhh0]r÷(hYXACalls made to the object will be recorded in the attributes like rø…rù}rú(h5XACalls made to the object will be recorded in the attributes like rûh6jîubh´)rü}rý(h5X:attr:`~Mock.call_args`rþh6jîh7h:h}rÿ(UreftyperXattrrh¼‰h½XMock.call_argsrU refdomainrXpyrhF]rhD]rU refexplicitr‰h@]rhB]r hH]r hÇhÈhÉNhÊhËuhJMxh0]r hÍ)r }r (h5jþh>}r(h@]rhB]r(hÓjXpy-attrrehD]rhF]rhH]ruh6jüh0]rhYX call_argsr…r}r(h5Uh6j ubah}r (Ureftyper!Xattrr"h¼‰h½XMock.call_args_listr#U refdomainr$Xpyr%hF]r&hD]r'U refexplicitr(‰h@]r)hB]r*hH]r+hÇhÈhÉNhÊhËuhJMxh0]r,hÍ)r-}r.(h5jh>}r/(h@]r0hB]r1(hÓj%Xpy-attrr2ehD]r3hF]r4hH]r5uh6jh0]r6hYXcall_args_listr7…r8}r9(h5Uh6j-ubahh6j¥h7h:h}r?(h@]r@hB]rAhD]rBhF]rChH]rDuhJM{hKhh0]rE(hYXIf rF…rG}rH(h5XIf rIh6j<ubh´)rJ}rK(h5X:attr:`~Mock.side_effect`rLh6j<h7h:h}rM(UreftyperNXattrrOh¼‰h½XMock.side_effectrPU refdomainrQXpyrRhF]rShD]rTU refexplicitrU‰h@]rVhB]rWhH]rXhÇhÈhÉNhÊhËuhJM{h0]rYhÍ)rZ}r[(h5jLh>}r\(h@]r]hB]r^(hÓjRXpy-attrr_ehD]r`hF]rahH]rbuh6jJh0]rchYX side_effectrd…re}rf(h5Uh6jZubah}rn(h@]rohB]rphD]rqhF]rrhH]rsuh6j<h0]rthYX side_effectru…rv}rw(h5Uh6jkubah}r(h@]r€hB]rhD]r‚hF]rƒhH]r„uhJMhKhh0]r…(hYXJThe simplest way to make a mock raise an exception when called is to make r†…r‡}rˆ(h5XJThe simplest way to make a mock raise an exception when called is to make r‰h6j|ubh´)rŠ}r‹(h5X:attr:`~Mock.side_effect`rŒh6j|h7h:h}r(UreftyperŽXattrrh¼‰h½XMock.side_effectrU refdomainr‘Xpyr’hF]r“hD]r”U refexplicitr•‰h@]r–hB]r—hH]r˜hÇhÈhÉNhÊhËuhJMh0]r™hÍ)rš}r›(h5jŒh>}rœ(h@]rhB]rž(hÓj’Xpy-attrrŸehD]r hF]r¡hH]r¢uh6jŠh0]r£hYX side_effectr¤…r¥}r¦(h5Uh6jšubah>> m = MagicMock(side_effect=IndexError) >>> m(1, 2, 3) Traceback (most recent call last): ... IndexError >>> m.mock_calls [call(1, 2, 3)] >>> m.side_effect = KeyError('Bang!') >>> m('two', 'three', 'four') Traceback (most recent call last): ... KeyError: 'Bang!' >>> m.mock_calls [call(1, 2, 3), call('two', 'three', 'four')]r­h6j¥h7h:h}r®(U testnodetyper¯Xdoctestr°hehfhF]r±hD]r²h@]r³hB]r´hH]rµUgroupsr¶]r·hnaho}r¸uhJM‚hKhh0]r¹hYXK>>> m = MagicMock(side_effect=IndexError) >>> m(1, 2, 3) Traceback (most recent call last): ... IndexError >>> m.mock_calls [call(1, 2, 3)] >>> m.side_effect = KeyError('Bang!') >>> m('two', 'three', 'four') Traceback (most recent call last): ... KeyError: 'Bang!' >>> m.mock_calls [call(1, 2, 3), call('two', 'three', 'four')]rº…r»}r¼(h5Uh6j«ubaubhu)r½}r¾(h5XIf `side_effect` is a function then whatever that function returns is what calls to the mock return. The `side_effect` function is called with the same arguments as the mock. This allows you to vary the return value of the call dynamically, based on the input:r¿h6j¥h7h:h}rÀ(h@]rÁhB]rÂhD]rÃhF]rÄhH]rÅuhJM“hKhh0]rÆ(hYXIf rÇ…rÈ}rÉ(h5XIf rÊh6j½ubh)rË}rÌ(h5X `side_effect`rÍh>}rÎ(h@]rÏhB]rÐhD]rÑhF]rÒhH]rÓuh6j½h0]rÔhYX side_effectrÕ…rÖ}r×(h5Uh6jËubah}rß(h@]ràhB]ráhD]râhF]rãhH]räuh6j½h0]råhYX side_effectræ…rç}rè(h5Uh6jÜubah>> def side_effect(value): ... return value + 1 ... >>> m = MagicMock(side_effect=side_effect) >>> m(1) 2 >>> m(2) 3 >>> m.mock_calls [call(1), call(2)]rïh6j¥h7h:h}rð(U testnodetyperñXdoctestròhehfhF]róhD]rôh@]rõhB]röhH]r÷Ugroupsrø]rùhnaho}rúuhJM˜hKhh0]rûhYX>>> def side_effect(value): ... return value + 1 ... >>> m = MagicMock(side_effect=side_effect) >>> m(1) 2 >>> m(2) 3 >>> m.mock_calls [call(1), call(2)]rü…rý}rþ(h5Uh6jíubaubhu)rÿ}r(h5XãIf you want the mock to still return the default return value (a new mock), or any set return value, then there are two ways of doing this. Either return `mock.return_value` from inside `side_effect`, or return :data:`DEFAULT`:rh6j¥h7h:h}r(h@]rhB]rhD]rhF]rhH]ruhJM¥hKhh0]r(hYXšIf you want the mock to still return the default return value (a new mock), or any set return value, then there are two ways of doing this. Either return r …r }r (h5XšIf you want the mock to still return the default return value (a new mock), or any set return value, then there are two ways of doing this. Either return r h6jÿubh)r }r(h5X`mock.return_value`rh>}r(h@]rhB]rhD]rhF]rhH]ruh6jÿh0]rhYXmock.return_valuer…r}r(h5Uh6j ubah}r!(h@]r"hB]r#hD]r$hF]r%hH]r&uh6jÿh0]r'hYX side_effectr(…r)}r*(h5Uh6jubah}r2(Ureftyper3Xdatar4h¼‰h½XDEFAULTr5U refdomainr6Xpyr7hF]r8hD]r9U refexplicitr:‰h@]r;hB]r<hH]r=hÇhÈhÉNhÊhËuhJM¥h0]r>hÍ)r?}r@(h5j1h>}rA(h@]rBhB]rC(hÓj7Xpy-datarDehD]rEhF]rFhH]rGuh6j/h0]rHhYXDEFAULTrI…rJ}rK(h5Uh6j?ubah>> m = MagicMock() >>> def side_effect(*args, **kwargs): ... return m.return_value ... >>> m.side_effect = side_effect >>> m.return_value = 3 >>> m() 3 >>> def side_effect(*args, **kwargs): ... return DEFAULT ... >>> m.side_effect = side_effect >>> m() 3rPh6j¥h7h:h}rQ(U testnodetyperRXdoctestrShehfhF]rThD]rUh@]rVhB]rWhH]rXUgroupsrY]rZhnaho}r[uhJM©hKhh0]r\hYX>>> m = MagicMock() >>> def side_effect(*args, **kwargs): ... return m.return_value ... >>> m.side_effect = side_effect >>> m.return_value = 3 >>> m() 3 >>> def side_effect(*args, **kwargs): ... return DEFAULT ... >>> m.side_effect = side_effect >>> m() 3r]…r^}r_(h5Uh6jNubaubhu)r`}ra(h5X`To remove a `side_effect`, and return to the default behaviour, set the `side_effect` to `None`:rbh6j¥h7h:h}rc(h@]rdhB]rehD]rfhF]rghH]rhuhJMºhKhh0]ri(hYX To remove a rj…rk}rl(h5X To remove a rmh6j`ubh)rn}ro(h5X `side_effect`rph>}rq(h@]rrhB]rshD]rthF]ruhH]rvuh6j`h0]rwhYX side_effectrx…ry}rz(h5Uh6jnubah}r‚(h@]rƒhB]r„hD]r…hF]r†hH]r‡uh6j`h0]rˆhYX side_effectr‰…rŠ}r‹(h5Uh6jubah}r“(h@]r”hB]r•hD]r–hF]r—hH]r˜uh6j`h0]r™hYXNonerš…r›}rœ(h5Uh6jubah>> m = MagicMock(return_value=6) >>> def side_effect(*args, **kwargs): ... return 3 ... >>> m.side_effect = side_effect >>> m() 3 >>> m.side_effect = None >>> m() 6r¡h6j¥h7h:h}r¢(U testnodetyper£Xdoctestr¤hehfhF]r¥hD]r¦h@]r§hB]r¨hH]r©Ugroupsrª]r«hnaho}r¬uhJM½hKhh0]r­hYX©>>> m = MagicMock(return_value=6) >>> def side_effect(*args, **kwargs): ... return 3 ... >>> m.side_effect = side_effect >>> m() 3 >>> m.side_effect = None >>> m() 6r®…r¯}r°(h5Uh6jŸubaubhu)r±}r²(h5XµThe `side_effect` can also be any iterable object. Repeated calls to the mock will return values from the iterable (until the iterable is exhausted and a `StopIteration` is raised):r³h6j¥h7h:h}r´(h@]rµhB]r¶hD]r·hF]r¸hH]r¹uhJMÊhKhh0]rº(hYXThe r»…r¼}r½(h5XThe r¾h6j±ubh)r¿}rÀ(h5X `side_effect`rÁh>}rÂ(h@]rÃhB]rÄhD]rÅhF]rÆhH]rÇuh6j±h0]rÈhYX side_effectrÉ…rÊ}rË(h5Uh6j¿ubah}rÓ(h@]rÔhB]rÕhD]rÖhF]r×hH]rØuh6j±h0]rÙhYX StopIterationrÚ…rÛ}rÜ(h5Uh6jÐubah>> m = MagicMock(side_effect=[1, 2, 3]) >>> m() 1 >>> m() 2 >>> m() 3 >>> m() Traceback (most recent call last): ... StopIterationrãh6j¥h7h:h}rä(U testnodetyperåXdoctestræhehfhF]rçhD]rèh@]réhB]rêhH]rëUgroupsrì]ríhnaho}rîuhJMÎhKhh0]rïhYX…>>> m = MagicMock(side_effect=[1, 2, 3]) >>> m() 1 >>> m() 2 >>> m() 3 >>> m() Traceback (most recent call last): ... StopIterationrð…rñ}rò(h5Uh6jáubaubhu)ró}rô(h5XVIf any members of the iterable are exceptions they will be raised instead of returned:rõh6j¥h7h:h}rö(h@]r÷hB]røhD]rùhF]rúhH]rûuhJMÜhKhh0]rühYXVIf any members of the iterable are exceptions they will be raised instead of returned:rý…rþ}rÿ(h5jõh6jóubaubjz)r}r(h5Xœ>>> iterable = (33, ValueError, 66) >>> m = MagicMock(side_effect=iterable) >>> m() 33 >>> m() Traceback (most recent call last): ... ValueError >>> m() 66rh6j¥h7h:h}r(U testnodetyperXdoctestrhehfhF]rhD]rh@]rhB]r hH]r Ugroupsr ]r hnaho}r uhJMßhKhh0]rhYXœ>>> iterable = (33, ValueError, 66) >>> m = MagicMock(side_effect=iterable) >>> m() 33 >>> m() Traceback (most recent call last): ... ValueError >>> m() 66r…r}r(h5Uh6jubaubjÔ)r}r(h5X.. _deleting-attributes:rh6j¥h7h:h}r(hF]rhD]rh@]rhB]rhH]rh¢h*uhJMíhKhh0]rubeubh2)r}r(h5Uh6hh7h:j§}rhjsh}r(h@]r hB]r!hD]r"hF]r#(h*h/ehH]r$(h heuhJMðhKhj¯}r%h*jsh0]r&(hM)r'}r((h5XDeleting Attributesr)h6jh7h:h}r*(h@]r+hB]r,hD]r-hF]r.hH]r/uhJMðhKhh0]r0hYXDeleting Attributesr1…r2}r3(h5j)h6j'ubaubhu)r4}r5(h5X`Mock objects create attributes on demand. This allows them to pretend to be objects of any type.r6h6jh7h:h}r7(h@]r8hB]r9hD]r:hF]r;hH]r<uhJMòhKhh0]r=hYX`Mock objects create attributes on demand. This allows them to pretend to be objects of any type.r>…r?}r@(h5j6h6j4ubaubhu)rA}rB(h5XÝYou may want a mock object to return `False` to a `hasattr` call, or raise an `AttributeError` when an attribute is fetched. You can do this by providing an object as a `spec` for a mock, but that isn't always convenient.rCh6jh7h:h}rD(h@]rEhB]rFhD]rGhF]rHhH]rIuhJMõhKhh0]rJ(hYX%You may want a mock object to return rK…rL}rM(h5X%You may want a mock object to return rNh6jAubh)rO}rP(h5X`False`rQh>}rR(h@]rShB]rThD]rUhF]rVhH]rWuh6jAh0]rXhYXFalserY…rZ}r[(h5Uh6jOubah}rc(h@]rdhB]rehD]rfhF]rghH]rhuh6jAh0]rihYXhasattrrj…rk}rl(h5Uh6j`ubah}rt(h@]ruhB]rvhD]rwhF]rxhH]ryuh6jAh0]rzhYXAttributeErrorr{…r|}r}(h5Uh6jqubah}r…(h@]r†hB]r‡hD]rˆhF]r‰hH]rŠuh6jAh0]r‹hYXspecrŒ…r}rŽ(h5Uh6j‚ubah}r–(h@]r—hB]r˜hD]r™hF]ršhH]r›uhJMùhKhh0]rœ(hYX\You "block" attributes by deleting them. Once deleted, accessing an attribute will raise an r…rž}rŸ(h5X\You "block" attributes by deleting them. Once deleted, accessing an attribute will raise an r h6j“ubh)r¡}r¢(h5X`AttributeError`r£h>}r¤(h@]r¥hB]r¦hD]r§hF]r¨hH]r©uh6j“h0]rªhYXAttributeErrorr«…r¬}r­(h5Uh6j¡ubah>> mock = MagicMock() >>> hasattr(mock, 'm') True >>> del mock.m >>> hasattr(mock, 'm') False >>> del mock.f >>> mock.f Traceback (most recent call last): ... AttributeError: fr²h6jh7h:h}r³(U testnodetyper´XdoctestrµhehfhF]r¶hD]r·h@]r¸hB]r¹hH]rºUgroupsr»]r¼hnaho}r½uhJMühKhh0]r¾hYXµ>>> mock = MagicMock() >>> hasattr(mock, 'm') True >>> del mock.m >>> hasattr(mock, 'm') False >>> del mock.f >>> mock.f Traceback (most recent call last): ... AttributeError: fr¿…rÀ}rÁ(h5Uh6j°ubaubeubh2)rÂ}rÃ(h5Uh6hh7h:h}rÄ(h@]rÅhB]rÆhD]rÇhF]rÈh-ahH]rÉhauhJM hKhh0]rÊ(hM)rË}rÌ(h5XAttaching Mocks as AttributesrÍh6jÂh7h:h}rÎ(h@]rÏhB]rÐhD]rÑhF]rÒhH]rÓuhJM hKhh0]rÔhYXAttaching Mocks as AttributesrÕ…rÖ}r×(h5jÍh6jËubaubhu)rØ}rÙ(h5XÑWhen you attach a mock as an attribute of another mock (or as the return value) it becomes a "child" of that mock. Calls to the child are recorded in the :attr:`~Mock.method_calls` and :attr:`~Mock.mock_calls` attributes of the parent. This is useful for configuring child mocks and then attaching them to the parent, or for attaching mocks to a parent that records all calls to the children and allows you to make assertions about the order of calls between mocks:rÚh6jÂh7h:h}rÛ(h@]rÜhB]rÝhD]rÞhF]rßhH]ràuhJMhKhh0]rá(hYXšWhen you attach a mock as an attribute of another mock (or as the return value) it becomes a "child" of that mock. Calls to the child are recorded in the râ…rã}rä(h5XšWhen you attach a mock as an attribute of another mock (or as the return value) it becomes a "child" of that mock. Calls to the child are recorded in the råh6jØubh´)ræ}rç(h5X:attr:`~Mock.method_calls`rèh6jØh7h:h}ré(UreftyperêXattrrëh¼‰h½XMock.method_callsrìU refdomainríXpyrîhF]rïhD]rðU refexplicitrñ‰h@]ròhB]róhH]rôhÇhÈhÉNhÊhËuhJMh0]rõhÍ)rö}r÷(h5jèh>}rø(h@]rùhB]rú(hÓjîXpy-attrrûehD]rühF]rýhH]rþuh6jæh0]rÿhYX method_callsr…r}r(h5Uh6jöubah}r (Ureftyper Xattrr h¼‰h½XMock.mock_callsr U refdomainrXpyrhF]rhD]rU refexplicitr‰h@]rhB]rhH]rhÇhÈhÉNhÊhËuhJMh0]rhÍ)r}r(h5j h>}r(h@]rhB]r(hÓjXpy-attrrehD]rhF]rhH]ruh6jh0]r hYX mock_callsr!…r"}r#(h5Uh6jubah>> parent = MagicMock() >>> child1 = MagicMock(return_value=None) >>> child2 = MagicMock(return_value=None) >>> parent.child1 = child1 >>> parent.child2 = child2 >>> child1(1) >>> child2(2) >>> parent.mock_calls [call.child1(1), call.child2(2)]r*h6jÂh7h:h}r+(U testnodetyper,Xdoctestr-hehfhF]r.hD]r/h@]r0hB]r1hH]r2Ugroupsr3]r4hnaho}r5uhJMhKhh0]r6hYXõ>>> parent = MagicMock() >>> child1 = MagicMock(return_value=None) >>> child2 = MagicMock(return_value=None) >>> parent.child1 = child1 >>> parent.child2 = child2 >>> child1(1) >>> child2(2) >>> parent.mock_calls [call.child1(1), call.child2(2)]r7…r8}r9(h5Uh6j(ubaubhu)r:}r;(h5X‹The exception to this is if the mock has a name. This allows you to prevent the "parenting" if for some reason you don't want it to happen.r<h6jÂh7h:h}r=(h@]r>hB]r?hD]r@hF]rAhH]rBuhJM"hKhh0]rChYX‹The exception to this is if the mock has a name. This allows you to prevent the "parenting" if for some reason you don't want it to happen.rD…rE}rF(h5j<h6j:ubaubjz)rG}rH(h5X½>>> mock = MagicMock() >>> not_a_child = MagicMock(name='not-a-child') >>> mock.attribute = not_a_child >>> mock.attribute() >>> mock.mock_calls []rIh6jÂh7h:h}rJ(U testnodetyperKXdoctestrLhehfhF]rMhD]rNh@]rOhB]rPhH]rQUgroupsrR]rShnaho}rTuhJM%hKhh0]rUhYX½>>> mock = MagicMock() >>> not_a_child = MagicMock(name='not-a-child') >>> mock.attribute = not_a_child >>> mock.attribute() >>> mock.mock_calls []rV…rW}rX(h5Uh6jGubaubhu)rY}rZ(h5XŸMocks created for you by :func:`patch` are automatically given names. To attach mocks that have names to a parent you use the :meth:`~Mock.attach_mock` method:r[h6jÂh7h:h}r\(h@]r]hB]r^hD]r_hF]r`hH]rauhJM/hKhh0]rb(hYXMocks created for you by rc…rd}re(h5XMocks created for you by rfh6jYubh´)rg}rh(h5X :func:`patch`rih6jYh7h:h}rj(UreftyperkXfuncrlh¼‰h½XpatchrmU refdomainrnXpyrohF]rphD]rqU refexplicitrr‰h@]rshB]rthH]ruhÇhÈhÉNhÊhËuhJM/h0]rvhÍ)rw}rx(h5jih>}ry(h@]rzhB]r{(hÓjoXpy-funcr|ehD]r}hF]r~hH]ruh6jgh0]r€hYXpatch()r…r‚}rƒ(h5Uh6jwubah}r‹(UreftyperŒXmethrh¼‰h½XMock.attach_mockrŽU refdomainrXpyrhF]r‘hD]r’U refexplicitr“‰h@]r”hB]r•hH]r–hÇhÈhÉNhÊhËuhJM/h0]r—hÍ)r˜}r™(h5jŠh>}rš(h@]r›hB]rœ(hÓjXpy-methrehD]ržhF]rŸhH]r uh6jˆh0]r¡hYX attach_mock()r¢…r£}r¤(h5Uh6j˜ubah>> thing1 = object() >>> thing2 = object() >>> parent = MagicMock() >>> with patch('__main__.thing1', return_value=None) as child1: ... with patch('__main__.thing2', return_value=None) as child2: ... parent.attach_mock(child1, 'child1') ... parent.attach_mock(child2, 'child2') ... child1('one') ... child2('two') ... >>> parent.mock_calls [call.child1('one'), call.child2('two')]r«h6jÂh7h:h}r¬(U testnodetyper­Xdoctestr®hehfhF]r¯hD]r°h@]r±hB]r²hH]r³Ugroupsr´]rµhnaho}r¶uhJM3hKhh0]r·hYX¡>>> thing1 = object() >>> thing2 = object() >>> parent = MagicMock() >>> with patch('__main__.thing1', return_value=None) as child1: ... with patch('__main__.thing2', return_value=None) as child2: ... parent.attach_mock(child1, 'child1') ... parent.attach_mock(child2, 'child2') ... child1('one') ... child2('two') ... >>> parent.mock_calls [call.child1('one'), call.child2('two')]r¸…r¹}rº(h5Uh6j©ubaubcdocutils.nodes transition r»)r¼}r½(h5X-----r¾h6jÂh7h:h}rÀ(h@]rÁhB]rÂhD]rÃhF]rÄhH]rÅuhJMChKhh0]rÆubcdocutils.nodes footnote rÇ)rÈ}rÉ(h5X The only exceptions are magic methods and attributes (those that have leading and trailing double underscores). Mock doesn't create these but instead of raises an ``AttributeError``. This is because the interpreter will often implicitly request these methods, and gets *very* confused to get a new Mock object when it expects a magic method. If you need magic method support see :ref:`magic methods `.rÊh6jÂh7h:h}rÌ(h›KhF]rÍh,ahD]rÎhah@]rÏhB]rÐhH]rÑU1auhJMEhKhh0]rÒ(cdocutils.nodes label rÓ)rÔ}rÕ(h5Uh6jÈh7Nh}r×(h@]rØhB]rÙhD]rÚhF]rÛhH]rÜuhJNhKhh0]rÝhYX1…rÞ}rß(h5Uh6jÔubaubhu)rà}rá(h5X The only exceptions are magic methods and attributes (those that have leading and trailing double underscores). Mock doesn't create these but instead of raises an ``AttributeError``. This is because the interpreter will often implicitly request these methods, and gets *very* confused to get a new Mock object when it expects a magic method. If you need magic method support see :ref:`magic methods `.râh6jÈh7h:h}rã(h@]rähB]råhD]ræhF]rçhH]rèuhJMEh0]ré(hYX£The only exceptions are magic methods and attributes (those that have leading and trailing double underscores). Mock doesn't create these but instead of raises an rê…rë}rì(h5X£The only exceptions are magic methods and attributes (those that have leading and trailing double underscores). Mock doesn't create these but instead of raises an ríh6jàubhÍ)rî}rï(h5X``AttributeError``rðh>}rñ(h@]ròhB]róhD]rôhF]rõhH]röuh6jàh0]r÷hYXAttributeErrorrø…rù}rú(h5Uh6jîubah}r(h@]rhB]rhD]rhF]rhH]ruh6jàh0]rhYXveryr …r }r (h5Uh6jÿubah`rh6jàh7h:h}r(UreftyperXrefrh¼ˆh½X magic-methodsrU refdomainrXstdrhF]rhD]rU refexplicitrˆh@]rhB]rhH]rhÇhÈuhJMEh0]rjê)r }r!(h5jh>}r"(h@]r#hB]r$(hÓjXstd-refr%ehD]r&hF]r'hH]r(uh6jh0]r)hYX magic methodsr*…r+}r,(h5Uh6j ubah(cdocutils.nodes system_message r?)r@}rA(h5Uh>}rB(h@]rCUlevelrDKhF]rEhD]rFUsourcerGh:hB]rHhH]rIUlinerJKUtyperKUINFOrLuh0]rMhu)rN}rO(h5Uh>}rP(h@]rQhB]rRhD]rShF]rThH]rUuh6j@h0]rVhYX-Hyperlink target "index-0" is not referenced.rW…rX}rY(h5Uh6jNubah}r](h@]r^Ulevelr_KhF]r`hD]raUsourcerbh:hB]rchH]rdUlinereKUtyperfjLuh0]rghu)rh}ri(h5Uh>}rj(h@]rkhB]rlhD]rmhF]rnhH]rouh6j[h0]rphYX-Hyperlink target "index-1" is not referenced.rq…rr}rs(h5Uh6jhubah}rv(h@]rwUlevelrxKhF]ryhD]rzUsourcer{h:hB]r|hH]r}Uliner~KUtyperjLuh0]r€hu)r}r‚(h5Uh>}rƒ(h@]r„hB]r…hD]r†hF]r‡hH]rˆuh6jth0]r‰hYX-Hyperlink target "index-2" is not referenced.rŠ…r‹}rŒ(h5Uh6jubah}r(h@]rUlevelr‘KhF]r’hD]r“Usourcer”h:hB]r•hH]r–Uliner—K Utyper˜jLuh0]r™hu)rš}r›(h5Uh>}rœ(h@]rhB]ržhD]rŸhF]r hH]r¡uh6jh0]r¢hYX-Hyperlink target "index-3" is not referenced.r£…r¤}r¥(h5Uh6jšubah}r¨(h@]r©UlevelrªKhF]r«hD]r¬Usourcer­h:hB]r®hH]r¯Uliner°K"Utyper±jLuh0]r²hu)r³}r´(h5Uh>}rµ(h@]r¶hB]r·hD]r¸hF]r¹hH]rºuh6j¦h0]r»hYX-Hyperlink target "index-4" is not referenced.r¼…r½}r¾(h5Uh6j³ubah}rÁ(h@]rÂUlevelrÃKhF]rÄhD]rÅUsourcerÆh:hB]rÇhH]rÈUlinerÉMlUtyperÊjLuh0]rËhu)rÌ}rÍ(h5Uh>}rÎ(h@]rÏhB]rÐhD]rÑhF]rÒhH]rÓuh6j¿h0]rÔhYX-Hyperlink target "index-5" is not referenced.rÕ…rÖ}r×(h5Uh6jÌubah}rÚ(h@]rÛUlevelrÜKhF]rÝhD]rÞUsourcerßh:hB]ràhH]ráUlinerâMnUtyperãjLuh0]rähu)rå}ræ(h5Uh>}rç(h@]rèhB]réhD]rêhF]rëhH]rìuh6jØh0]ríhYX-Hyperlink target "index-6" is not referenced.rî…rï}rð(h5Uh6jåubah}ró(h@]rôUlevelrõKhF]röhD]r÷Usourcerøh:hB]rùhH]rúUlinerûMíUtyperüjLuh0]rýhu)rþ}rÿ(h5Uh>}r(h@]rhB]rhD]rhF]rhH]ruh6jñh0]rhYX9Hyperlink target "deleting-attributes" is not referenced.r…r}r (h5Uh6jþubahU source_urlr?NUinput_encodingr@U utf-8-sigrAU_disable_configrBNU id_prefixrCUU tab_widthrDKUerror_encodingrEU mac-romanrFU_sourcerGU/compile/mock/docs/mock.txtrHUgettext_compactrIˆU generatorrJNUdump_internalsrKNU pep_base_urlrLUhttp://www.python.org/dev/peps/rMUsyntax_highlightrNUshortrOUinput_encoding_error_handlerrPj+Uauto_id_prefixrQUidrRUdoctitle_xformrS‰Ustrip_elements_with_classesrTNU _config_filesrU]rVUfile_insertion_enabledrWKU raw_enabledrXKU dump_settingsrYNubUsymbol_footnote_startrZKUidsr[}r\(h,jÈh*jhj”hj)h jQh j½h jh jY h j’ hj¬ h/jj™j¥hjm hh•j'j*j„j‡hjjÐjÕjèjëjýjjjh+h3hj hjhjãhj+hjÁ hjˆhjúhjØhjø h.j¥hjM hjh-jÂhj¥uUsubstitution_namesr]}r^h}r_(h@]r`hF]rahD]rbUsourcerch:hB]rdhH]reuU footnotesrf]rgUrefidsrh}ri(h*]rjjaj™]rkjœah,]rlh•auub.mock-1.0.1/html/.doctrees/mocksignature.doctree0000644000076500001200000012252411727757056022254 0ustar michaeladmin00000000000000€cdocutils.nodes document q)q}q(U nametypesq}q(X#mocksignature with callable objectsqNX example useqNXmocksignature with classesqNXinspectq KXmocksignature apiq NX basic useq NX mocksignatureq NXmock.mocksignatureq KXmocking methods and selfqNXkeyword argumentsqNXmocksignature argument to patchqNuUsubstitution_defsq}qUparse_messagesq]qUcurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q(hU#mocksignature-with-callable-objectsqhU example-useqhUmocksignature-with-classesqh Uinspectqh Umocksignature-apiqh U basic-useqh U mocksignatureq h h hUmocking-methods-and-selfq!hUkeyword-argumentsq"hUmocksignature-argument-to-patchq#uUchildrenq$]q%cdocutils.nodes section q&)q'}q((U rawsourceq)UUparentq*hUsourceq+cdocutils.nodes reprunicode q,X$/compile/mock/docs/mocksignature.txtq-…q.}q/bUtagnameq0Usectionq1U attributesq2}q3(Udupnamesq4]Uclassesq5]Ubackrefsq6]Uidsq7]q8h aUnamesq9]q:h auUlineq;KUdocumentq)q?}q@(h)X mocksignatureqAh*h'h+h.h0UtitleqBh2}qC(h4]h5]h6]h7]h9]uh;Kh`_ or depends on functions being function objects.h*h'h+h.h0hRh2}qË(h4]h5]h6]h7]h9]uh;Kh`_h2}qÓ(Unameh UrefuriqÔX+http://docs.python.org/library/inspect.htmlqÕh7]h6]h4]h5]h9]uh*hÉh$]qÖhEXinspectq×…qØ}qÙ(h)Uh*hÑubah0U referenceqÚubcdocutils.nodes target qÛ)qÜ}qÝ(h)X. h2}qÞ(UrefurihÕh7]qßhah6]h4]h5]h9]qàh auh*hÉh$]h0UtargetqáubhEX0 or depends on functions being function objects.qâ…qã}qä(h)X0 or depends on functions being function objects.h*hÉubeubcsphinx.addnodes index qå)qæ}qç(h)Uh*h'h+h.h0Uindexqèh2}qé(h7]h6]h4]h5]h9]Uentries]qê(UsingleqëX mocksignature() (in module mock)h Utqìauh;Nh(h)Uh*j8ubah0hxubhEX that delegates to r?…r@}rA(h)X that delegates to h*j1ubhp)rB}rC(h)X`mock`h2}rD(h4]h5]h6]h7]h9]uh*j1h$]rEhEXmockrF…rG}rH(h)Uh*jBubah0hxubhEX. If rI…rJ}rK(h)X. If h*j1ubhp)rL}rM(h)X `skipfirst`h2}rN(h4]h5]h6]h7]h9]uh*j1h$]rOhEX skipfirstrP…rQ}rR(h)Uh*jLubah0hxubhEXA is True the first argument is skipped, useful for methods where rS…rT}rU(h)XA is True the first argument is skipped, useful for methods where h*j1ubhp)rV}rW(h)X`self`h2}rX(h4]h5]h6]h7]h9]uh*j1h$]rYhEXselfrZ…r[}r\(h)Uh*jVubah0hxubhEX+ needs to be omitted from the new function.r]…r^}r_(h)X+ needs to be omitted from the new function.h*j1ubeubhO)r`}ra(h)X?If you don't pass in a `mock` then one will be created for you.h*j,h+h.h0hRh2}rb(h4]h5]h6]h7]h9]uh;K"h)rõ}rö(h)Xmocksignature apir÷h*jïh+h.h0hBh2}rø(h4]h5]h6]h7]h9]uh;K:h>> def func(a, b, c): ... pass ... >>> func2 = mocksignature(func) >>> func2.called False >>> func2.return_value = 3 >>> func2(1, 2, 3) 3 >>> func2.called True >>> func2.assert_called_once_with(1, 2, 3) >>> func2.assert_called_with(1, 2, 4) Traceback (most recent call last): ... AssertionError: Expected call: mock(1, 2, 4) Actual call: mock(1, 2, 3) >>> func2.call_count 1 >>> func2.side_effect = IndexError >>> func2(4, 5, 6) Traceback (most recent call last): ... IndexErrorh*jïh+h.h0U literal_blockr#h2}r$(U testnodetypeXdoctestU xml:spacer%Upreserver&h7]h6]h4]h5]h9]Ugroups]r'Udefaultr(aUoptionsr)}uh;K@h>> def func(a, b, c): ... pass ... >>> func2 = mocksignature(func) >>> func2.called False >>> func2.return_value = 3 >>> func2(1, 2, 3) 3 >>> func2.called True >>> func2.assert_called_once_with(1, 2, 3) >>> func2.assert_called_with(1, 2, 4) Traceback (most recent call last): ... AssertionError: Expected call: mock(1, 2, 4) Actual call: mock(1, 2, 3) >>> func2.call_count 1 >>> func2.side_effect = IndexError >>> func2(4, 5, 6) Traceback (most recent call last): ... IndexErrorr+…r,}r-(h)Uh*j!ubaubhO)r.}r/(h)X{The mock object that is being delegated to is available as the `mock` attribute of the function created by `mocksignature`.h*jïh+h.h0hRh2}r0(h4]h5]h6]h7]h9]uh;K[h(h)X& attribute of the function created by h*j.ubhp)r?}r@(h)X`mocksignature`h2}rA(h4]h5]h6]h7]h9]uh*j.h$]rBhEX mocksignaturerC…rD}rE(h)Uh*j?ubah0hxubhEX.…rF}rG(h)X.h*j.ubeubj )rH}rI(h)X8>>> func2.mock.mock_calls [call(1, 2, 3), call(4, 5, 6)]h*jïh+h.h0j#h2}rJ(U testnodetypeXdoctestj%j&h7]h6]h4]h5]h9]Ugroups]rKj(aj)}uh;K^h>> func2.mock.mock_calls [call(1, 2, 3), call(4, 5, 6)]rM…rN}rO(h)Uh*jHubaubhO)rP}rQ(h)XRThe methods and attributes available on functions returned by `mocksignature` are:h*jïh+h.h0hRh2}rR(h4]h5]h6]h7]h9]uh;KchThe methods and attributes available on functions returned by rT…rU}rV(h)X>The methods and attributes available on functions returned by h*jPubhp)rW}rX(h)X`mocksignature`h2}rY(h4]h5]h6]h7]h9]uh*jPh$]rZhEX mocksignaturer[…r\}r](h)Uh*jWubah0hxubhEX are:r^…r_}r`(h)X are:h*jPubeubcdocutils.nodes block_quote ra)rb}rc(h)Uh*jïh+h.h0U block_quoterdh2}re(h4]h5]h6]h7]h9]uh;Nh(UreftypeXattrh[‰h\XMock.return_valueU refdomainXpyr?h7]h6]U refexplicit‰h4]h5]h9]h^h_hˆNh‰hŠuh;Kfh$]r@hŒ)rA}rB(h)j=h2}rC(h4]h5]rD(hfj?Xpy-attrrEeh6]h7]h9]uh*j;h$]rFhEX return_valuerG…rH}rI(h)Uh*jAubah0h–ubaubhEX, and rJ…rK}rL(h)X, and h*jgubhU)rM}rN(h)X:attr:`~Mock.side_effect`rOh*jgh+h.h0hYh2}rP(UreftypeXattrh[‰h\XMock.side_effectU refdomainXpyrQh7]h6]U refexplicit‰h4]h5]h9]h^h_hˆNh‰hŠuh;Kfh$]rRhŒ)rS}rT(h)jOh2}rU(h4]h5]rV(hfjQXpy-attrrWeh6]h7]h9]uh*jMh$]rXhEX side_effectrY…rZ}r[(h)Uh*jSubah0h–ubaubhEX.…r\}r](h)X.h*jgubeubaubeubh&)r^}r_(h)Uh*h'h+h.h0h1h2}r`(h4]h5]h6]h7]rahah9]rbhauh;Kph)rd}re(h)X Example userfh*j^h+h.h0hBh2}rg(h4]h5]h6]h7]h9]uh;Kph)rr}rs(h)X Basic userth*jlh+h.h0hBh2}ru(h4]h5]h6]h7]h9]uh;Ksh>> def function(a, b, c=None): ... pass ... >>> mock = Mock() >>> function = mocksignature(function, mock) >>> function() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (0 given) >>> function.return_value = 'some value' >>> function(1, 2, 'foo') 'some value' >>> function.assert_called_with(1, 2, 'foo')h*jlh+h.h0j#h2}r|(U testnodetypeXdoctestj%j&h7]h6]h4]h5]h9]Ugroups]r}j(aj)}uh;Kuh>> def function(a, b, c=None): ... pass ... >>> mock = Mock() >>> function = mocksignature(function, mock) >>> function() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (0 given) >>> function.return_value = 'some value' >>> function(1, 2, 'foo') 'some value' >>> function.assert_called_with(1, 2, 'foo')r…r€}r(h)Uh*jzubaubeubh&)r‚}rƒ(h)Uh*j^h+h.h0h1h2}r„(h4]h5]h6]h7]r…h"ah9]r†hauh;K‡h)rˆ}r‰(h)XKeyword argumentsrŠh*j‚h+h.h0hBh2}r‹(h4]h5]h6]h7]h9]uh;K‡h>> def function(a, b, c=None): ... pass ... >>> function = mocksignature(function) >>> function.return_value = None >>> function(1, 2) >>> function.assert_called_with(1, 2, None)h*j‚h+h.h0j#h2}r£(U testnodetypeXdoctestj%j&h7]h6]h4]h5]h9]Ugroups]r¤j(aj)}uh;KŒh>> def function(a, b, c=None): ... pass ... >>> function = mocksignature(function) >>> function.return_value = None >>> function(1, 2) >>> function.assert_called_with(1, 2, None)r¦…r§}r¨(h)Uh*j¡ubaubeubh&)r©}rª(h)Uh*j^h+h.h0h1h2}r«(h4]h5]h6]h7]r¬h!ah9]r­hauh;K˜h)r¯}r°(h)XMocking methods and selfr±h*j©h+h.h0hBh2}r²(h4]h5]h6]h7]h9]uh;K˜h>> class SomeClass(object): ... def method(self, a, b, c=None): ... pass ... >>> SomeClass.method = mocksignature(SomeClass.method) >>> SomeClass.method.mock.return_value = None >>> instance = SomeClass() >>> instance.method() Traceback (most recent call last): ... TypeError: () takes at least 4 arguments (1 given) >>> instance.method(1, 2, 3) >>> instance.method.assert_called_with(instance, 1, 2, 3)h*j©h+h.h0j#h2}rù(U testnodetypeXdoctestj%j&h7]h6]h4]h5]h9]Ugroups]rúj(aj)}uh;K¢h>> class SomeClass(object): ... def method(self, a, b, c=None): ... pass ... >>> SomeClass.method = mocksignature(SomeClass.method) >>> SomeClass.method.mock.return_value = None >>> instance = SomeClass() >>> instance.method() Traceback (most recent call last): ... TypeError: () takes at least 4 arguments (1 given) >>> instance.method(1, 2, 3) >>> instance.method.assert_called_with(instance, 1, 2, 3)rü…rý}rþ(h)Uh*j÷ubaubhO)rÿ}r(h)XxWhen you use `mocksignature` on instance methods `self` isn't included (and we can set the `return_value` etc directly):h*j©h+h.h0hRh2}r(h4]h5]h6]h7]h9]uh;K²h>> class SomeClass(object): ... def method(self, a, b, c=None): ... pass ... >>> instance = SomeClass() >>> instance.method = mocksignature(instance.method) >>> instance.method.return_value = None >>> instance.method(1, 2, 3) >>> instance.method.assert_called_with(1, 2, 3)h*j©h+h.h0j#h2}r&(U testnodetypeXdoctestj%j&h7]h6]h4]h5]h9]Ugroups]r'j(aj)}uh;Kµh>> class SomeClass(object): ... def method(self, a, b, c=None): ... pass ... >>> instance = SomeClass() >>> instance.method = mocksignature(instance.method) >>> instance.method.return_value = None >>> instance.method(1, 2, 3) >>> instance.method.assert_called_with(1, 2, 3)r)…r*}r+(h)Uh*j$ubaubeubh&)r,}r-(h)Uh*j^h+h.h0h1h2}r.(h4]h5]h6]h7]r/hah9]r0hauh;KÃh)r2}r3(h)Xmocksignature with classesr4h*j,h+h.h0hBh2}r5(h4]h5]h6]h7]h9]uh;KÃh…r?}r@(h)XWhen used with a class h*j:ubhp)rA}rB(h)X`mocksignature`h2}rC(h4]h5]h6]h7]h9]uh*j:h$]rDhEX mocksignaturerE…rF}rG(h)Uh*jAubah0hxubhEX copies the signature of the rH…rI}rJ(h)X copies the signature of the h*j:ubhp)rK}rL(h)X `__init__`h2}rM(h4]h5]h6]h7]h9]uh*j:h$]rNhEX__init__rO…rP}rQ(h)Uh*jKubah0hxubhEX method.rR…rS}rT(h)X method.h*j:ubeubj )rU}rV(h)X~>>> class Something(object): ... def __init__(self, foo, bar): ... pass ... >>> MockSomething = mocksignature(Something) >>> instance = MockSomething(10, 9) >>> assert instance is MockSomething.return_value >>> MockSomething.assert_called_with(10, 9) >>> MockSomething() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (0 given)h*j,h+h.h0j#h2}rW(U testnodetypeXdoctestj%j&h7]h6]h4]h5]h9]Ugroups]rXj(aj)}uh;KÈh>> class Something(object): ... def __init__(self, foo, bar): ... pass ... >>> MockSomething = mocksignature(Something) >>> instance = MockSomething(10, 9) >>> assert instance is MockSomething.return_value >>> MockSomething.assert_called_with(10, 9) >>> MockSomething() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (0 given)rZ…r[}r\(h)Uh*jUubaubhO)r]}r^(h)XBecause the object returned by `mocksignature` is a function rather than a `Mock` you lose the other capabilities of `Mock`, like dynamic attribute creation.h*j,h+h.h0hRh2}r_(h4]h5]h6]h7]h9]uh;K×h)rˆ}r‰(h)X#mocksignature with callable objectsrŠh*j‚h+h.h0hBh2}r‹(h4]h5]h6]h7]h9]uh;KÝh>> class Something(object): ... def __call__(self, spam, eggs): ... pass ... >>> something = Something() >>> mock_something = mocksignature(something) >>> result = mock_something(10, 9) >>> mock_something.assert_called_with(10, 9) >>> mock_something() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (0 given)h*j‚h+h.h0j#h2}r­(U testnodetypeXdoctestj%j&h7]h6]h4]h5]h9]Ugroups]r®j(aj)}uh;Kâh>> class Something(object): ... def __call__(self, spam, eggs): ... pass ... >>> something = Something() >>> mock_something = mocksignature(something) >>> result = mock_something(10, 9) >>> mock_something.assert_called_with(10, 9) >>> mock_something() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (0 given)r°…r±}r²(h)Uh*j«ubaubeubeubh&)r³}r´(h)Uh*h'h+h.h0h1h2}rµ(h4]h5]h6]h7]r¶h#ah9]r·hauh;Kóh)r¹}rº(h)Xmocksignature argument to patchr»h*j³h+h.h0hBh2}r¼(h4]h5]h6]h7]h9]uh;Kóh>> class SomeClass(object): ... def method(self, a, b, c=None): ... pass ... >>> @patch.object(SomeClass, 'method', mocksignature=True) ... def test(mock_method): ... instance = SomeClass() ... mock_method.return_value = None ... instance.method(1, 2) ... mock_method.assert_called_with(instance, 1, 2, None) ... >>> test()h*j³h+h.h0j#h2}rõ(U testnodetypeXdoctestj%j&h7]h6]h4]h5]h9]Ugroups]röj(aj)}uh;Kùh>> class SomeClass(object): ... def method(self, a, b, c=None): ... pass ... >>> @patch.object(SomeClass, 'method', mocksignature=True) ... def test(mock_method): ... instance = SomeClass() ... mock_method.return_value = None ... instance.method(1, 2) ... mock_method.assert_called_with(instance, 1, 2, None) ... >>> test()rø…rù}rú(h)Uh*jóubaubeubeubah)UU transformerrûNU footnote_refsrü}rýUrefnamesrþ}rÿUsymbol_footnotesr]rUautofootnote_refsr]rUsymbol_footnote_refsr]rU citationsr]rhNUpep_file_url_templater?Upep-%04dr@Uexit_status_levelrAKUconfigrBNUstrict_visitorrCNUcloak_email_addressesrDˆUtrim_footnote_reference_spacerE‰UenvrFNUdump_pseudo_xmlrGNUexpose_internalsrHNUsectsubtitle_xformrI‰U source_linkrJNUrfc_referencesrKNUoutput_encodingrLUutf-8rMU source_urlrNNUinput_encodingrOU utf-8-sigrPU_disable_configrQNU id_prefixrRUU tab_widthrSKUerror_encodingrTUUTF-8rUU_sourcerVU$/compile/mock/docs/mocksignature.txtrWUgettext_compactrXˆU generatorrYNUdump_internalsrZNU pep_base_urlr[Uhttp://www.python.org/dev/peps/r\Uinput_encoding_error_handlerr]j:Uauto_id_prefixr^Uidr_Udoctitle_xformr`‰Ustrip_elements_with_classesraNU _config_filesrb]Ufile_insertion_enabledrcKU raw_enabledrdKU dump_settingsreNubUsymbol_footnote_startrfKUidsrg}rh(hj‚hj,hjlhhÜh#j³h hùh h'hjïh"j‚hj^h!j©uUsubstitution_namesri}rjh0h}q?(Udupnamesq@]qAUclassesqB]qCUbackrefsqD]qEUidsqF]qGh(aUnamesqH]qIhauUlineqJKUdocumentqKhh0]qL(cdocutils.nodes title qM)qN}qO(h5XPatch DecoratorsqPh6h3h7h:h}qR(h@]qShB]qThD]qUhF]qVhH]qWuhJKhKhh0]qXcdocutils.nodes Text qYXPatch DecoratorsqZ…q[}q\(h5hPh6hNubaubcdocutils.nodes comment q])q^}q_(h5X€class SomeClass(object): static_method = None class_method = None attribute = None sys.modules['package'] = package = Mock(name='package') sys.modules['package.module'] = package.module class TestCase(unittest2.TestCase): def run(self): result = unittest2.TestResult() super(unittest2.TestCase, self).run(result) assert result.wasSuccessful()q`h6h3h7h:h}qb(U testnodetypeqcX testsetupqdU xml:spaceqeUpreserveqfhF]qghD]qhh@]qihB]qjhH]qkUgroupsql]qmUdefaultqnaUoptionsqo}qpuhJKhKhh0]qqhYX€class SomeClass(object): static_method = None class_method = None attribute = None sys.modules['package'] = package = Mock(name='package') sys.modules['package.module'] = package.module class TestCase(unittest2.TestCase): def run(self): result = unittest2.TestResult() super(unittest2.TestCase, self).run(result) assert result.wasSuccessful()qr…qs}qt(h5Uh6h^ubaubh])qu}qv(h5Xpatch.TEST_PREFIX = 'test'qwh6h3h7h:h}qx(U testnodetypeqyX testcleanupqzhehfhF]q{hD]q|h@]q}hB]q~hH]qUgroupsq€]qhnaho}q‚uhJKhKhh0]qƒhYXpatch.TEST_PREFIX = 'test'q„…q…}q†(h5Uh6huubaubcdocutils.nodes paragraph q‡)qˆ}q‰(h5X The patch decorators are used for patching objects only within the scope of the function they decorate. They automatically handle the unpatching for you, even if exceptions are raised. All of these functions can also be used in with statements or as class decorators.qŠh6h3h7h:h}qŒ(h@]qhB]qŽhD]qhF]qhH]q‘uhJKhKhh0]q’hYX The patch decorators are used for patching objects only within the scope of the function they decorate. They automatically handle the unpatching for you, even if exceptions are raised. All of these functions can also be used in with statements or as class decorators.q“…q”}q•(h5hŠh6hˆubaubh2)q–}q—(h5UU referencedq˜Kh6h3h7h:h}q™(h@]qšhB]q›hD]qœhF]qh*ahH]qžhauhJK$hKhh0]qŸ(hM)q }q¡(h5Xpatchq¢h6h–h7h:h}q£(h@]q¤hB]q¥hD]q¦hF]q§hH]q¨uhJK$hKhh0]q©hYXpatchqª…q«}q¬(h5h¢h6h ubaubcdocutils.nodes note q­)q®}q¯(h5X{`patch` is straightforward to use. The key is to do the patching in the right namespace. See the section `where to patch`_.q°h6h–h7h:h}q²(h@]q³hB]q´hD]qµhF]q¶hH]q·uhJNhKhh0]q¸h‡)q¹}qº(h5X{`patch` is straightforward to use. The key is to do the patching in the right namespace. See the section `where to patch`_.q»h6h®h7h:h}q¼(h@]q½hB]q¾hD]q¿hF]qÀhH]qÁuhJK(h0]qÂ(cdocutils.nodes title_reference qÃ)qÄ}qÅ(h5X`patch`qÆh>}qÇ(h@]qÈhB]qÉhD]qÊhF]qËhH]qÌuh6h¹h0]qÍhYXpatchqÎ…qÏ}qÐ(h5Uh6hÄubah}qÜ(UnameqÝXwhere to patchqÞhF]qßhD]qàh@]qáhB]qâhH]qãUrefidqäh-uh0]qåhYXwhere to patchqæ…qç}qè(h5Uh6h×ubaubhYX.…qé}qê(h5X.h6h¹ubeubaubcsphinx.addnodes index që)qì}qí(h5Uh6h–h7h:h}qï(hF]qðhD]qñh@]qòhB]qóhH]qôUentriesqõ]qö(Usingleq÷Xpatch() (in module mock)hUtqøauhJNhKhh0]qùubcsphinx.addnodes desc qú)qû}qü(h5Uh6h–h7h:h}qþ(Unoindexqÿ‰UdomainrXpyrhF]rhD]rh@]rhB]rhH]rUobjtyperXfunctionrUdesctyper juhJNhKhh0]r (csphinx.addnodes desc_signature r )r }r (h5Xnpatch(target, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)rh6hûh7h:h}r(hF]rhaUmodulerXmockrhD]rh@]rhB]rhH]rhaUfullnamerXpatchrUclassrUUfirstr‰uhJKnhKhh0]r(csphinx.addnodes desc_name r)r}r(h5jh6j h7h:h}r!(h@]r"hB]r#hD]r$hF]r%hH]r&uhJKnhKhh0]r'hYXpatchr(…r)}r*(h5Uh6jubaubcsphinx.addnodes desc_parameterlist r+)r,}r-(h5Uh6j h7h:h}r/(h@]r0hB]r1hD]r2hF]r3hH]r4uhJKnhKhh0]r5(csphinx.addnodes desc_parameter r6)r7}r8(h5Xtargetr9h>}r:(h@]r;hB]r<hD]r=hF]r>hH]r?uh6j,h0]r@hYXtargetrA…rB}rC(h5Uh6j7ubah}rH(h@]rIhB]rJhD]rKhF]rLhH]rMuh6j,h0]rNhYX new=DEFAULTrO…rP}rQ(h5Uh6jEubah}rU(h@]rVhB]rWhD]rXhF]rYhH]rZuh6j,h0]r[hYX spec=Noner\…r]}r^(h5Uh6jRubah}rb(h@]rchB]rdhD]rehF]rfhH]rguh6j,h0]rhhYX create=Falseri…rj}rk(h5Uh6j_ubah}ro(h@]rphB]rqhD]rrhF]rshH]rtuh6j,h0]ruhYX spec_set=Nonerv…rw}rx(h5Uh6jlubah}r|(h@]r}hB]r~hD]rhF]r€hH]ruh6j,h0]r‚hYX autospec=Nonerƒ…r„}r…(h5Uh6jyubah}r‰(h@]rŠhB]r‹hD]rŒhF]rhH]rŽuh6j,h0]rhYXnew_callable=Noner…r‘}r’(h5Uh6j†ubah}r–(h@]r—hB]r˜hD]r™hF]ršhH]r›uh6j,h0]rœhYX**kwargsr…rž}rŸ(h5Uh6j“ubah}r¤(h@]r¥hB]r¦hD]r§hF]r¨hH]r©uhJKnhKhh0]rª(h‡)r«}r¬(h5Xç`patch` acts as a function decorator, class decorator or a context manager. Inside the body of the function or with statement, the `target` is patched with a `new` object. When the function/with statement exits the patch is undone.r­h6j¡h7h:h}r®(h@]r¯hB]r°hD]r±hF]r²hH]r³uhJK-hKhh0]r´(hÃ)rµ}r¶(h5X`patch`r·h>}r¸(h@]r¹hB]rºhD]r»hF]r¼hH]r½uh6j«h0]r¾hYXpatchr¿…rÀ}rÁ(h5Uh6jµubah}rÉ(h@]rÊhB]rËhD]rÌhF]rÍhH]rÎuh6j«h0]rÏhYXtargetrÐ…rÑ}rÒ(h5Uh6jÆubah}rÚ(h@]rÛhB]rÜhD]rÝhF]rÞhH]rßuh6j«h0]ràhYXnewrá…râ}rã(h5Uh6j×ubah}rë(h@]rìhB]ríhD]rîhF]rïhH]rðuhJK2hKhh0]rñ(hYXIf rò…ró}rô(h5XIf rõh6jèubhÃ)rö}r÷(h5X`new`røh>}rù(h@]rúhB]rûhD]rühF]rýhH]rþuh6jèh0]rÿhYXnewr…r}r(h5Uh6jöubah}r (Ureftyper XclassrUrefwarnr‰U reftargetrX MagicMockrU refdomainrXpyrhF]rhD]rU refexplicitr‰h@]rhB]rhH]rUrefdocrUpatchrUpy:classrNU py:modulerjuhJK2h0]rcdocutils.nodes literal r)r }r!(h5j h>}r"(h@]r#hB]r$(Uxrefr%jXpy-classr&ehD]r'hF]r(hH]r)uh6jh0]r*hYX MagicMockr+…r,}r-(h5Uh6j ubah}r6(h@]r7hB]r8hD]r9hF]r:hH]r;uh6jèh0]r<hYXpatchr=…r>}r?(h5Uh6j3ubah}rG(h@]rHhB]rIhD]rJhF]rKhH]rLuh6jèh0]rMhYXnewrN…rO}rP(h5Uh6jDubah}rX(h@]rYhB]rZhD]r[hF]r\hH]r]uh6jèh0]r^hYXpatchr_…r`}ra(h5Uh6jUubah}ri(h@]rjhB]rkhD]rlhF]rmhH]rnuhJK8hKhh0]ro(hÃ)rp}rq(h5X`target`rrh>}rs(h@]rthB]ruhD]rvhF]rwhH]rxuh6jfh0]ryhYXtargetrz…r{}r|(h5Uh6jpubah}r„(h@]r…hB]r†hD]r‡hF]rˆhH]r‰uh6jfh0]rŠhYX'package.module.ClassName'r‹…rŒ}r(h5Uh6jubah}r•(h@]r–hB]r—hD]r˜hF]r™hH]ršuh6jfh0]r›hYXtargetrœ…r}rž(h5Uh6j’ubah}r¦(h@]r§hB]r¨hD]r©hF]rªhH]r«uh6jfh0]r¬hYXnewr­…r®}r¯(h5Uh6j£ubah}r·(h@]r¸hB]r¹hD]rºhF]r»hH]r¼uh6jfh0]r½hYXtargetr¾…r¿}rÀ(h5Uh6j´ubah}rÈ(h@]rÉhB]rÊhD]rËhF]rÌhH]rÍuh6jfh0]rÎhYXpatchrÏ…rÐ}rÑ(h5Uh6jÅubah}rÙ(h@]rÚhB]rÛhD]rÜhF]rÝhH]rÞuhJK>hKhh0]rß(hYXThe rà…rá}râ(h5XThe rãh6jÖubhÃ)rä}rå(h5X`spec`ræh>}rç(h@]rèhB]réhD]rêhF]rëhH]rìuh6jÖh0]ríhYXspecrî…rï}rð(h5Uh6jäubah}rø(h@]rùhB]rúhD]rûhF]rühH]rýuh6jÖh0]rþhYXspec_setrÿ…r}r(h5Uh6jõubah}r (h@]r hB]r hD]r hF]r hH]ruh6jÖh0]rhYX MagicMockr…r}r(h5Uh6jubah}r(h@]rhB]rhD]rhF]rhH]ruhJKAhKhh0]r (hYXIn addition you can pass r!…r"}r#(h5XIn addition you can pass r$h6jubhÃ)r%}r&(h5X `spec=True`r'h>}r((h@]r)hB]r*hD]r+hF]r,hH]r-uh6jh0]r.hYX spec=Truer/…r0}r1(h5Uh6j%ubah}r9(h@]r:hB]r;hD]r<hF]r=hH]r>uh6jh0]r?hYX spec_set=Truer@…rA}rB(h5Uh6j6ubah}rJ(h@]rKhB]rLhD]rMhF]rNhH]rOuhJKDhKhh0]rP(hÃ)rQ}rR(h5X`new_callable`rSh>}rT(h@]rUhB]rVhD]rWhF]rXhH]rYuh6jGh0]rZhYX new_callabler[…r\}r](h5Uh6jQubah}re(h@]rfhB]rghD]rhhF]rihH]rjuh6jGh0]rkhYXnewrl…rm}rn(h5Uh6jbubah}rv(h@]rwhB]rxhD]ryhF]rzhH]r{uh6jGh0]r|hYX MagicMockr}…r~}r(h5Uh6jsubah}r‡(h@]rˆhB]r‰hD]rŠhF]r‹hH]rŒuhJKHhKhh0]r(hYXA more powerful form of rŽ…r}r(h5XA more powerful form of r‘h6j„ubhÃ)r’}r“(h5X`spec`r”h>}r•(h@]r–hB]r—hD]r˜hF]r™hH]ršuh6j„h0]r›hYXspecrœ…r}rž(h5Uh6j’ubah}r¦(h@]r§hB]r¨hD]r©hF]rªhH]r«uh6j„h0]r¬hYXautospecr­…r®}r¯(h5Uh6j£ubah}r·(h@]r¸hB]r¹hD]rºhF]r»hH]r¼uh6j„h0]r½hYX autospec=Truer¾…r¿}rÀ(h5Uh6j´ubah}rÈ(h@]rÉhB]rÊhD]rËhF]rÌhH]rÍuh6j„h0]rÎhYX TypeErrorrÏ…rÐ}rÑ(h5Uh6jÅubah}rÙ(UreftyperÚXfuncrÛj‰jXcreate_autospecrÜU refdomainrÝXpyrÞhF]rßhD]ràU refexplicitrá‰h@]râhB]rãhH]räjjjNjjuhJKHh0]råj)ræ}rç(h5jØh>}rè(h@]réhB]rê(j%jÞXpy-funcrëehD]rìhF]ríhH]rîuh6jÖh0]rïhYXcreate_autospec()rð…rñ}rò(h5Uh6jæubah}rú(UreftyperûXrefrüjˆjX auto-speccingrýU refdomainrþXstdrÿhF]rhD]rU refexplicitr‰h@]rhB]rhH]rjjuhJKHh0]rcdocutils.nodes emphasis r)r}r (h5jùh>}r (h@]r hB]r (j%jÿXstd-refr ehD]rhF]rhH]ruh6j÷h0]rhYX auto-speccingr…r}r(h5Uh6jubah}r(h@]rhB]rhD]rhF]rhH]r uhJKRhKhh0]r!(hYX Instead of r"…r#}r$(h5X Instead of r%h6jubhÃ)r&}r'(h5X`autospec=True`r(h>}r)(h@]r*hB]r+hD]r,hF]r-hH]r.uh6jh0]r/hYX autospec=Truer0…r1}r2(h5Uh6j&ubah}r:(h@]r;hB]r<hD]r=hF]r>hH]r?uh6jh0]r@hYXautospec=some_objectrA…rB}rC(h5Uh6j7ubah}rK(h@]rLhB]rMhD]rNhF]rOhH]rPuhJKUhKhh0]rQ(hYX By default rR…rS}rT(h5X By default rUh6jHubhÃ)rV}rW(h5X`patch`rXh>}rY(h@]rZhB]r[hD]r\hF]r]hH]r^uh6jHh0]r_hYXpatchr`…ra}rb(h5Uh6jVubah}rj(h@]rkhB]rlhD]rmhF]rnhH]rouh6jHh0]rphYX create=Truerq…rr}rs(h5Uh6jgubah}r{(h@]r|hB]r}hD]r~hF]rhH]r€uhJK]hKhh0]r(hYXPatch can be used as a r‚…rƒ}r„(h5XPatch can be used as a r…h6jxubhÃ)r†}r‡(h5X `TestCase`rˆh>}r‰(h@]rŠhB]r‹hD]rŒhF]rhH]rŽuh6jxh0]rhYXTestCaser…r‘}r’(h5Uh6j†ubah}rš(h@]r›hB]rœhD]rhF]ržhH]rŸuh6jxh0]r hYXpatchr¡…r¢}r£(h5Uh6j—ubah}r«(h@]r¬hB]r­hD]r®hF]r¯hH]r°uh6jxh0]r±hYXpatch.TEST_PREFIXr²…r³}r´(h5Uh6j¨ubah}r¼(h@]r½hB]r¾hD]r¿hF]rÀhH]rÁuh6jxh0]rÂhYXtestrÃ…rÄ}rÅ(h5Uh6j¹ubah}rÍ(h@]rÎhB]rÏhD]rÐhF]rÑhH]rÒuh6jxh0]rÓhYXunittestrÔ…rÕ}rÖ(h5Uh6jÊubah}rÞ(h@]rßhB]ràhD]ráhF]râhH]rãuh6jxh0]rähYXpatch.TEST_PREFIXrå…ræ}rç(h5Uh6jÛubah}rí(h@]rîhB]rïhD]rðhF]rñhH]ròuhJKdhKhh0]ró(hYXìPatch can be used as a context manager, with the with statement. Here the patching applies to the indented block after the with statement. If you use "as" then the patched object will be bound to the name after the "as"; very useful if rô…rõ}rö(h5XìPatch can be used as a context manager, with the with statement. Here the patching applies to the indented block after the with statement. If you use "as" then the patched object will be bound to the name after the "as"; very useful if r÷h6jêubhÃ)rø}rù(h5X`patch`rúh>}rû(h@]rühB]rýhD]rþhF]rÿhH]ruh6jêh0]rhYXpatchr…r}r(h5Uh6jøubah}r (h@]r hB]rhD]rhF]rhH]ruhJKihKhh0]r(hÃ)r}r(h5X`patch`rh>}r(h@]rhB]rhD]rhF]rhH]ruh6j h0]rhYXpatchr…r}r(h5Uh6jubah}r'(h@]r(hB]r)hD]r*hF]r+hH]r,uh6j h0]r-hYXMockr.…r/}r0(h5Uh6j$ubah}r8(h@]r9hB]r:hD]r;hF]r<hH]r=uh6j h0]r>hYX new_callabler?…r@}rA(h5Uh6j5ubah}rI(h@]rJhB]rKhD]rLhF]rMhH]rNuhJKlhKhh0]rO(hÃ)rP}rQ(h5X`patch.dict(...)`rRh>}rS(h@]rThB]rUhD]rVhF]rWhH]rXuh6jFh0]rYhYXpatch.dict(...)rZ…r[}r\(h5Uh6jPubah}rd(h@]rehB]rfhD]rghF]rhhH]riuh6jFh0]rjhYXpatch.multiple(...)rk…rl}rm(h5Uh6jaubah}ru(h@]rvhB]rwhD]rxhF]ryhH]rzuh6jFh0]r{hYXpatch.object(...)r|…r}}r~(h5Uh6jrubah}r†(h@]r‡hB]rˆhD]r‰hF]rŠhH]r‹uhJKohKhh0]rŒ(hÃ)r}rŽ(h5X`patch`rh>}r(h@]r‘hB]r’hD]r“hF]r”hH]r•uh6jƒh0]r–hYXpatchr—…r˜}r™(h5Uh6jubah>> @patch('__main__.SomeClass') ... def function(normal_argument, mock_class): ... print mock_class is SomeClass ... >>> function(None) Truer¡h6h–h7h:h}r£(U testnodetyper¤Xdoctestr¥hehfhF]r¦hD]r§h@]r¨hB]r©hH]rªUgroupsr«]r¬hnaho}r­uhJKrhKhh0]r®hYX‘>>> @patch('__main__.SomeClass') ... def function(normal_argument, mock_class): ... print mock_class is SomeClass ... >>> function(None) Truer¯…r°}r±(h5Uh6jŸubaubh‡)r²}r³(h5XÄPatching a class replaces the class with a `MagicMock` *instance*. If the class is instantiated in the code under test then it will be the :attr:`~Mock.return_value` of the mock that will be used.r´h6h–h7h:h}rµ(h@]r¶hB]r·hD]r¸hF]r¹hH]rºuhJK|hKhh0]r»(hYX+Patching a class replaces the class with a r¼…r½}r¾(h5X+Patching a class replaces the class with a r¿h6j²ubhÃ)rÀ}rÁ(h5X `MagicMock`rÂh>}rÃ(h@]rÄhB]rÅhD]rÆhF]rÇhH]rÈuh6j²h0]rÉhYX MagicMockrÊ…rË}rÌ(h5Uh6jÀubah}rÒ(h@]rÓhB]rÔhD]rÕhF]rÖhH]r×uh6j²h0]rØhYXinstancerÙ…rÚ}rÛ(h5Uh6jÏubah}rã(UreftyperäXattrråj‰jXMock.return_valueræU refdomainrçXpyrèhF]réhD]rêU refexplicitrë‰h@]rìhB]ríhH]rîjjjNjjuhJK|h0]rïj)rð}rñ(h5jâh>}rò(h@]róhB]rô(j%jèXpy-attrrõehD]röhF]r÷hH]røuh6jàh0]rùhYX return_valuerú…rû}rü(h5Uh6jðubah}r(h@]rhB]rhD]rhF]rhH]r uhJK€hKhh0]r (hYX:If the class is instantiated multiple times you could use r …r }r (h5X:If the class is instantiated multiple times you could use rh6jubj)r}r(h5X:attr:`~Mock.side_effect`rh6jh7h:h}r(UreftyperXattrrj‰jXMock.side_effectrU refdomainrXpyrhF]rhD]rU refexplicitr‰h@]rhB]rhH]rjjjNjjuhJK€h0]rj)r}r (h5jh>}r!(h@]r"hB]r#(j%jXpy-attrr$ehD]r%hF]r&hH]r'uh6jh0]r(hYX side_effectr)…r*}r+(h5Uh6jubah}r3(h@]r4hB]r5hD]r6hF]r7hH]r8uh6jh0]r9hYX return_valuer:…r;}r<(h5Uh6j0ubah}r?(h5X to be anything you want.r@h6jubeubh‡)rA}rB(h5X~To configure return values on methods of *instances* on the patched class you must do this on the `return_value`. For example:rCh6h–h7h:h}rD(h@]rEhB]rFhD]rGhF]rHhH]rIuhJK„hKhh0]rJ(hYX)To configure return values on methods of rK…rL}rM(h5X)To configure return values on methods of rNh6jAubj)rO}rP(h5X *instances*rQh>}rR(h@]rShB]rThD]rUhF]rVhH]rWuh6jAh0]rXhYX instancesrY…rZ}r[(h5Uh6jOubah}rc(h@]rdhB]rehD]rfhF]rghH]rhuh6jAh0]rihYX return_valuerj…rk}rl(h5Uh6j`ubah>> class Class(object): ... def method(self): ... pass ... >>> with patch('__main__.Class') as MockClass: ... instance = MockClass.return_value ... instance.method.return_value = 'foo' ... assert Class() is instance ... assert Class().method() == 'foo' ...rsh6h–h7h:h}rt(U testnodetyperuXdoctestrvhehfhF]rwhD]rxh@]ryhB]rzhH]r{Ugroupsr|]r}hnaho}r~uhJK‡hKhh0]rhYX>>> class Class(object): ... def method(self): ... pass ... >>> with patch('__main__.Class') as MockClass: ... instance = MockClass.return_value ... instance.method.return_value = 'foo' ... assert Class() is instance ... assert Class().method() == 'foo' ...r€…r}r‚(h5Uh6jqubaubh‡)rƒ}r„(h5X†If you use `spec` or `spec_set` and `patch` is replacing a *class*, then the return value of the created mock will have the same spec.r…h6h–h7h:h}r†(h@]r‡hB]rˆhD]r‰hF]rŠhH]r‹uhJK”hKhh0]rŒ(hYX If you use r…rŽ}r(h5X If you use rh6jƒubhÃ)r‘}r’(h5X`spec`r“h>}r”(h@]r•hB]r–hD]r—hF]r˜hH]r™uh6jƒh0]ršhYXspecr›…rœ}r(h5Uh6j‘ubah}r¥(h@]r¦hB]r§hD]r¨hF]r©hH]rªuh6jƒh0]r«hYXspec_setr¬…r­}r®(h5Uh6j¢ubah}r¶(h@]r·hB]r¸hD]r¹hF]rºhH]r»uh6jƒh0]r¼hYXpatchr½…r¾}r¿(h5Uh6j³ubah}rÇ(h@]rÈhB]rÉhD]rÊhF]rËhH]rÌuh6jƒh0]rÍhYXclassrÎ…rÏ}rÐ(h5Uh6jÄubah>> Original = Class >>> patcher = patch('__main__.Class', spec=True) >>> MockClass = patcher.start() >>> instance = MockClass() >>> assert isinstance(instance, Original) >>> patcher.stop()r×h6h–h7h:h}rØ(U testnodetyperÙXdoctestrÚhehfhF]rÛhD]rÜh@]rÝhB]rÞhH]rßUgroupsrà]ráhnaho}râuhJK—hKhh0]rãhYX½>>> Original = Class >>> patcher = patch('__main__.Class', spec=True) >>> MockClass = patcher.start() >>> instance = MockClass() >>> assert isinstance(instance, Original) >>> patcher.stop()rä…rå}ræ(h5Uh6jÕubaubh‡)rç}rè(h5XÊThe `new_callable` argument is useful where you want to use an alternative class to the default :class:`MagicMock` for the created mock. For example, if you wanted a :class:`NonCallableMock` to be used:réh6h–h7h:h}rê(h@]rëhB]rìhD]ríhF]rîhH]rïuhJK hKhh0]rð(hYXThe rñ…rò}ró(h5XThe rôh6jçubhÃ)rõ}rö(h5X`new_callable`r÷h>}rø(h@]rùhB]rúhD]rûhF]rühH]rýuh6jçh0]rþhYX new_callablerÿ…r}r(h5Uh6jõubah}r (Ureftyper Xclassr j‰jX MagicMockr U refdomainr XpyrhF]rhD]rU refexplicitr‰h@]rhB]rhH]rjjjNjjuhJK h0]rj)r}r(h5jh>}r(h@]rhB]r(j%jXpy-classrehD]rhF]rhH]ruh6jh0]rhYX MagicMockr …r!}r"(h5Uh6jubah}r*(Ureftyper+Xclassr,j‰jXNonCallableMockr-U refdomainr.Xpyr/hF]r0hD]r1U refexplicitr2‰h@]r3hB]r4hH]r5jjjNjjuhJK h0]r6j)r7}r8(h5j)h>}r9(h@]r:hB]r;(j%j/Xpy-classr<ehD]r=hF]r>hH]r?uh6j'h0]r@hYXNonCallableMockrA…rB}rC(h5Uh6j7ubah>> thing = object() >>> with patch('__main__.thing', new_callable=NonCallableMock) as mock_thing: ... assert thing is mock_thing ... thing() ... Traceback (most recent call last): ... TypeError: 'NonCallableMock' object is not callablerJh6h–h7h:h}rK(U testnodetyperLXdoctestrMhehfhF]rNhD]rOh@]rPhB]rQhH]rRUgroupsrS]rThnaho}rUuhJK¤hKhh0]rVhYXö>>> thing = object() >>> with patch('__main__.thing', new_callable=NonCallableMock) as mock_thing: ... assert thing is mock_thing ... thing() ... Traceback (most recent call last): ... TypeError: 'NonCallableMock' object is not callablerW…rX}rY(h5Uh6jHubaubh‡)rZ}r[(h5XJAnother use case might be to replace an object with a `StringIO` instance:r\h6h–h7h:h}r](h@]r^hB]r_hD]r`hF]rahH]rbuhJK¯hKhh0]rc(hYX6Another use case might be to replace an object with a rd…re}rf(h5X6Another use case might be to replace an object with a rgh6jZubhÃ)rh}ri(h5X `StringIO`rjh>}rk(h@]rlhB]rmhD]rnhF]rohH]rpuh6jZh0]rqhYXStringIOrr…rs}rt(h5Uh6jhubah>> from StringIO import StringIO >>> def foo(): ... print 'Something' ... >>> @patch('sys.stdout', new_callable=StringIO) ... def test(mock_stdout): ... foo() ... assert mock_stdout.getvalue() == 'Something\n' ... >>> test()r{h6h–h7h:h}r|(U testnodetyper}Xdoctestr~hehfhF]rhD]r€h@]rhB]r‚hH]rƒUgroupsr„]r…hnaho}r†uhJK±hKhh0]r‡hYXí>>> from StringIO import StringIO >>> def foo(): ... print 'Something' ... >>> @patch('sys.stdout', new_callable=StringIO) ... def test(mock_stdout): ... foo() ... assert mock_stdout.getvalue() == 'Something\n' ... >>> test()rˆ…r‰}rŠ(h5Uh6jyubaubh‡)r‹}rŒ(h5XWhen `patch` is creating a mock for you, it is common that the first thing you need to do is to configure the mock. Some of that configuration can be done in the call to patch. Any arbitrary keywords you pass into the call will be used to set attributes on the created mock:rh6h–h7h:h}rŽ(h@]rhB]rhD]r‘hF]r’hH]r“uhJK¾hKhh0]r”(hYXWhen r•…r–}r—(h5XWhen r˜h6j‹ubhÃ)r™}rš(h5X`patch`r›h>}rœ(h@]rhB]ržhD]rŸhF]r hH]r¡uh6j‹h0]r¢hYXpatchr£…r¤}r¥(h5Uh6j™ubah>> patcher = patch('__main__.thing', first='one', second='two') >>> mock_thing = patcher.start() >>> mock_thing.first 'one' >>> mock_thing.second 'two'r¬h6h–h7h:h}r­(U testnodetyper®Xdoctestr¯hehfhF]r°hD]r±h@]r²hB]r³hH]r´Ugroupsrµ]r¶hnaho}r·uhJKÃhKhh0]r¸hYX˜>>> patcher = patch('__main__.thing', first='one', second='two') >>> mock_thing = patcher.start() >>> mock_thing.first 'one' >>> mock_thing.second 'two'r¹…rº}r»(h5Uh6jªubaubh‡)r¼}r½(h5XDAs well as attributes on the created mock attributes, like the :attr:`~Mock.return_value` and :attr:`~Mock.side_effect`, of child mocks can also be configured. These aren't syntactically valid to pass in directly as keyword arguments, but a dictionary with these as keys can still be expanded into a `patch` call using `**`:r¾h6h–h7h:h}r¿(h@]rÀhB]rÁhD]rÂhF]rÃhH]rÄuhJKÌhKhh0]rÅ(hYX?As well as attributes on the created mock attributes, like the rÆ…rÇ}rÈ(h5X?As well as attributes on the created mock attributes, like the rÉh6j¼ubj)rÊ}rË(h5X:attr:`~Mock.return_value`rÌh6j¼h7h:h}rÍ(UreftyperÎXattrrÏj‰jXMock.return_valuerÐU refdomainrÑXpyrÒhF]rÓhD]rÔU refexplicitrÕ‰h@]rÖhB]r×hH]rØjjjNjjuhJKÌh0]rÙj)rÚ}rÛ(h5jÌh>}rÜ(h@]rÝhB]rÞ(j%jÒXpy-attrrßehD]ràhF]ráhH]râuh6jÊh0]rãhYX return_valuerä…rå}ræ(h5Uh6jÚubah}rî(UreftyperïXattrrðj‰jXMock.side_effectrñU refdomainròXpyróhF]rôhD]rõU refexplicitrö‰h@]r÷hB]røhH]rùjjjNjjuhJKÌh0]rúj)rû}rü(h5jíh>}rý(h@]rþhB]rÿ(j%jóXpy-attrrehD]rhF]rhH]ruh6jëh0]rhYX side_effectr…r}r(h5Uh6jûubah}r(h@]rhB]rhD]rhF]rhH]ruh6j¼h0]rhYXpatchr…r}r(h5Uh6j ubah}r (h@]r!hB]r"hD]r#hF]r$hH]r%uh6j¼h0]r&hYX**r'…r(}r)(h5Uh6jubah>> config = {'method.return_value': 3, 'other.side_effect': KeyError} >>> patcher = patch('__main__.thing', **config) >>> mock_thing = patcher.start() >>> mock_thing.method() 3 >>> mock_thing.other() Traceback (most recent call last): ... KeyErrorr.h6h–h7h:h}r/(U testnodetyper0Xdoctestr1hehfhF]r2hD]r3h@]r4hB]r5hH]r6Ugroupsr7]r8hnaho}r9uhJKÒhKhh0]r:hYXú>>> config = {'method.return_value': 3, 'other.side_effect': KeyError} >>> patcher = patch('__main__.thing', **config) >>> mock_thing = patcher.start() >>> mock_thing.method() 3 >>> mock_thing.other() Traceback (most recent call last): ... KeyErrorr;…r<}r=(h5Uh6j,ubaubeubh2)r>}r?(h5Uh˜Kh6h3h7h:h}r@(h@]rAhB]rBhD]rChF]rDh+ahH]rEhauhJKàhKhh0]rF(hM)rG}rH(h5X patch.objectrIh6j>h7h:h}rJ(h@]rKhB]rLhD]rMhF]rNhH]rOuhJKàhKhh0]rPhYX patch.objectrQ…rR}rS(h5jIh6jGubaubhë)rT}rU(h5Uh6j>h7h:h}rV(hF]rWhD]rXh@]rYhB]rZhH]r[Uentriesr\]r](h÷Xpatch.object() (in module mock)h Utr^auhJNhKhh0]r_ubhú)r`}ra(h5Uh6j>h7h:h}rb(hÿ‰jXpyrchF]rdhD]reh@]rfhB]rghH]rhjXfunctionrij jiuhJNhKhh0]rj(j )rk}rl(h5X€patch.object(target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)rmh6j`h7h:h}rn(hF]roh ajjhD]rph@]rqhB]rrhH]rsh ajX patch.objectrtjXpatchruj‰uhJKïhKhh0]rv(csphinx.addnodes desc_addname rw)rx}ry(h5Xpatch.rzh6jkh7h:h}r|(h@]r}hB]r~hD]rhF]r€hH]ruhJKïhKhh0]r‚hYXpatch.rƒ…r„}r…(h5Uh6jxubaubj)r†}r‡(h5Xobjectrˆh6jkh7h:h}r‰(h@]rŠhB]r‹hD]rŒhF]rhH]rŽuhJKïhKhh0]rhYXobjectr…r‘}r’(h5Uh6j†ubaubj+)r“}r”(h5Uh6jkh7h:h}r•(h@]r–hB]r—hD]r˜hF]r™hH]ršuhJKïhKhh0]r›(j6)rœ}r(h5Xtargetržh>}rŸ(h@]r hB]r¡hD]r¢hF]r£hH]r¤uh6j“h0]r¥hYXtargetr¦…r§}r¨(h5Uh6jœubah}r¬(h@]r­hB]r®hD]r¯hF]r°hH]r±uh6j“h0]r²hYX attributer³…r´}rµ(h5Uh6j©ubah}r¹(h@]rºhB]r»hD]r¼hF]r½hH]r¾uh6j“h0]r¿hYX new=DEFAULTrÀ…rÁ}rÂ(h5Uh6j¶ubah}rÆ(h@]rÇhB]rÈhD]rÉhF]rÊhH]rËuh6j“h0]rÌhYX spec=NonerÍ…rÎ}rÏ(h5Uh6jÃubah}rÓ(h@]rÔhB]rÕhD]rÖhF]r×hH]rØuh6j“h0]rÙhYX create=FalserÚ…rÛ}rÜ(h5Uh6jÐubah}rà(h@]ráhB]râhD]rãhF]rähH]råuh6j“h0]ræhYX spec_set=Nonerç…rè}ré(h5Uh6jÝubah}rí(h@]rîhB]rïhD]rðhF]rñhH]ròuh6j“h0]róhYX autospec=Nonerô…rõ}rö(h5Uh6jêubah}rú(h@]rûhB]rühD]rýhF]rþhH]rÿuh6j“h0]r hYXnew_callable=Noner …r }r (h5Uh6j÷ubah}r (h@]r hB]r hD]r hF]r hH]r uh6j“h0]r hYX**kwargsr …r }r (h5Uh6j ubah}r (h@]r hB]r hD]r hF]r hH]r uhJKïhKhh0]r (h‡)r }r (h5XPpatch the named member (`attribute`) on an object (`target`) with a mock object.r h6j h7h:h}r (h@]r hB]r hD]r hF]r! hH]r" uhJKähKhh0]r# (hYXpatch the named member (r$ …r% }r& (h5Xpatch the named member (r' h6j ubhÃ)r( }r) (h5X `attribute`r* h>}r+ (h@]r, hB]r- hD]r. hF]r/ hH]r0 uh6j h0]r1 hYX attributer2 …r3 }r4 (h5Uh6j( ubah}r< (h@]r= hB]r> hD]r? hF]r@ hH]rA uh6j h0]rB hYXtargetrC …rD }rE (h5Uh6j9 ubah}rM (h@]rN hB]rO hD]rP hF]rQ hH]rR uhJKçhKhh0]rS (hÃ)rT }rU (h5X`patch.object`rV h>}rW (h@]rX hB]rY hD]rZ hF]r[ hH]r\ uh6jJ h0]r] hYX patch.objectr^ …r_ }r` (h5Uh6jT ubah}rh (h@]ri hB]rj hD]rk hF]rl hH]rm uh6jJ h0]rn hYXnewro …rp }rq (h5Uh6je ubah}ry (h@]rz hB]r{ hD]r| hF]r} hH]r~ uh6jJ h0]r hYXspecr€ …r }r‚ (h5Uh6jv ubah}rŠ (h@]r‹ hB]rŒ hD]r hF]rŽ hH]r uh6jJ h0]r hYXcreater‘ …r’ }r“ (h5Uh6j‡ ubah}r› (h@]rœ hB]r hD]rž hF]rŸ hH]r  uh6jJ h0]r¡ hYXspec_setr¢ …r£ }r¤ (h5Uh6j˜ ubah}r¬ (h@]r­ hB]r® hD]r¯ hF]r° hH]r± uh6jJ h0]r² hYXautospecr³ …r´ }rµ (h5Uh6j© ubah}r½ (h@]r¾ hB]r¿ hD]rÀ hF]rÁ hH]r uh6jJ h0]rà hYX new_callablerÄ …rÅ }rÆ (h5Uh6jº ubah}rÎ (h@]rÏ hB]rÐ hD]rÑ hF]rÒ hH]rÓ uh6jJ h0]rÔ hYXpatchrÕ …rÖ }r× (h5Uh6jË ubah}rß (h@]rà hB]rá hD]râ hF]rã hH]rä uh6jJ h0]rå hYXpatchræ …rç }rè (h5Uh6jÜ ubah}rð (h@]rñ hB]rò hD]ró hF]rô hH]rõ uh6jJ h0]rö hYX patch.objectr÷ …rø }rù (h5Uh6jí ubah}r (h@]r hB]r hD]r hF]r hH]r uhJKíhKhh0]r (hYXWhen used as a class decorator r …r }r (h5XWhen used as a class decorator r h6jþ ubhÃ)r }r (h5X`patch.object`r h>}r (h@]r hB]r hD]r hF]r hH]r uh6jþ h0]r hYX patch.objectr …r }r (h5Uh6j ubah}r (h@]r! hB]r" hD]r# hF]r$ hH]r% uh6jþ h0]r& hYXpatch.TEST_PREFIXr' …r( }r) (h5Uh6j ubahh7h:h}r1 (h@]r2 hB]r3 hD]r4 hF]r5 hH]r6 uhJKðhKhh0]r7 (hYXYou can either call r8 …r9 }r: (h5XYou can either call r; h6j. ubhÃ)r< }r= (h5X`patch.object`r> h>}r? (h@]r@ hB]rA hD]rB hF]rC hH]rD uh6j. h0]rE hYX patch.objectrF …rG }rH (h5Uh6j< ubahh7h:h}rP (h@]rQ hB]rR hD]rS hF]rT hH]rU uhJKôhKhh0]rV hYX¤When calling with the two argument form you omit the replacement object, and a mock is created for you and passed in as an extra argument to the decorated function:rW …rX }rY (h5jO h6jM ubaubjž)rZ }r[ (h5X¢>>> @patch.object(SomeClass, 'class_method') ... def test(mock_method): ... SomeClass.class_method(3) ... mock_method.assert_called_with(3) ... >>> test()r\ h6j>h7h:h}r] (U testnodetyper^ Xdoctestr_ hehfhF]r` hD]ra h@]rb hB]rc hH]rd Ugroupsre ]rf hnaho}rg uhJKøhKhh0]rh hYX¢>>> @patch.object(SomeClass, 'class_method') ... def test(mock_method): ... SomeClass.class_method(3) ... mock_method.assert_called_with(3) ... >>> test()ri …rj }rk (h5Uh6jZ ubaubh‡)rl }rm (h5Xh`spec`, `create` and the other arguments to `patch.object` have the same meaning as they do for `patch`.rn h6j>h7h:h}ro (h@]rp hB]rq hD]rr hF]rs hH]rt uhJMhKhh0]ru (hÃ)rv }rw (h5X`spec`rx h>}ry (h@]rz hB]r{ hD]r| hF]r} hH]r~ uh6jl h0]r hYXspecr€ …r }r‚ (h5Uh6jv ubah}rŠ (h@]r‹ hB]rŒ hD]r hF]rŽ hH]r uh6jl h0]r hYXcreater‘ …r’ }r“ (h5Uh6j‡ ubah}r› (h@]rœ hB]r hD]rž hF]rŸ hH]r  uh6jl h0]r¡ hYX patch.objectr¢ …r£ }r¤ (h5Uh6j˜ ubah}r¬ (h@]r­ hB]r® hD]r¯ hF]r° hH]r± uh6jl h0]r² hYXpatchr³ …r´ }rµ (h5Uh6j© ubah}rº (h@]r» hB]r¼ hD]r½ hF]r¾ h&ahH]r¿ hauhJMhKhh0]rÀ (hM)rÁ }r (h5X patch.dictrà h6j¸ h7h:h}rÄ (h@]rÅ hB]rÆ hD]rÇ hF]rÈ hH]rÉ uhJMhKhh0]rÊ hYX patch.dictrË …rÌ }rÍ (h5jà h6jÁ ubaubhë)rÎ }rÏ (h5Uh6j¸ h7h:h}rÐ (hF]rÑ hD]rÒ h@]rÓ hB]rÔ hH]rÕ UentriesrÖ ]r× (h÷Xpatch.dict() (in module mock)hUtrØ auhJNhKhh0]rÙ ubhú)rÚ }rÛ (h5Uh6j¸ h7h:h}rÜ (hÿ‰jXpyrÝ hF]rÞ hD]rß h@]rà hB]rá hH]râ jXfunctionrã j jã uhJNhKhh0]rä (j )rå }ræ (h5X5patch.dict(in_dict, values=(), clear=False, **kwargs)rç h6jÚ h7h:h}rè (hF]ré hajjhD]rê h@]rë hB]rì hH]rí hajX patch.dictrî jXpatchrï j‰uhJM hKhh0]rð (jw)rñ }rò (h5Xpatch.ró h6jå h7h:h}rô (h@]rõ hB]rö hD]r÷ hF]rø hH]rù uhJM hKhh0]rú hYXpatch.rû …rü }rý (h5Uh6jñ ubaubj)rþ }rÿ (h5Xdictr h6jå h7h:h}r (h@]r hB]r hD]r hF]r hH]r uhJM hKhh0]r hYXdictr …r }r (h5Uh6jþ ubaubj+)r }r (h5Uh6jå h7h:h}r (h@]r hB]r hD]r hF]r hH]r uhJM hKhh0]r (j6)r }r (h5Xin_dictr h>}r (h@]r hB]r hD]r hF]r hH]r uh6j h0]r hYXin_dictr …r }r (h5Uh6j ubah}r$ (h@]r% hB]r& hD]r' hF]r( hH]r) uh6j h0]r* hYX values=()r+ …r, }r- (h5Uh6j! ubah}r1 (h@]r2 hB]r3 hD]r4 hF]r5 hH]r6 uh6j h0]r7 hYX clear=Falser8 …r9 }r: (h5Uh6j. ubah}r> (h@]r? hB]r@ hD]rA hF]rB hH]rC uh6j h0]rD hYX**kwargsrE …rF }rG (h5Uh6j; ubah}rJ (h@]rK hB]rL hD]rM hF]rN hH]rO uhJM hKhh0]rP (h‡)rQ }rR (h5XoPatch a dictionary, or dictionary like object, and restore the dictionary to its original state after the test.rS h6jH h7h:h}rT (h@]rU hB]rV hD]rW hF]rX hH]rY uhJM hKhh0]rZ hYXoPatch a dictionary, or dictionary like object, and restore the dictionary to its original state after the test.r[ …r\ }r] (h5jS h6jQ ubaubh‡)r^ }r_ (h5X©`in_dict` can be a dictionary or a mapping like container. If it is a mapping then it must at least support getting, setting and deleting items plus iterating over keys.r` h6jH h7h:h}ra (h@]rb hB]rc hD]rd hF]re hH]rf uhJM hKhh0]rg (hÃ)rh }ri (h5X `in_dict`rj h>}rk (h@]rl hB]rm hD]rn hF]ro hH]rp uh6j^ h0]rq hYXin_dictrr …rs }rt (h5Uh6jh ubah}r| (h@]r} hB]r~ hD]r hF]r€ hH]r uhJMhKhh0]r‚ (hÃ)rƒ }r„ (h5X `in_dict`r… h>}r† (h@]r‡ hB]rˆ hD]r‰ hF]rŠ hH]r‹ uh6jy h0]rŒ hYXin_dictr …rŽ }r (h5Uh6jƒ ubah}r— (h@]r˜ hB]r™ hD]rš hF]r› hH]rœ uhJMhKhh0]r (hÃ)rž }rŸ (h5X`values`r  h>}r¡ (h@]r¢ hB]r£ hD]r¤ hF]r¥ hH]r¦ uh6j” h0]r§ hYXvaluesr¨ …r© }rª (h5Uh6jž ubah}r² (h@]r³ hB]r´ hD]rµ hF]r¶ hH]r· uh6j” h0]r¸ hYXvaluesr¹ …rº }r» (h5Uh6j¯ ubah}rà (h@]rÄ hB]rÅ hD]rÆ hF]rÇ hH]rÈ uh6j” h0]rÉ hYX (key, value)rÊ …rË }rÌ (h5Uh6jÀ ubah}rÔ (h@]rÕ hB]rÖ hD]r× hF]rØ hH]rÙ uhJMhKhh0]rÚ (hYXIf rÛ …rÜ }rÝ (h5XIf rÞ h6jÑ ubhÃ)rß }rà (h5X`clear`rá h>}râ (h@]rã hB]rä hD]rå hF]ræ hH]rç uh6jÑ h0]rè hYXclearré …rê }rë (h5Uh6jß ubah}ró (h@]rô hB]rõ hD]rö hF]r÷ hH]rø uhJMhKhh0]rù (hÃ)rú }rû (h5X `patch.dict`rü h>}rý (h@]rþ hB]rÿ hD]r hF]r hH]r uh6jð h0]r hYX patch.dictr …r }r (h5Uh6jú ubah}r (h@]r hB]r hD]r hF]r hH]r uhJMhKhh0]r (hÃ)r }r (h5X `patch.dict`r h>}r (h@]r hB]r hD]r hF]r hH]r uh6j h0]r hYX patch.dictr …r }r! (h5Uh6j ubah}r) (h@]r* hB]r+ hD]r, hF]r- hH]r. uh6j h0]r/ hYX patch.dictr0 …r1 }r2 (h5Uh6j& ubah}r: (h@]r; hB]r< hD]r= hF]r> hH]r? uh6j h0]r@ hYXpatch.TEST_PREFIXrA …rB }rC (h5Uh6j7 ubah}rK (h@]rL hB]rM hD]rN hF]rO hH]rP uhJM!hKhh0]rQ (hÃ)rR }rS (h5X `patch.dict`rT h>}rU (h@]rV hB]rW hD]rX hF]rY hH]rZ uh6jH h0]r[ hYX patch.dictr\ …r] }r^ (h5Uh6jR ubah>> from mock import patch >>> foo = {} >>> with patch.dict(foo, {'newkey': 'newvalue'}): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == {} >>> import os >>> with patch.dict('os.environ', {'newkey': 'newvalue'}): ... print os.environ['newkey'] ... newvalue >>> assert 'newkey' not in os.environre h6j¸ h7h:h}rf (U testnodetyperg Xdoctestrh hehfhF]ri hD]rj h@]rk hB]rl hH]rm Ugroupsrn ]ro hnaho}rp uhJM%hKhh0]rq hYX?>>> from mock import patch >>> foo = {} >>> with patch.dict(foo, {'newkey': 'newvalue'}): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == {} >>> import os >>> with patch.dict('os.environ', {'newkey': 'newvalue'}): ... print os.environ['newkey'] ... newvalue >>> assert 'newkey' not in os.environrr …rs }rt (h5Uh6jc ubaubh‡)ru }rv (h5XNKeywords can be used in the `patch.dict` call to set values in the dictionary:rw h6j¸ h7h:h}rx (h@]ry hB]rz hD]r{ hF]r| hH]r} uhJM5hKhh0]r~ (hYXKeywords can be used in the r …r€ }r (h5XKeywords can be used in the r‚ h6ju ubhÃ)rƒ }r„ (h5X `patch.dict`r… h>}r† (h@]r‡ hB]rˆ hD]r‰ hF]rŠ hH]r‹ uh6ju h0]rŒ hYX patch.dictr …rŽ }r (h5Uh6jƒ ubah>> mymodule = MagicMock() >>> mymodule.function.return_value = 'fish' >>> with patch.dict('sys.modules', mymodule=mymodule): ... import mymodule ... mymodule.function('some', 'args') ... 'fish'r– h6j¸ h7h:h}r— (U testnodetyper˜ Xdoctestr™ hehfhF]rš hD]r› h@]rœ hB]r hH]rž UgroupsrŸ ]r  hnaho}r¡ uhJM7hKhh0]r¢ hYXÊ>>> mymodule = MagicMock() >>> mymodule.function.return_value = 'fish' >>> with patch.dict('sys.modules', mymodule=mymodule): ... import mymodule ... mymodule.function('some', 'args') ... 'fish'r£ …r¤ }r¥ (h5Uh6j” ubaubh‡)r¦ }r§ (h5XB`patch.dict` can be used with dictionary like objects that aren't actually dictionaries. At the very minimum they must support item getting, setting, deleting and either iteration or membership test. This corresponds to the magic methods `__getitem__`, `__setitem__`, `__delitem__` and either `__iter__` or `__contains__`.r¨ h6j¸ h7h:h}r© (h@]rª hB]r« hD]r¬ hF]r­ hH]r® uhJMAhKhh0]r¯ (hÃ)r° }r± (h5X `patch.dict`r² h>}r³ (h@]r´ hB]rµ hD]r¶ hF]r· hH]r¸ uh6j¦ h0]r¹ hYX patch.dictrº …r» }r¼ (h5Uh6j° ubah}rÄ (h@]rÅ hB]rÆ hD]rÇ hF]rÈ hH]rÉ uh6j¦ h0]rÊ hYX __getitem__rË …rÌ }rÍ (h5Uh6jÁ ubah}rÕ (h@]rÖ hB]r× hD]rØ hF]rÙ hH]rÚ uh6j¦ h0]rÛ hYX __setitem__rÜ …rÝ }rÞ (h5Uh6jÒ ubah}ræ (h@]rç hB]rè hD]ré hF]rê hH]rë uh6j¦ h0]rì hYX __delitem__rí …rî }rï (h5Uh6jã ubah}r÷ (h@]rø hB]rù hD]rú hF]rû hH]rü uh6j¦ h0]rý hYX__iter__rþ …rÿ }r (h5Uh6jô ubah}r (h@]r hB]r hD]r hF]r hH]r uh6j¦ h0]r hYX __contains__r …r }r (h5Uh6j ubah>> class Container(object): ... def __init__(self): ... self.values = {} ... def __getitem__(self, name): ... return self.values[name] ... def __setitem__(self, name, value): ... self.values[name] = value ... def __delitem__(self, name): ... del self.values[name] ... def __iter__(self): ... return iter(self.values) ... >>> thing = Container() >>> thing['one'] = 1 >>> with patch.dict(thing, one=2, two=3): ... assert thing['one'] == 2 ... assert thing['two'] == 3 ... >>> assert thing['one'] == 1 >>> assert list(thing) == ['one']r h6j¸ h7h:h}r (U testnodetyper Xdoctestr hehfhF]r hD]r h@]r hB]r hH]r Ugroupsr ]r hnaho}r! uhJMGhKhh0]r" hYXY>>> class Container(object): ... def __init__(self): ... self.values = {} ... def __getitem__(self, name): ... return self.values[name] ... def __setitem__(self, name, value): ... self.values[name] = value ... def __delitem__(self, name): ... del self.values[name] ... def __iter__(self): ... return iter(self.values) ... >>> thing = Container() >>> thing['one'] = 1 >>> with patch.dict(thing, one=2, two=3): ... assert thing['one'] == 2 ... assert thing['two'] == 3 ... >>> assert thing['one'] == 1 >>> assert list(thing) == ['one']r# …r$ }r% (h5Uh6j ubaubeubh2)r& }r' (h5Uh6h3h7h:h}r( (h@]r) hB]r* hD]r+ hF]r, h,ahH]r- hauhJM`hKhh0]r. (hM)r/ }r0 (h5Xpatch.multipler1 h6j& h7h:h}r2 (h@]r3 hB]r4 hD]r5 hF]r6 hH]r7 uhJM`hKhh0]r8 hYXpatch.multipler9 …r: }r; (h5j1 h6j/ ubaubhë)r< }r= (h5Uh6j& h7h:h}r> (hF]r? hD]r@ h@]rA hB]rB hH]rC UentriesrD ]rE (h÷X!patch.multiple() (in module mock)h UtrF auhJNhKhh0]rG ubhú)rH }rI (h5Uh6j& h7h:h}rJ (hÿ‰jXpyrK hF]rL hD]rM h@]rN hB]rO hH]rP jXfunctionrQ j jQ uhJNhKhh0]rR (j )rS }rT (h5Xjpatch.multiple(target, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)rU h6jH h7h:h}rV (hF]rW h ajjhD]rX h@]rY hB]rZ hH]r[ h ajXpatch.multipler\ jXpatchr] j‰uhJMwhKhh0]r^ (jw)r_ }r` (h5Xpatch.ra h6jS h7h:h}rb (h@]rc hB]rd hD]re hF]rf hH]rg uhJMwhKhh0]rh hYXpatch.ri …rj }rk (h5Uh6j_ ubaubj)rl }rm (h5Xmultiplern h6jS h7h:h}ro (h@]rp hB]rq hD]rr hF]rs hH]rt uhJMwhKhh0]ru hYXmultiplerv …rw }rx (h5Uh6jl ubaubj+)ry }rz (h5Uh6jS h7h:h}r{ (h@]r| hB]r} hD]r~ hF]r hH]r€ uhJMwhKhh0]r (j6)r‚ }rƒ (h5Xtargetr„ h>}r… (h@]r† hB]r‡ hD]rˆ hF]r‰ hH]rŠ uh6jy h0]r‹ hYXtargetrŒ …r }rŽ (h5Uh6j‚ ubah}r’ (h@]r“ hB]r” hD]r• hF]r– hH]r— uh6jy h0]r˜ hYX spec=Noner™ …rš }r› (h5Uh6j ubah}rŸ (h@]r  hB]r¡ hD]r¢ hF]r£ hH]r¤ uh6jy h0]r¥ hYX create=Falser¦ …r§ }r¨ (h5Uh6jœ ubah}r¬ (h@]r­ hB]r® hD]r¯ hF]r° hH]r± uh6jy h0]r² hYX spec_set=Noner³ …r´ }rµ (h5Uh6j© ubah}r¹ (h@]rº hB]r» hD]r¼ hF]r½ hH]r¾ uh6jy h0]r¿ hYX autospec=NonerÀ …rÁ }r (h5Uh6j¶ ubah}rÆ (h@]rÇ hB]rÈ hD]rÉ hF]rÊ hH]rË uh6jy h0]rÌ hYXnew_callable=NonerÍ …rÎ }rÏ (h5Uh6jà ubah}rÓ (h@]rÔ hB]rÕ hD]rÖ hF]r× hH]rØ uh6jy h0]rÙ hYX**kwargsrÚ …rÛ }rÜ (h5Uh6jÐ ubah}rß (h@]rà hB]rá hD]râ hF]rã hH]rä uhJMwhKhh0]rå (h‡)ræ }rç (h5X·Perform multiple patches in a single call. It takes the object to be patched (either as an object or a string to fetch the object by importing) and keyword arguments for the patches::rè h6jÝ h7h:h}ré (h@]rê hB]rë hD]rì hF]rí hH]rî uhJMdhKhh0]rï hYX¶Perform multiple patches in a single call. It takes the object to be patched (either as an object or a string to fetch the object by importing) and keyword arguments for the patches:rð …rñ }rò (h5X¶Perform multiple patches in a single call. It takes the object to be patched (either as an object or a string to fetch the object by importing) and keyword arguments for the patches:ró h6jæ ubaubjž)rô }rõ (h5XMwith patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'): ...rö h6jÝ h7h:h}r÷ (hehfhF]rø hD]rù h@]rú hB]rû hH]rü uhJMhhKhh0]rý hYXMwith patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'): ...rþ …rÿ }r(h5Uh6jô ubaubh‡)r}r(h5X÷Use :data:`DEFAULT` as the value if you want `patch.multiple` to create mocks for you. In this case the created mocks are passed into a decorated function by keyword, and a dictionary is returned when `patch.multiple` is used as a context manager.rh6jÝ h7h:h}r(h@]rhB]rhD]rhF]rhH]r uhJMkhKhh0]r (hYXUse r …r }r (h5XUse rh6jubj)r}r(h5X:data:`DEFAULT`rh6jh7h:h}r(UreftyperXdatarj‰jXDEFAULTrU refdomainrXpyrhF]rhD]rU refexplicitr‰h@]rhB]rhH]rjjjNjjuhJMkh0]rj)r}r (h5jh>}r!(h@]r"hB]r#(j%jXpy-datar$ehD]r%hF]r&hH]r'uh6jh0]r(hYXDEFAULTr)…r*}r+(h5Uh6jubah}r3(h@]r4hB]r5hD]r6hF]r7hH]r8uh6jh0]r9hYXpatch.multipler:…r;}r<(h5Uh6j0ubah}r?(h5XŒ to create mocks for you. In this case the created mocks are passed into a decorated function by keyword, and a dictionary is returned when r@h6jubhÃ)rA}rB(h5X`patch.multiple`rCh>}rD(h@]rEhB]rFhD]rGhF]rHhH]rIuh6jh0]rJhYXpatch.multiplerK…rL}rM(h5Uh6jAubah}rU(h@]rVhB]rWhD]rXhF]rYhH]rZuhJMphKhh0]r[(hÃ)r\}r](h5X`patch.multiple`r^h>}r_(h@]r`hB]rahD]rbhF]rchH]rduh6jRh0]rehYXpatch.multiplerf…rg}rh(h5Uh6j\ubah}rp(h@]rqhB]rrhD]rshF]rthH]ruuh6jRh0]rvhYXspecrw…rx}ry(h5Uh6jmubah}r(h@]r‚hB]rƒhD]r„hF]r…hH]r†uh6jRh0]r‡hYXspec_setrˆ…r‰}rŠ(h5Uh6j~ubah}r’(h@]r“hB]r”hD]r•hF]r–hH]r—uh6jRh0]r˜hYXcreater™…rš}r›(h5Uh6jubah}r£(h@]r¤hB]r¥hD]r¦hF]r§hH]r¨uh6jRh0]r©hYXautospecrª…r«}r¬(h5Uh6j ubah}r´(h@]rµhB]r¶hD]r·hF]r¸hH]r¹uh6jRh0]rºhYX new_callabler»…r¼}r½(h5Uh6j±ubah}rÅ(h@]rÆhB]rÇhD]rÈhF]rÉhH]rÊuh6jRh0]rËhYXpatchrÌ…rÍ}rÎ(h5Uh6jÂubah}rÖ(h@]r×hB]rØhD]rÙhF]rÚhH]rÛuh6jRh0]rÜhYXallrÝ…rÞ}rß(h5Uh6jÓubah}rç(h@]rèhB]réhD]rêhF]rëhH]rìuh6jRh0]ríhYXpatch.multiplerî…rï}rð(h5Uh6jäubah}rö(h@]r÷hB]røhD]rùhF]rúhH]rûuhJMuhKhh0]rü(hYXWhen used as a class decorator rý…rþ}rÿ(h5XWhen used as a class decorator rh6jóubhÃ)r}r(h5X`patch.multiple`rh>}r(h@]rhB]rhD]rhF]rhH]r uh6jóh0]r hYXpatch.multipler …r }r (h5Uh6jubah}r(h@]rhB]rhD]rhF]rhH]ruh6jóh0]rhYXpatch.TEST_PREFIXr…r}r(h5Uh6jubah}r&(h@]r'hB]r(hD]r)hF]r*hH]r+uhJMxhKhh0]r,(hYX If you want r-…r.}r/(h5X If you want r0h6j#ubhÃ)r1}r2(h5X`patch.multiple`r3h>}r4(h@]r5hB]r6hD]r7hF]r8hH]r9uh6j#h0]r:hYXpatch.multipler;…r<}r=(h5Uh6j1ubah…r?}r@(h5X+ to create mocks for you, then you can use rAh6j#ubj)rB}rC(h5X:data:`DEFAULT`rDh6j#h7h:h}rE(UreftyperFXdatarGj‰jXDEFAULTrHU refdomainrIXpyrJhF]rKhD]rLU refexplicitrM‰h@]rNhB]rOhH]rPjjjNjjuhJMxh0]rQj)rR}rS(h5jDh>}rT(h@]rUhB]rV(j%jJXpy-datarWehD]rXhF]rYhH]rZuh6jBh0]r[hYXDEFAULTr\…r]}r^(h5Uh6jRubah}rf(h@]rghB]rhhD]rihF]rjhH]rkuh6j#h0]rlhYXpatch.multiplerm…rn}ro(h5Uh6jcubah>> thing = object() >>> other = object() >>> @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) ... def test_function(thing, other): ... assert isinstance(thing, MagicMock) ... assert isinstance(other, MagicMock) ... >>> test_function()rvh6j& h7h:h}rw(U testnodetyperxXdoctestryhehfhF]rzhD]r{h@]r|hB]r}hH]r~Ugroupsr]r€hnaho}ruhJM|hKhh0]r‚hYXý>>> thing = object() >>> other = object() >>> @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) ... def test_function(thing, other): ... assert isinstance(thing, MagicMock) ... assert isinstance(other, MagicMock) ... >>> test_function()rƒ…r„}r…(h5Uh6jtubaubh‡)r†}r‡(h5X›`patch.multiple` can be nested with other `patch` decorators, but put arguments passed by keyword *after* any of the standard arguments created by `patch`:rˆh6j& h7h:h}r‰(h@]rŠhB]r‹hD]rŒhF]rhH]rŽuhJMˆhKhh0]r(hÃ)r}r‘(h5X`patch.multiple`r’h>}r“(h@]r”hB]r•hD]r–hF]r—hH]r˜uh6j†h0]r™hYXpatch.multiplerš…r›}rœ(h5Uh6jubah}r¤(h@]r¥hB]r¦hD]r§hF]r¨hH]r©uh6j†h0]rªhYXpatchr«…r¬}r­(h5Uh6j¡ubah}rµ(h@]r¶hB]r·hD]r¸hF]r¹hH]rºuh6j†h0]r»hYXafterr¼…r½}r¾(h5Uh6j²ubah}rÆ(h@]rÇhB]rÈhD]rÉhF]rÊhH]rËuh6j†h0]rÌhYXpatchrÍ…rÎ}rÏ(h5Uh6jÃubah>> @patch('sys.exit') ... @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) ... def test_function(mock_exit, other, thing): ... assert 'other' in repr(other) ... assert 'thing' in repr(thing) ... assert 'exit' in repr(mock_exit) ... >>> test_function()rÔh6j& h7h:h}rÕ(U testnodetyperÖXdoctestr×hehfhF]rØhD]rÙh@]rÚhB]rÛhH]rÜUgroupsrÝ]rÞhnaho}rßuhJM‹hKhh0]ràhYX>>> @patch('sys.exit') ... @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) ... def test_function(mock_exit, other, thing): ... assert 'other' in repr(other) ... assert 'thing' in repr(thing) ... assert 'exit' in repr(mock_exit) ... >>> test_function()rá…râ}rã(h5Uh6jÒubaubh‡)rä}rå(h5X‘If `patch.multiple` is used as a context manager, the value returned by the context manger is a dictionary where created mocks are keyed by name:ræh6j& h7h:h}rç(h@]rèhB]réhD]rêhF]rëhH]rìuhJM–hKhh0]rí(hYXIf rî…rï}rð(h5XIf rñh6jäubhÃ)rò}ró(h5X`patch.multiple`rôh>}rõ(h@]röhB]r÷hD]røhF]rùhH]rúuh6jäh0]rûhYXpatch.multiplerü…rý}rþ(h5Uh6jòubah>> with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as values: ... assert 'other' in repr(values['other']) ... assert 'thing' in repr(values['thing']) ... assert values['thing'] is thing ... assert values['other'] is other ...rh6j& h7h:h}r(U testnodetyperXdoctestrhehfhF]r hD]r h@]r hB]r hH]r Ugroupsr]rhnaho}ruhJM™hKhh0]rhYX>>> with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as values: ... assert 'other' in repr(values['other']) ... assert 'thing' in repr(values['thing']) ... assert values['thing'] is thing ... assert values['other'] is other ...r…r}r(h5Uh6jubaubcdocutils.nodes target r)r}r(h5X.. _start-and-stop:rh6j& h7h:h}r(hF]rhD]rh@]rhB]rhH]rhäh/uhJM£hKhh0]r ubeubh2)r!}r"(h5Uh6h3h7h:Uexpect_referenced_by_namer#}r$hjsh}r%(h@]r&hB]r'hD]r(hF]r)(h)h/ehH]r*(hheuhJM¦hKhUexpect_referenced_by_idr+}r,h/jsh0]r-(hM)r.}r/(h5Xpatch methods: start and stopr0h6j!h7h:h}r1(h@]r2hB]r3hD]r4hF]r5hH]r6uhJM¦hKhh0]r7hYXpatch methods: start and stopr8…r9}r:(h5j0h6j.ubaubh‡)r;}r<(h5XÁAll the patchers have `start` and `stop` methods. These make it simpler to do patching in `setUp` methods or where you want to do multiple patches without nesting decorators or with statements.r=h6j!h7h:h}r>(h@]r?hB]r@hD]rAhF]rBhH]rCuhJM¨hKhh0]rD(hYXAll the patchers have rE…rF}rG(h5XAll the patchers have rHh6j;ubhÃ)rI}rJ(h5X`start`rKh>}rL(h@]rMhB]rNhD]rOhF]rPhH]rQuh6j;h0]rRhYXstartrS…rT}rU(h5Uh6jIubah}r](h@]r^hB]r_hD]r`hF]rahH]rbuh6j;h0]rchYXstoprd…re}rf(h5Uh6jZubah}rn(h@]rohB]rphD]rqhF]rrhH]rsuh6j;h0]rthYXsetUpru…rv}rw(h5Uh6jkubah}r(h@]r€hB]rhD]r‚hF]rƒhH]r„uhJM¬hKhh0]r…(hYXTo use them call r†…r‡}rˆ(h5XTo use them call r‰h6j|ubhÃ)rŠ}r‹(h5X`patch`rŒh>}r(h@]rŽhB]rhD]rhF]r‘hH]r’uh6j|h0]r“hYXpatchr”…r•}r–(h5Uh6jŠubah}rž(h@]rŸhB]r hD]r¡hF]r¢hH]r£uh6j|h0]r¤hYX patch.objectr¥…r¦}r§(h5Uh6j›ubah}r¯(h@]r°hB]r±hD]r²hF]r³hH]r´uh6j|h0]rµhYX patch.dictr¶…r·}r¸(h5Uh6j¬ubah}rÀ(h@]rÁhB]rÂhD]rÃhF]rÄhH]rÅuh6j|h0]rÆhYXpatcherrÇ…rÈ}rÉ(h5Uh6j½ubah}rÑ(h@]rÒhB]rÓhD]rÔhF]rÕhH]rÖuh6j|h0]r×hYXstartrØ…rÙ}rÚ(h5Uh6jÎubah}râ(h@]rãhB]rähD]råhF]ræhH]rçuh6j|h0]rèhYXstopré…rê}rë(h5Uh6jßubah}ró(h@]rôhB]rõhD]röhF]r÷hH]røuhJM°hKhh0]rù(hYXIf you are using rú…rû}rü(h5XIf you are using rýh6jðubhÃ)rþ}rÿ(h5X`patch`rh>}r(h@]rhB]rhD]rhF]rhH]ruh6jðh0]rhYXpatchr…r }r (h5Uh6jþubah}r(h@]rhB]rhD]rhF]rhH]ruh6jðh0]rhYX patcher.startr…r}r(h5Uh6jubah>> patcher = patch('package.module.ClassName') >>> from package import module >>> original = module.ClassName >>> new_mock = patcher.start() >>> assert module.ClassName is not original >>> assert module.ClassName is new_mock >>> patcher.stop() >>> assert module.ClassName is original >>> assert module.ClassName is not new_mockr h6j!h7h:h}r!(U testnodetyper"Xdoctestr#hehfhF]r$hD]r%h@]r&hB]r'hH]r(Ugroupsr)]r*hnaho}r+uhJM³hKhh0]r,hYXH>>> patcher = patch('package.module.ClassName') >>> from package import module >>> original = module.ClassName >>> new_mock = patcher.start() >>> assert module.ClassName is not original >>> assert module.ClassName is new_mock >>> patcher.stop() >>> assert module.ClassName is original >>> assert module.ClassName is not new_mockr-…r.}r/(h5Uh6jubaubh‡)r0}r1(h5XfA typical use case for this might be for doing multiple patches in the `setUp` method of a `TestCase`:r2h6j!h7h:h}r3(h@]r4hB]r5hD]r6hF]r7hH]r8uhJMÀhKhh0]r9(hYXGA typical use case for this might be for doing multiple patches in the r:…r;}r<(h5XGA typical use case for this might be for doing multiple patches in the r=h6j0ubhÃ)r>}r?(h5X`setUp`r@h>}rA(h@]rBhB]rChD]rDhF]rEhH]rFuh6j0h0]rGhYXsetUprH…rI}rJ(h5Uh6j>ubah}rR(h@]rShB]rThD]rUhF]rVhH]rWuh6j0h0]rXhYXTestCaserY…rZ}r[(h5Uh6jOubah>> class MyTest(TestCase): ... def setUp(self): ... self.patcher1 = patch('package.module.Class1') ... self.patcher2 = patch('package.module.Class2') ... self.MockClass1 = self.patcher1.start() ... self.MockClass2 = self.patcher2.start() ... ... def tearDown(self): ... self.patcher1.stop() ... self.patcher2.stop() ... ... def test_something(self): ... assert package.module.Class1 is self.MockClass1 ... assert package.module.Class2 is self.MockClass2 ... >>> MyTest('test_something').run()r`h6j!h7h:h}ra(U testnodetyperbXdoctestrchehfhF]rdhD]reh@]rfhB]rghH]rhUgroupsri]rjhnaho}rkuhJMÃhKhh0]rlhYX9>>> class MyTest(TestCase): ... def setUp(self): ... self.patcher1 = patch('package.module.Class1') ... self.patcher2 = patch('package.module.Class2') ... self.MockClass1 = self.patcher1.start() ... self.MockClass2 = self.patcher2.start() ... ... def tearDown(self): ... self.patcher1.stop() ... self.patcher2.stop() ... ... def test_something(self): ... assert package.module.Class1 is self.MockClass1 ... assert package.module.Class2 is self.MockClass2 ... >>> MyTest('test_something').run()rm…rn}ro(h5Uh6j^ubaubcdocutils.nodes caution rp)rq}rr(h5XûIf you use this technique you must ensure that the patching is "undone" by calling `stop`. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. `unittest2 `_ cleanup functions make this easier. .. doctest:: >>> class MyTest(TestCase): ... def setUp(self): ... patcher = patch('package.module.Class') ... self.MockClass = patcher.start() ... self.addCleanup(patcher.stop) ... ... def test_something(self): ... assert package.module.Class is self.MockClass ... >>> MyTest('test_something').run() As an added bonus you no longer need to keep a reference to the `patcher` object.rsh6j!h7h:h}ru(h@]rvhB]rwhD]rxhF]ryhH]rzuhJNhKhh0]r{(h‡)r|}r}(h5X*If you use this technique you must ensure that the patching is "undone" by calling `stop`. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. `unittest2 `_ cleanup functions make this easier.r~h6jqh7h:h}r(h@]r€hB]rhD]r‚hF]rƒhH]r„uhJMØh0]r…(hYXSIf you use this technique you must ensure that the patching is "undone" by calling r†…r‡}rˆ(h5XSIf you use this technique you must ensure that the patching is "undone" by calling r‰h6j|ubhÃ)rŠ}r‹(h5X`stop`rŒh>}r(h@]rŽhB]rhD]rhF]r‘hH]r’uh6j|h0]r“hYXstopr”…r•}r–(h5Uh6jŠubah`_rh>}rž(UnamerŸX unittest2r Urefurir¡X%http://pypi.python.org/pypi/unittest2r¢hF]r£hD]r¤h@]r¥hB]r¦hH]r§uh6j|h0]r¨hYX unittest2r©…rª}r«(h5Uh6j›ubahr®h˜Kh6j|h}r¯(Urefurir°j¢hF]r±h.ahD]r²h@]r³hB]r´hH]rµhauh0]r¶ubhYX$ cleanup functions make this easier.r·…r¸}r¹(h5X$ cleanup functions make this easier.rºh6j|ubeubjž)r»}r¼(h5XF>>> class MyTest(TestCase): ... def setUp(self): ... patcher = patch('package.module.Class') ... self.MockClass = patcher.start() ... self.addCleanup(patcher.stop) ... ... def test_something(self): ... assert package.module.Class is self.MockClass ... >>> MyTest('test_something').run()r½h6jqh7h:h}r¾(U testnodetyper¿XdoctestrÀhehfhF]rÁhD]rÂh@]rÃhB]rÄhH]rÅUgroupsrÆ]rÇhnaho}rÈuhJMÞh0]rÉhYXF>>> class MyTest(TestCase): ... def setUp(self): ... patcher = patch('package.module.Class') ... self.MockClass = patcher.start() ... self.addCleanup(patcher.stop) ... ... def test_something(self): ... assert package.module.Class is self.MockClass ... >>> MyTest('test_something').run()rÊ…rË}rÌ(h5Uh6j»ubaubh‡)rÍ}rÎ(h5XQAs an added bonus you no longer need to keep a reference to the `patcher` object.rÏh6jqh7h:h}rÐ(h@]rÑhB]rÒhD]rÓhF]rÔhH]rÕuhJMëh0]rÖ(hYX@As an added bonus you no longer need to keep a reference to the r×…rØ}rÙ(h5X@As an added bonus you no longer need to keep a reference to the rÚh6jÍubhÃ)rÛ}rÜ(h5X `patcher`rÝh>}rÞ(h@]rßhB]ràhD]ráhF]râhH]rãuh6jÍh0]rähYXpatcherrå…ræ}rç(h5Uh6jÛubah}rï(h@]rðhB]rñhD]ròhF]róhH]rôuhJMîhKhh0]rõ(hYXIIt is also possible to stop all patches which have been started by using rö…r÷}rø(h5XIIt is also possible to stop all patches which have been started by using rùh6jìubhÃ)rú}rû(h5X`patch.stopall`rüh>}rý(h@]rþhB]rÿhD]rhF]rhH]ruh6jìh0]rhYX patch.stopallr…r}r(h5Uh6júubah}r (hF]r hD]r h@]rhB]rhH]rUentriesr]r(h÷X patch.stopall() (in module mock)h UtrauhJNhKhh0]rubhú)r}r(h5Uh6j!h7h:h}r(hÿ‰jXpyrhF]rhD]rh@]rhB]rhH]rjXfunctionrj juhJNhKhh0]r(j )r }r!(h5X patch.stopallr"h6jh7h:h}r#(hF]r$h ajjhD]r%h@]r&hB]r'hH]r(h ajX patch.stopallr)jXpatchr*j‰uhJMõhKhh0]r+(jw)r,}r-(h5Xpatch.r.h6j h7h:h}r/(h@]r0hB]r1hD]r2hF]r3hH]r4uhJMõhKhh0]r5hYXpatch.r6…r7}r8(h5Uh6j,ubaubj)r9}r:(h5Xstopallr;h6j h7h:h}r<(h@]r=hB]r>hD]r?hF]r@hH]rAuhJMõhKhh0]rBhYXstopallrC…rD}rE(h5Uh6j9ubaubj+)rF}rG(h5Uh6j h7h:h}rH(h@]rIhB]rJhD]rKhF]rLhH]rMuhJMõhKhh0]rNubeubj )rO}rP(h5Uh6jh7h:h}rQ(h@]rRhB]rShD]rThF]rUhH]rVuhJMõhKhh0]rWh‡)rX}rY(h5XAStop all active patches. Only stops patches started with `start`.rZh6jOh7h:h}r[(h@]r\hB]r]hD]r^hF]r_hH]r`uhJMóhKhh0]ra(hYX9Stop all active patches. Only stops patches started with rb…rc}rd(h5X9Stop all active patches. Only stops patches started with reh6jXubhÃ)rf}rg(h5X`start`rhh>}ri(h@]rjhB]rkhD]rlhF]rmhH]rnuh6jXh0]rohYXstartrp…rq}rr(h5Uh6jfubah}rw(h@]rxhB]ryhD]rzhF]r{h'ahH]r|hauhJM÷hKhh0]r}(hM)r~}r(h5X TEST_PREFIXr€h6juh7h:h}r(h@]r‚hB]rƒhD]r„hF]r…hH]r†uhJM÷hKhh0]r‡hYX TEST_PREFIXrˆ…r‰}rŠ(h5j€h6j~ubaubh‡)r‹}rŒ(h5XAll of the patchers can be used as class decorators. When used in this way they wrap every test method on the class. The patchers recognise methods that start with `test` as being test methods. This is the same way that the `unittest.TestLoader` finds test methods by default.rh6juh7h:h}rŽ(h@]rhB]rhD]r‘hF]r’hH]r“uhJMùhKhh0]r”(hYX¤All of the patchers can be used as class decorators. When used in this way they wrap every test method on the class. The patchers recognise methods that start with r•…r–}r—(h5X¤All of the patchers can be used as class decorators. When used in this way they wrap every test method on the class. The patchers recognise methods that start with r˜h6j‹ubhÃ)r™}rš(h5X`test`r›h>}rœ(h@]rhB]ržhD]rŸhF]r hH]r¡uh6j‹h0]r¢hYXtestr£…r¤}r¥(h5Uh6j™ubah}r­(h@]r®hB]r¯hD]r°hF]r±hH]r²uh6j‹h0]r³hYXunittest.TestLoaderr´…rµ}r¶(h5Uh6jªubah}r¾(h@]r¿hB]rÀhD]rÁhF]rÂhH]rÃuhJMþhKhh0]rÄ(hYX†It is possible that you want to use a different prefix for your tests. You can inform the patchers of the different prefix by setting rÅ…rÆ}rÇ(h5X†It is possible that you want to use a different prefix for your tests. You can inform the patchers of the different prefix by setting rÈh6j»ubhÃ)rÉ}rÊ(h5X`patch.TEST_PREFIX`rËh>}rÌ(h@]rÍhB]rÎhD]rÏhF]rÐhH]rÑuh6j»h0]rÒhYXpatch.TEST_PREFIXrÓ…rÔ}rÕ(h5Uh6jÉubah>> patch.TEST_PREFIX = 'foo' >>> value = 3 >>> >>> @patch('__main__.value', 'not three') ... class Thing(object): ... def foo_one(self): ... print value ... def foo_two(self): ... print value ... >>> >>> Thing().foo_one() not three >>> Thing().foo_two() not three >>> value 3rÚh6juh7h:h}rÛ(U testnodetyperÜXdoctestrÝhehfhF]rÞhD]rßh@]ràhB]ráhH]râUgroupsrã]rähnaho}råuhJMhKhh0]ræhYX,>>> patch.TEST_PREFIX = 'foo' >>> value = 3 >>> >>> @patch('__main__.value', 'not three') ... class Thing(object): ... def foo_one(self): ... print value ... def foo_two(self): ... print value ... >>> >>> Thing().foo_one() not three >>> Thing().foo_two() not three >>> value 3rç…rè}ré(h5Uh6jØubaubeubh2)rê}rë(h5Uh6h3h7h:h}rì(h@]ríhB]rîhD]rïhF]rðh%ahH]rñh auhJMhKhh0]rò(hM)ró}rô(h5XNesting Patch Decoratorsrõh6jêh7h:h}rö(h@]r÷hB]røhD]rùhF]rúhH]rûuhJMhKhh0]rühYXNesting Patch Decoratorsrý…rþ}rÿ(h5jõh6jóubaubh‡)r}r(h5XTIf you want to perform multiple patches then you can simply stack up the decorators.rh6jêh7h:h}r(h@]rhB]rhD]rhF]rhH]ruhJMhKhh0]r hYXTIf you want to perform multiple patches then you can simply stack up the decorators.r …r }r (h5jh6jubaubh‡)r }r(h5X>You can stack up multiple patch decorators using this pattern:rh6jêh7h:h}r(h@]rhB]rhD]rhF]rhH]ruhJMhKhh0]rhYX>You can stack up multiple patch decorators using this pattern:r…r}r(h5jh6j ubaubjž)r}r(h5X®>>> @patch.object(SomeClass, 'class_method') ... @patch.object(SomeClass, 'static_method') ... def test(mock1, mock2): ... assert SomeClass.static_method is mock1 ... assert SomeClass.class_method is mock2 ... SomeClass.static_method('foo') ... SomeClass.class_method('bar') ... return mock1, mock2 ... >>> mock1, mock2 = test() >>> mock1.assert_called_once_with('foo') >>> mock2.assert_called_once_with('bar')rh6jêh7h:h}r(U testnodetyperXdoctestrhehfhF]r hD]r!h@]r"hB]r#hH]r$Ugroupsr%]r&hnaho}r'uhJMhKhh0]r(hYX®>>> @patch.object(SomeClass, 'class_method') ... @patch.object(SomeClass, 'static_method') ... def test(mock1, mock2): ... assert SomeClass.static_method is mock1 ... assert SomeClass.class_method is mock2 ... SomeClass.static_method('foo') ... SomeClass.class_method('bar') ... return mock1, mock2 ... >>> mock1, mock2 = test() >>> mock1.assert_called_once_with('foo') >>> mock2.assert_called_once_with('bar')r)…r*}r+(h5Uh6jubaubh‡)r,}r-(h5XÈNote that the decorators are applied from the bottom upwards. This is the standard way that Python applies decorators. The order of the created mocks passed into your test function matches this order.r.h6jêh7h:h}r/(h@]r0hB]r1hD]r2hF]r3hH]r4uhJM.hKhh0]r5hYXÈNote that the decorators are applied from the bottom upwards. This is the standard way that Python applies decorators. The order of the created mocks passed into your test function matches this order.r6…r7}r8(h5j.h6j,ubaubh‡)r9}r:(h5X‰Like all context-managers patches can be nested using contextlib's nested function; *every* patching will appear in the tuple after "as":r;h6jêh7h:h}r<(h@]r=hB]r>hD]r?hF]r@hH]rAuhJM2hKhh0]rB(hYXTLike all context-managers patches can be nested using contextlib's nested function; rC…rD}rE(h5XTLike all context-managers patches can be nested using contextlib's nested function; rFh6j9ubj)rG}rH(h5X*every*rIh>}rJ(h@]rKhB]rLhD]rMhF]rNhH]rOuh6j9h0]rPhYXeveryrQ…rR}rS(h5Uh6jGubah>> from contextlib import nested >>> with nested( ... patch('package.module.ClassName1'), ... patch('package.module.ClassName2') ... ) as (MockClass1, MockClass2): ... assert package.module.ClassName1 is MockClass1 ... assert package.module.ClassName2 is MockClass2 ...rZh6jêh7h:h}r[(U testnodetyper\Xdoctestr]hehfhF]r^hD]r_h@]r`hB]rahH]rbUgroupsrc]rdhnaho}reuhJM5hKhh0]rfhYX*>>> from contextlib import nested >>> with nested( ... patch('package.module.ClassName1'), ... patch('package.module.ClassName2') ... ) as (MockClass1, MockClass2): ... assert package.module.ClassName1 is MockClass1 ... assert package.module.ClassName2 is MockClass2 ...rg…rh}ri(h5Uh6jXubaubj)rj}rk(h5X.. _where-to-patch:rlh6jêh7h:h}rm(hF]rnhD]roh@]rphB]rqhH]rrhäh#uhJMAhKhh0]rsubeubh2)rt}ru(h5Uh˜Kh6h3h7h:j#}rvhjjsh}rw(h@]rxhB]ryhD]rzhF]r{(h#h-ehH]r|(hheuhJMDhKhj+}r}h#jjsh0]r~(hM)r}r€(h5XWhere to patchrh6jth7h:h}r‚(h@]rƒhB]r„hD]r…hF]r†hH]r‡uhJMDhKhh0]rˆhYXWhere to patchr‰…rŠ}r‹(h5jh6jubaubh‡)rŒ}r(h5Xö`patch` works by (temporarily) changing the object that a *name* points to with another one. There can be many names pointing to any individual object, so for patching to work you must ensure that you patch the name used by the system under test.rŽh6jth7h:h}r(h@]rhB]r‘hD]r’hF]r“hH]r”uhJMFhKhh0]r•(hÃ)r–}r—(h5X`patch`r˜h>}r™(h@]ršhB]r›hD]rœhF]rhH]ržuh6jŒh0]rŸhYXpatchr …r¡}r¢(h5Uh6j–ubah}rª(h@]r«hB]r¬hD]r­hF]r®hH]r¯uh6jŒh0]r°hYXnamer±…r²}r³(h5Uh6j§ubah}r»(h@]r¼hB]r½hD]r¾hF]r¿hH]rÀuhJMKhKhh0]rÁ(hYX9The basic principle is that you patch where an object is rÂ…rÃ}rÄ(h5X9The basic principle is that you patch where an object is rÅh6j¸ubj)rÆ}rÇ(h5X *looked up*rÈh>}rÉ(h@]rÊhB]rËhD]rÌhF]rÍhH]rÎuh6j¸h0]rÏhYX looked uprÐ…rÑ}rÒ(h5Uh6jÆubah}rÚ(h@]rÛhB]rÜhD]rÝhF]rÞhH]rßuhJMOhKhh0]ràhYXLImagine we have a project that we want to test with the following structure:rá…râ}rã(h5XLImagine we have a project that we want to test with the following structure:räh6j×ubaubjž)rå}ræ(h5Xna.py -> Defines SomeClass b.py -> from a import SomeClass -> some_function instantiates SomeClassrçh6jth7h:h}rè(hehfhF]réhD]rêh@]rëhB]rìhH]ríuhJMQhKhh0]rîhYXna.py -> Defines SomeClass b.py -> from a import SomeClass -> some_function instantiates SomeClassrï…rð}rñ(h5Uh6jåubaubh‡)rò}ró(h5X…Now we want to test `some_function` but we want to mock out `SomeClass` using `patch`. The problem is that when we import module b, which we will have to do then it imports `SomeClass` from module a. If we use `patch` to mock out `a.SomeClass` then it will have no effect on our test; module b already has a reference to the *real* `SomeClass` and it looks like our patching had no effect.rôh6jth7h:h}rõ(h@]röhB]r÷hD]røhF]rùhH]rúuhJMXhKhh0]rû(hYXNow we want to test rü…rý}rþ(h5XNow we want to test rÿh6jòubhÃ)r}r(h5X`some_function`rh>}r(h@]rhB]rhD]rhF]rhH]ruh6jòh0]r hYX some_functionr …r }r (h5Uh6jubah}r(h@]rhB]rhD]rhF]rhH]ruh6jòh0]rhYX SomeClassr…r}r(h5Uh6jubah}r%(h@]r&hB]r'hD]r(hF]r)hH]r*uh6jòh0]r+hYXpatchr,…r-}r.(h5Uh6j"ubah}r6(h@]r7hB]r8hD]r9hF]r:hH]r;uh6jòh0]r<hYX SomeClassr=…r>}r?(h5Uh6j3ubah}rG(h@]rHhB]rIhD]rJhF]rKhH]rLuh6jòh0]rMhYXpatchrN…rO}rP(h5Uh6jDubah}rX(h@]rYhB]rZhD]r[hF]r\hH]r]uh6jòh0]r^hYX a.SomeClassr_…r`}ra(h5Uh6jUubah}ri(h@]rjhB]rkhD]rlhF]rmhH]rnuh6jòh0]rohYXrealrp…rq}rr(h5Uh6jfubah}rx(h@]ryhB]rzhD]r{hF]r|hH]r}uh6jòh0]r~hYX SomeClassr…r€}r(h5Uh6juubah}r‰(h@]rŠhB]r‹hD]rŒhF]rhH]rŽuhJM_hKhh0]r(hYXThe key is to patch out r…r‘}r’(h5XThe key is to patch out r“h6j†ubhÃ)r”}r•(h5X `SomeClass`r–h>}r—(h@]r˜hB]r™hD]ršhF]r›hH]rœuh6j†h0]rhYX SomeClassrž…rŸ}r (h5Uh6j”ubah}r¨(h@]r©hB]rªhD]r«hF]r¬hH]r­uh6j†h0]r®hYX some_functionr¯…r°}r±(h5Uh6j¥ubah}r¹(h@]rºhB]r»hD]r¼hF]r½hH]r¾uh6j†h0]r¿hYX SomeClassrÀ…rÁ}rÂ(h5Uh6j¶ubah}rË(h@]rÌhB]rÍhD]rÎhF]rÏhH]rÐuhJNhKhh0]rÑh‡)rÒ}rÓ(h5X`@patch('b.SomeClass')`rÔh6jÈh7h:h}rÕ(h@]rÖhB]r×hD]rØhF]rÙhH]rÚuhJMch0]rÛhÃ)rÜ}rÝ(h5jÔh>}rÞ(h@]rßhB]ràhD]ráhF]râhH]rãuh6jÒh0]rähYX@patch('b.SomeClass')rå…ræ}rç(h5Uh6jÜubah}rë(h@]rìhB]ríhD]rîhF]rïhH]rðuhJMehKhh0]rñ(hYX<However, consider the alternative scenario where instead of rò…ró}rô(h5X<However, consider the alternative scenario where instead of rõh6jèubhÃ)rö}r÷(h5X`from a import SomeClass`røh>}rù(h@]rúhB]rûhD]rühF]rýhH]rþuh6jèh0]rÿhYXfrom a import SomeClassr…r}r(h5Uh6jöubah}r (h@]r hB]r hD]r hF]rhH]ruh6jèh0]rhYXimport ar…r}r(h5Uh6jubah}r(h@]rhB]rhD]rhF]rhH]r uh6jèh0]r!hYX some_functionr"…r#}r$(h5Uh6jubah}r,(h@]r-hB]r.hD]r/hF]r0hH]r1uh6jèh0]r2hYX a.SomeClassr3…r4}r5(h5Uh6j)ubah}r=(h@]r>hB]r?hD]r@hF]rAhH]rBuh6jèh0]rChYX a.SomeClassrD…rE}rF(h5Uh6j:ubah}rM(h@]rNhB]rOhD]rPhF]rQhH]rRuhJNhKhh0]rSh‡)rT}rU(h5X`@patch('a.SomeClass')`rVh6jKh7h:h}rW(h@]rXhB]rYhD]rZhF]r[hH]r\uhJMjh0]r]hÃ)r^}r_(h5jVh>}r`(h@]rahB]rbhD]rchF]rdhH]reuh6jTh0]rfhYX@patch('a.SomeClass')rg…rh}ri(h5Uh6j^ubah}rl(h@]rmhB]rnhD]rohF]rph"ahH]rqhauhJMnhKhh0]rr(hM)rs}rt(h5X&Patching Descriptors and Proxy Objectsruh6jjh7h:h}rv(h@]rwhB]rxhD]ryhF]rzhH]r{uhJMnhKhh0]r|hYX&Patching Descriptors and Proxy Objectsr}…r~}r(h5juh6jsubaubh‡)r€}r(h5XÙSince version 0.6.0 both patch_ and patch.object_ have been able to correctly patch and restore descriptors: class methods, static methods and properties. You should patch these on the *class* rather than an instance.r‚h6jjh7h:h}rƒ(h@]r„hB]r…hD]r†hF]r‡hH]rˆuhJMphKhh0]r‰(hYXSince version 0.6.0 both rŠ…r‹}rŒ(h5XSince version 0.6.0 both rh6j€ubhÖ)rŽ}r(h5Xpatch_rhÚKh6j€h}r‘(Unamer’Xpatchr“hF]r”hD]r•h@]r–hB]r—hH]r˜häh*uh0]r™hYXpatchrš…r›}rœ(h5Uh6jŽubaubhYX and r…rž}rŸ(h5X and r h6j€ubhÖ)r¡}r¢(h5X patch.object_r£hÚKh6j€h}r¤(Unamer¥X patch.objectr¦hF]r§hD]r¨h@]r©hB]rªhH]r«häh+uh0]r¬hYX patch.objectr­…r®}r¯(h5Uh6j¡ubaubhYXˆ have been able to correctly patch and restore descriptors: class methods, static methods and properties. You should patch these on the r°…r±}r²(h5Xˆ have been able to correctly patch and restore descriptors: class methods, static methods and properties. You should patch these on the r³h6j€ubj)r´}rµ(h5X*class*r¶h>}r·(h@]r¸hB]r¹hD]rºhF]r»hH]r¼uh6j€h0]r½hYXclassr¾…r¿}rÀ(h5Uh6j´ubah`_.rÇh6jjh7h:h}rÈ(h@]rÉhB]rÊhD]rËhF]rÌhH]rÍuhJMthKhh0]rÎ(hYXSince version 0.7.0 rÏ…rÐ}rÑ(h5XSince version 0.7.0 rÒh6jÅubhÖ)rÓ}rÔ(h5Xpatch_rÕhÚKh6jÅh}rÖ(Unamer×XpatchrØhF]rÙhD]rÚh@]rÛhB]rÜhH]rÝhäh*uh0]rÞhYXpatchrß…rà}rá(h5Uh6jÓubaubhYX and râ…rã}rä(h5X and råh6jÅubhÖ)ræ}rç(h5X patch.object_rèhÚKh6jÅh}ré(UnamerêX patch.objectrëhF]rìhD]ríh@]rîhB]rïhH]rðhäh+uh0]rñhYX patch.objectrò…ró}rô(h5Uh6jæubaubhYXH work correctly with some objects that proxy attribute access, like the rõ…rö}r÷(h5XH work correctly with some objects that proxy attribute access, like the røh6jÅubhÖ)rù}rú(h5Xe`django setttings object `_rûh>}rü(UnamerýXdjango setttings objectrþj¡XHhttp://www.voidspace.org.uk/python/weblog/arch_d7_2010_12_04.shtml#e1198rÿhF]rhD]rh@]rhB]rhH]ruh6jÅh0]rhYXdjango setttings objectr…r}r(h5Uh6jùubahr h˜Kh6jÅh}r (Urefurir jÿhF]rh$ahD]rh@]rhB]rhH]rh auh0]rubhYX.…r}r(h5X.h6jÅubeubh­)r}r(h5X¯In django `import settings` and `from django.conf import settings` return different objects. If you are using libraries / apps that do both you may have to patch both. Grrr...rh6jjh7h:h}r(h@]rhB]rhD]rhF]rhH]ruhJNhKhh0]rh‡)r }r!(h5X¯In django `import settings` and `from django.conf import settings` return different objects. If you are using libraries / apps that do both you may have to patch both. Grrr...r"h6jh7h:h}r#(h@]r$hB]r%hD]r&hF]r'hH]r(uhJMzh0]r)(hYX In django r*…r+}r,(h5X In django r-h6j ubhÃ)r.}r/(h5X`import settings`r0h>}r1(h@]r2hB]r3hD]r4hF]r5hH]r6uh6j h0]r7hYXimport settingsr8…r9}r:(h5Uh6j.ubahh6j ubhÃ)r?}r@(h5X"`from django.conf import settings`rAh>}rB(h@]rChB]rDhD]rEhF]rFhH]rGuh6j h0]rHhYX from django.conf import settingsrI…rJ}rK(h5Uh6j?ubah}ri(h@]rjUlevelrkKhF]rlhD]rmUsourcernh:hB]rohH]rpUlinerqM£UtyperrUINFOrsuh0]rth‡)ru}rv(h5Uh>}rw(h@]rxhB]ryhD]rzhF]r{hH]r|uh6jgh0]r}hYX4Hyperlink target "start-and-stop" is not referenced.r~…r}r€(h5Uh6juubah}r„(h@]r…Ulevelr†KhF]r‡hD]rˆUsourcer‰h:hB]rŠhH]r‹UlinerŒMAUtyperjsuh0]rŽh‡)r}r(h5Uh>}r‘(h@]r’hB]r“hD]r”hF]r•hH]r–uh6j‚h0]r—hYX4Hyperlink target "where-to-patch" is not referenced.r˜…r™}rš(h5Uh6jubahh*h–h&j¸ h"jjh$j hjå h.j¬h'juh/j!uUsubstitution_namesrî}rïh}rð(h@]rñhF]ròhD]róUsourcerôh:hB]rõhH]röuU footnotesr÷]røUrefidsrù}rú(h#]rûjjah/]rüjauub.mock-1.0.1/html/.doctrees/sentinel.doctree0000644000076500001200000002461012046030510021165 0ustar michaeladmin00000000000000€cdocutils.nodes document q)q}q(U nametypesq}q(XsentinelqNXsentinel exampleqNX mock.DEFAULTqˆX mock.sentinelq ˆuUsubstitution_defsq }q Uparse_messagesq ]q Ucurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q(hUsentinelqhUsentinel-exampleqhhh h uUchildrenq]qcdocutils.nodes section q)q}q(U rawsourceqUUparentqhUsourceqcdocutils.nodes reprunicode qX/compile/mock/docs/sentinel.txtq…q}q bUtagnameq!Usectionq"U attributesq#}q$(Udupnamesq%]q&Uclassesq']q(Ubackrefsq)]q*Uidsq+]q,haUnamesq-]q.hauUlineq/KUdocumentq0hh]q1(cdocutils.nodes title q2)q3}q4(hXSentinelq5hhhhh!Utitleq6h#}q7(h%]q8h']q9h)]q:h+]q;h-]qXSentinelq?…q@}qA(hh5hh3ubaubcdocutils.nodes comment qB)qC}qD(hX¼class ProductionClass(object): def something(self): return self.method() class Test(unittest2.TestCase): def testSomething(self): pass self = Test('testSomething')qEhhhhh!UcommentqFh#}qG(U testnodetypeqHX testsetupqIU xml:spaceqJUpreserveqKh+]qLh)]qMh%]qNh']qOh-]qPUgroupsqQ]qRUdefaultqSaUoptionsqT}qUuh/Kh0hh]qVh>X¼class ProductionClass(object): def something(self): return self.method() class Test(unittest2.TestCase): def testSomething(self): pass self = Test('testSomething')qW…qX}qY(hUhhCubaubcsphinx.addnodes index qZ)q[}q\(hUhhhhh!Uindexq]h#}q^(h+]q_h)]q`h%]qah']qbh-]qcUentriesqd]qe(UsingleqfXsentinel (in module mock)h Utqgauh/Nh0hh]qhubcsphinx.addnodes desc qi)qj}qk(hUhhhhh!Udescqlh#}qm(Unoindexqn‰UdomainqoXpyqph+]qqh)]qrh%]qsh']qth-]quUobjtypeqvXdataqwUdesctypeqxhwuh/Nh0hh]qy(csphinx.addnodes desc_signature qz)q{}q|(hXsentinelq}hhjhhh!Udesc_signatureq~h#}q(h+]q€h aUmoduleqXmockq‚h)]qƒh%]q„h']q…h-]q†h aUfullnameq‡h}UclassqˆUUfirstq‰‰uh/Kh0hh]qŠcsphinx.addnodes desc_name q‹)qŒ}q(hh}hh{hhh!U desc_nameqŽh#}q(h%]qh']q‘h)]q’h+]q“h-]q”uh/Kh0hh]q•h>Xsentinelq–…q—}q˜(hUhhŒubaubaubcsphinx.addnodes desc_content q™)qš}q›(hUhhjhhh!U desc_contentqœh#}q(h%]qžh']qŸh)]q h+]q¡h-]q¢uh/Kh0hh]q£(cdocutils.nodes paragraph q¤)q¥}q¦(hX]The ``sentinel`` object provides a convenient way of providing unique objects for your tests.q§hhšhhh!U paragraphq¨h#}q©(h%]qªh']q«h)]q¬h+]q­h-]q®uh/Kh0hh]q¯(h>XThe q°…q±}q²(hXThe q³hh¥ubcdocutils.nodes literal q´)qµ}q¶(hX ``sentinel``q·h#}q¸(h%]q¹h']qºh)]q»h+]q¼h-]q½uhh¥h]q¾h>Xsentinelq¿…qÀ}qÁ(hUhhµubah!UliteralqÂubh>XM object provides a convenient way of providing unique objects for your tests.qÃ…qÄ}qÅ(hXM object provides a convenient way of providing unique objects for your tests.qÆhh¥ubeubh¤)qÇ}qÈ(hXÕAttributes are created on demand when you access them by name. Accessing the same attribute will always return the same object. The objects returned have a sensible repr so that test failure messages are readable.qÉhhšhhh!h¨h#}qÊ(h%]qËh']qÌh)]qÍh+]qÎh-]qÏuh/Kh0hh]qÐh>XÕAttributes are created on demand when you access them by name. Accessing the same attribute will always return the same object. The objects returned have a sensible repr so that test failure messages are readable.qÑ…qÒ}qÓ(hhÉhhÇubaubeubeubhZ)qÔ}qÕ(hUhhhhh!h]h#}qÖ(h+]q×h)]qØh%]qÙh']qÚh-]qÛUentriesqÜ]qÝ(hfXDEFAULT (in module mock)hUtqÞauh/Nh0hh]qßubhi)qà}qá(hUhhhhh!hlh#}qâ(hn‰hoXpyqãh+]qäh)]qåh%]qæh']qçh-]qèhvXdataqéhxhéuh/Nh0hh]qê(hz)që}qì(hXDEFAULTqíhhàhhh!h~h#}qî(h+]qïhahh‚h)]qðh%]qñh']qòh-]qóhah‡híhˆUh‰‰uh/K$h0hh]qôh‹)qõ}qö(hhíhhëhhh!hŽh#}q÷(h%]qøh']qùh)]qúh+]qûh-]qüuh/K$h0hh]qýh>XDEFAULTqþ…qÿ}r(hUhhõubaubaubh™)r}r(hUhhàhhh!hœh#}r(h%]rh']rh)]rh+]rh-]ruh/K$h0hh]r h¤)r }r (hX¼The `DEFAULT` object is a pre-created sentinel (actually `sentinel.DEFAULT`). It can be used by :attr:`~Mock.side_effect` functions to indicate that the normal return value should be used.r hjhhh!h¨h#}r (h%]rh']rh)]rh+]rh-]ruh/K h0hh]r(h>XThe r…r}r(hXThe rhj ubcdocutils.nodes title_reference r)r}r(hX `DEFAULT`rh#}r(h%]rh']rh)]rh+]r h-]r!uhj h]r"h>XDEFAULTr#…r$}r%(hUhjubah!Utitle_referencer&ubh>X, object is a pre-created sentinel (actually r'…r(}r)(hX, object is a pre-created sentinel (actually r*hj ubj)r+}r,(hX`sentinel.DEFAULT`r-h#}r.(h%]r/h']r0h)]r1h+]r2h-]r3uhj h]r4h>Xsentinel.DEFAULTr5…r6}r7(hUhj+ubah!j&ubh>X). It can be used by r8…r9}r:(hX). It can be used by r;hj ubcsphinx.addnodes pending_xref r<)r=}r>(hX:attr:`~Mock.side_effect`r?hj hhh!U pending_xrefr@h#}rA(UreftyperBXattrrCUrefwarnrD‰U reftargetrEXMock.side_effectrFU refdomainrGXpyrHh+]rIh)]rJU refexplicitrK‰h%]rLh']rMh-]rNUrefdocrOUsentinelrPUpy:classrQNU py:modulerRh‚uh/K h]rSh´)rT}rU(hj?h#}rV(h%]rWh']rX(UxrefrYjHXpy-attrrZeh)]r[h+]r\h-]r]uhj=h]r^h>X side_effectr_…r`}ra(hUhjTubah!hÂubaubh>XC functions to indicate that the normal return value should be used.rb…rc}rd(hXC functions to indicate that the normal return value should be used.rehj ubeubaubeubh)rf}rg(hUhhhhh!h"h#}rh(h%]rih']rjh)]rkh+]rlhah-]rmhauh/K&h0hh]rn(h2)ro}rp(hXSentinel Examplerqhjfhhh!h6h#}rr(h%]rsh']rth)]ruh+]rvh-]rwuh/K&h0hh]rxh>XSentinel Examplery…rz}r{(hjqhjoubaubh¤)r|}r}(hXSometimes when testing you need to test that a specific object is passed as an argument to another method, or returned. It can be common to create named sentinel objects to test this. `sentinel` provides a convenient way of creating and testing the identity of objects like this.r~hjfhhh!h¨h#}r(h%]r€h']rh)]r‚h+]rƒh-]r„uh/K(h0hh]r…(h>X¸Sometimes when testing you need to test that a specific object is passed as an argument to another method, or returned. It can be common to create named sentinel objects to test this. r†…r‡}rˆ(hX¸Sometimes when testing you need to test that a specific object is passed as an argument to another method, or returned. It can be common to create named sentinel objects to test this. r‰hj|ubj)rŠ}r‹(hX `sentinel`rŒh#}r(h%]rŽh']rh)]rh+]r‘h-]r’uhj|h]r“h>Xsentinelr”…r•}r–(hUhjŠubah!j&ubh>XU provides a convenient way of creating and testing the identity of objects like this.r—…r˜}r™(hXU provides a convenient way of creating and testing the identity of objects like this.ršhj|ubeubh¤)r›}rœ(hXJIn this example we monkey patch `method` to return `sentinel.some_object`:rhjfhhh!h¨h#}rž(h%]rŸh']r h)]r¡h+]r¢h-]r£uh/K-h0hh]r¤(h>X In this example we monkey patch r¥…r¦}r§(hX In this example we monkey patch r¨hj›ubj)r©}rª(hX`method`r«h#}r¬(h%]r­h']r®h)]r¯h+]r°h-]r±uhj›h]r²h>Xmethodr³…r´}rµ(hUhj©ubah!j&ubh>X to return r¶…r·}r¸(hX to return r¹hj›ubj)rº}r»(hX`sentinel.some_object`r¼h#}r½(h%]r¾h']r¿h)]rÀh+]rÁh-]rÂuhj›h]rÃh>Xsentinel.some_objectrÄ…rÅ}rÆ(hUhjºubah!j&ubh>X:…rÇ}rÈ(hX:hj›ubeubcdocutils.nodes literal_block rÉ)rÊ}rË(hXé>>> real = ProductionClass() >>> real.method = Mock(name="method") >>> real.method.return_value = sentinel.some_object >>> result = real.method() >>> assert result is sentinel.some_object >>> sentinel.some_object sentinel.some_objectrÌhjfhhh!U literal_blockrÍh#}rÎ(U testnodetyperÏXdoctestrÐhJhKh+]rÑh)]rÒh%]rÓh']rÔh-]rÕUgroupsrÖ]r×hSahT}rØuh/K0h0hh]rÙh>Xé>>> real = ProductionClass() >>> real.method = Mock(name="method") >>> real.method.return_value = sentinel.some_object >>> result = real.method() >>> assert result is sentinel.some_object >>> sentinel.some_object sentinel.some_objectrÚ…rÛ}rÜ(hUhjÊubaubeubeubahUU transformerrÝNU footnote_refsrÞ}rßUrefnamesrà}ráUsymbol_footnotesrâ]rãUautofootnote_refsrä]råUsymbol_footnote_refsræ]rçU citationsrè]réh0hU current_linerêNUtransform_messagesrë]rìUreporterríNUid_startrîKU autofootnotesrï]rðU citation_refsrñ}ròUindirect_targetsró]rôUsettingsrõ(cdocutils.frontend Values röor÷}rø(Ufootnote_backlinksrùKUrecord_dependenciesrúNU rfc_base_urlrûUhttp://tools.ietf.org/html/rüU tracebackrýˆUpep_referencesrþNUstrip_commentsrÿNU toc_backlinksrUentryrU language_coderUenrU datestamprNU report_levelrKU _destinationrNU halt_levelrKU strip_classesrNh6NUerror_encoding_error_handlerr Ubackslashreplacer Udebugr NUembed_stylesheetr ‰Uoutput_encoding_error_handlerr UstrictrU sectnum_xformrKUdump_transformsrNU docinfo_xformrKUwarning_streamrNUpep_file_url_templaterUpep-%04drUexit_status_levelrKUconfigrNUstrict_visitorrNUcloak_email_addressesrˆUtrim_footnote_reference_spacer‰UenvrNUdump_pseudo_xmlrNUexpose_internalsrNUsectsubtitle_xformr‰U source_linkrNUrfc_referencesrNUoutput_encodingr Uutf-8r!U source_urlr"NUinput_encodingr#U utf-8-sigr$U_disable_configr%NU id_prefixr&UU tab_widthr'KUerror_encodingr(U mac-romanr)U_sourcer*U/compile/mock/docs/sentinel.txtr+Ugettext_compactr,ˆU generatorr-NUdump_internalsr.NU pep_base_urlr/Uhttp://www.python.org/dev/peps/r0Usyntax_highlightr1Ushortr2Uinput_encoding_error_handlerr3jUauto_id_prefixr4Uidr5Udoctitle_xformr6‰Ustrip_elements_with_classesr7NU _config_filesr8]r9Ufile_insertion_enabledr:KU raw_enabledr;KU dump_settingsr<NubUsymbol_footnote_startr=KUidsr>}r?(hhhhëh h{hjfuUsubstitution_namesr@}rAh!h0h#}rB(h%]rCh+]rDh)]rEUsourcerFhh']rGh-]rHuU footnotesrI]rJUrefidsrK}rLub.mock-1.0.1/html/_sources/0000755000076500001200000000000012046031032015726 5ustar michaeladmin00000000000000mock-1.0.1/html/_sources/changelog.txt0000644000076500001200000010017512046027306020433 0ustar michaeladmin00000000000000.. currentmodule:: mock CHANGELOG ========= 2012/11/5 Version 1.0.1 ----------------------- * Functions decorated with `patch` variants have a `__wrapped__` attribute pointing to the original function. This brings compatibility with the default behaviour in Python 3.3 (due to a new feature in `functools.wraps`). Note that due to changes in `tox`, `mock` is no longer tested with Python 2.4. The compatibility code has not been removed so it probably still works, but tests are no longer run. 2012/10/07 Version 1.0.0 ------------------------ No changes since 1.0.0 beta 1. This version has feature parity with `unittest.mock `_ in Python 3.3. Full list of changes since 0.8: * `mocksignature`, along with the `mocksignature` argument to `patch`, removed * Support for deleting attributes (accessing deleted attributes will raise an `AttributeError`) * Added the `mock_open` helper function for mocking the builtin `open` * `__class__` is assignable, so a mock can pass an `isinstance` check without requiring a spec * Addition of `PropertyMock`, for mocking properties * `MagicMocks` made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return `NotImplemented` * Propagate traceback info to support subclassing of `_patch` by other libraries * `create_autospec` works with attributes present in results of `dir` that can't be fetched from the object's class. Contributed by Konstantine Rybnikov * Any exceptions in an iterable `side_effect` will be raised instead of returned * In Python 3, `create_autospec` now supports keyword only arguments * Added `patch.stopall` method to stop all active patches created by `start` * BUGFIX: calling `MagicMock.reset_mock` wouldn't reset magic method mocks * BUGFIX: calling `reset_mock` on a `MagicMock` created with autospec could raise an exception * BUGFIX: passing multiple spec arguments to patchers (`spec` , `spec_set` and `autospec`) had unpredictable results, now it is an error * BUGFIX: using `spec=True` *and* `create=True` as arguments to patchers could result in using `DEFAULT` as the spec. Now it is an error instead * BUGFIX: using `spec` or `autospec` arguments to patchers, along with `spec_set=True` did not work correctly * BUGFIX: using an object that evaluates to False as a spec could be ignored * BUGFIX: a list as the `spec` argument to a patcher would always result in a non-callable mock. Now if `__call__` is in the spec the mock is callable 2012/07/13 Version 1.0.0 beta 1 -------------------------------- * Added `patch.stopall` method to stop all active patches created by `start` * BUGFIX: calling `MagicMock.reset_mock` wouldn't reset magic method mocks * BUGFIX: calling `reset_mock` on a `MagicMock` created with autospec could raise an exception 2012/05/04 Version 1.0.0 alpha 2 -------------------------------- * `PropertyMock` attributes are now standard `MagicMocks` * `create_autospec` works with attributes present in results of `dir` that can't be fetched from the object's class. Contributed by Konstantine Rybnikov * Any exceptions in an iterable `side_effect` will be raised instead of returned * In Python 3, `create_autospec` now supports keyword only arguments 2012/03/25 Version 1.0.0 alpha 1 -------------------------------- The standard library version! * `mocksignature`, along with the `mocksignature` argument to `patch`, removed * Support for deleting attributes (accessing deleted attributes will raise an `AttributeError`) * Added the `mock_open` helper function for mocking the builtin `open` * `__class__` is assignable, so a mock can pass an `isinstance` check without requiring a spec * Addition of `PropertyMock`, for mocking properties * `MagicMocks` made unorderable by default (in Python 3). The comparison methods (other than equality and inequality) now return `NotImplemented` * Propagate traceback info to support subclassing of `_patch` by other libraries * BUGFIX: passing multiple spec arguments to patchers (`spec` , `spec_set` and `autospec`) had unpredictable results, now it is an error * BUGFIX: using `spec=True` *and* `create=True` as arguments to patchers could result in using `DEFAULT` as the spec. Now it is an error instead * BUGFIX: using `spec` or `autospec` arguments to patchers, along with `spec_set=True` did not work correctly * BUGFIX: using an object that evaluates to False as a spec could be ignored * BUGFIX: a list as the `spec` argument to a patcher would always result in a non-callable mock. Now if `__call__` is in the spec the mock is callable 2012/02/13 Version 0.8.0 ------------------------ The only changes since 0.8rc2 are: * Improved repr of :data:`sentinel` objects * :data:`ANY` can be used for comparisons against :data:`call` objects * The return value of `MagicMock.__iter__` method can be set to any iterable and isn't required to be an iterator Full List of changes since 0.7: mock 0.8.0 is the last version that will support Python 2.4. * Addition of :attr:`~Mock.mock_calls` list for *all* calls (including magic methods and chained calls) * :func:`patch` and :func:`patch.object` now create a :class:`MagicMock` instead of a :class:`Mock` by default * The patchers (`patch`, `patch.object` and `patch.dict`), plus `Mock` and `MagicMock`, take arbitrary keyword arguments for configuration * New mock method :meth:`~Mock.configure_mock` for setting attributes and return values / side effects on the mock and its attributes * New mock assert methods :meth:`~Mock.assert_any_call` and :meth:`~Mock.assert_has_calls` * Implemented :ref:`auto-speccing` (recursive, lazy speccing of mocks with mocked signatures for functions/methods), as the `autospec` argument to `patch` * Added the :func:`create_autospec` function for manually creating 'auto-specced' mocks * :func:`patch.multiple` for doing multiple patches in a single call, using keyword arguments * Setting :attr:`~Mock.side_effect` to an iterable will cause calls to the mock to return the next value from the iterable * New `new_callable` argument to `patch` and `patch.object` allowing you to pass in a class or callable object (instead of `MagicMock`) that will be called to replace the object being patched * Addition of :class:`NonCallableMock` and :class:`NonCallableMagicMock`, mocks without a `__call__` method * Addition of :meth:`~Mock.mock_add_spec` method for adding (or changing) a spec on an existing mock * Protocol methods on :class:`MagicMock` are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a `MagicMock` instead of a `Mock` as it was previously * Addition of :meth:`~Mock.attach_mock` method * Added :data:`ANY` for ignoring arguments in :meth:`~Mock.assert_called_with` calls * Addition of :data:`call` helper object * Improved repr for mocks * Improved repr for :attr:`Mock.call_args` and entries in :attr:`Mock.call_args_list`, :attr:`Mock.method_calls` and :attr:`Mock.mock_calls` * Improved repr for :data:`sentinel` objects * `patch` lookup is done at use time not at decoration time * In Python 2.6 or more recent, `dir` on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes. * Module level :data:`FILTER_DIR` added to control whether `dir(mock)` filters private attributes. `True` by default. * `patch.TEST_PREFIX` for controlling how patchers recognise test methods when used to decorate a class * Support for using Java exceptions as a :attr:`~Mock.side_effect` on Jython * `Mock` call lists (`call_args_list`, `method_calls` & `mock_calls`) are now custom list objects that allow membership tests for "sub lists" and have a nicer representation if you `str` or `print` them * Mocks attached as attributes or return values to other mocks have calls recorded in `method_calls` and `mock_calls` of the parent (unless a name is already set on the child) * Improved failure messages for `assert_called_with` and `assert_called_once_with` * The return value of the :class:`MagicMock` `__iter__` method can be set to any iterable and isn't required to be an iterator * Added the Mock API (`assert_called_with` etc) to functions created by :func:`mocksignature` * Tuples as well as lists can be used to specify allowed methods for `spec` & `spec_set` arguments * Calling `stop` on an unstarted patcher fails with a more meaningful error message * Renamed the internal classes `Sentinel` and `SentinelObject` to prevent abuse * BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in place * BUGFIX: `__truediv__` and `__rtruediv__` not available as magic methods on mocks in Python 3 * BUGFIX: `assert_called_with` / `assert_called_once_with` can be used with `self` as a keyword argument * BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance") * BUGFIX: remove the `__unittest` marker causing traceback truncation * Removal of deprecated `patch_object` * Private attributes `_name`, `_methods`, '_children', `_wraps` and `_parent` (etc) renamed to reduce likelihood of clash with user attributes. * Added license file to the distribution 2012/01/10 Version 0.8.0 release candidate 2 -------------------------------------------- * Removed the `configure` keyword argument to `create_autospec` and allow arbitrary keyword arguments (for the `Mock` constructor) instead * Fixed `ANY` equality with some types in `assert_called_with` calls * Switched to a standard Sphinx theme (compatible with `readthedocs.org `_) 2011/12/29 Version 0.8.0 release candidate 1 -------------------------------------------- * `create_autospec` on the return value of a mocked class will use `__call__` for the signature rather than `__init__` * Performance improvement instantiating `Mock` and `MagicMock` * Mocks used as magic methods have the same type as their parent instead of being hardcoded to `MagicMock` Special thanks to Julian Berman for his help with diagnosing and improving performance in this release. 2011/10/09 Version 0.8.0 beta 4 ------------------------------- * `patch` lookup is done at use time not at decoration time * When attaching a Mock to another Mock as a magic method, calls are recorded in mock_calls * Addition of `attach_mock` method * Renamed the internal classes `Sentinel` and `SentinelObject` to prevent abuse * BUGFIX: various issues around circular references with mocks (setting a mock return value to be itself etc) 2011/08/15 Version 0.8.0 beta 3 ------------------------------- * Mocks attached as attributes or return values to other mocks have calls recorded in `method_calls` and `mock_calls` of the parent (unless a name is already set on the child) * Addition of `mock_add_spec` method for adding (or changing) a spec on an existing mock * Improved repr for `Mock.call_args` and entries in `Mock.call_args_list`, `Mock.method_calls` and `Mock.mock_calls` * Improved repr for mocks * BUGFIX: minor fixes in the way `mock_calls` is worked out, especially for "intermediate" mocks in a call chain 2011/08/05 Version 0.8.0 beta 2 ------------------------------- * Setting `side_effect` to an iterable will cause calls to the mock to return the next value from the iterable * Added `assert_any_call` method * Moved `assert_has_calls` from call lists onto mocks * BUGFIX: `call_args` and all members of `call_args_list` are two tuples of `(args, kwargs)` again instead of three tuples of `(name, args, kwargs)` 2011/07/25 Version 0.8.0 beta 1 ------------------------------- * `patch.TEST_PREFIX` for controlling how patchers recognise test methods when used to decorate a class * `Mock` call lists (`call_args_list`, `method_calls` & `mock_calls`) are now custom list objects that allow membership tests for "sub lists" and have an `assert_has_calls` method for unordered call checks * `callargs` changed to *always* be a three-tuple of `(name, args, kwargs)` * Addition of `mock_calls` list for *all* calls (including magic methods and chained calls) * Extension of `call` object to support chained calls and `callargs` for better comparisons with or without names. `call` object has a `call_list` method for chained calls * Added the public `instance` argument to `create_autospec` * Support for using Java exceptions as a `side_effect` on Jython * Improved failure messages for `assert_called_with` and `assert_called_once_with` * Tuples as well as lists can be used to specify allowed methods for `spec` & `spec_set` arguments * BUGFIX: Fixed bug in `patch.multiple` for argument passing when creating mocks * Added license file to the distribution 2011/07/16 Version 0.8.0 alpha 2 -------------------------------- * `patch.multiple` for doing multiple patches in a single call, using keyword arguments * New `new_callable` argument to `patch` and `patch.object` allowing you to pass in a class or callable object (instead of `MagicMock`) that will be called to replace the object being patched * Addition of `NonCallableMock` and `NonCallableMagicMock`, mocks without a `__call__` method * Mocks created by `patch` have a `MagicMock` as the `return_value` where a class is being patched * `create_autospec` can create non-callable mocks for non-callable objects. `return_value` mocks of classes will be non-callable unless the class has a `__call__` method * `autospec` creates a `MagicMock` without a spec for properties and slot descriptors, because we don't know the type of object they return * Removed the "inherit" argument from `create_autospec` * Calling `stop` on an unstarted patcher fails with a more meaningful error message * BUGFIX: an error creating a patch, with nested patch decorators, won't leave patches in place * BUGFIX: `__truediv__` and `__rtruediv__` not available as magic methods on mocks in Python 3 * BUGFIX: `assert_called_with` / `assert_called_once_with` can be used with `self` as a keyword argument * BUGFIX: autospec for functions / methods with an argument named self that isn't the first argument no longer broken * BUGFIX: when patching a class with an explicit spec / spec_set (not a boolean) it applies "spec inheritance" to the return value of the created mock (the "instance") * BUGFIX: remove the `__unittest` marker causing traceback truncation 2011/06/14 Version 0.8.0 alpha 1 -------------------------------- mock 0.8.0 is the last version that will support Python 2.4. * The patchers (`patch`, `patch.object` and `patch.dict`), plus `Mock` and `MagicMock`, take arbitrary keyword arguments for configuration * New mock method `configure_mock` for setting attributes and return values / side effects on the mock and its attributes * In Python 2.6 or more recent, `dir` on a mock will report all the dynamically created attributes (or the full list of attributes if there is a spec) as well as all the mock methods and attributes. * Module level `FILTER_DIR` added to control whether `dir(mock)` filters private attributes. `True` by default. Note that `vars(Mock())` can still be used to get all instance attributes and `dir(type(Mock())` will still return all the other attributes (irrespective of `FILTER_DIR`) * `patch` and `patch.object` now create a `MagicMock` instead of a `Mock` by default * Added `ANY` for ignoring arguments in `assert_called_with` calls * Addition of `call` helper object * Protocol methods on `MagicMock` are magic mocks, and are created lazily on first lookup. This means the result of calling a protocol method is a MagicMock instead of a Mock as it was previously * Added the Mock API (`assert_called_with` etc) to functions created by `mocksignature` * Private attributes `_name`, `_methods`, '_children', `_wraps` and `_parent` (etc) renamed to reduce likelihood of clash with user attributes. * Implemented auto-speccing (recursive, lazy speccing of mocks with mocked signatures for functions/methods) Limitations: - Doesn't mock magic methods or attributes (it creates MagicMocks, so the magic methods are *there*, they just don't have the signature mocked nor are attributes followed) - Doesn't mock function / method attributes - Uses object traversal on the objects being mocked to determine types - so properties etc may be triggered - The return value of mocked classes (the 'instance') has the same call signature as the class __init__ (as they share the same spec) You create auto-specced mocks by passing `autospec=True` to `patch`. Note that attributes that are None are special cased and mocked without a spec (so any attribute / method can be used). This is because None is typically used as a default value for attributes that may be of some other type, and as we don't know what type that may be we allow all access. Note that the `autospec` option to `patch` obsoletes the `mocksignature` option. * Added the `create_autospec` function for manually creating 'auto-specced' mocks * Removal of deprecated `patch_object` 2011/05/30 Version 0.7.2 ------------------------ * BUGFIX: instances of list subclasses can now be used as mock specs * BUGFIX: MagicMock equality / inequality protocol methods changed to use the default equality / inequality. This is done through a `side_effect` on the mocks used for `__eq__` / `__ne__` 2011/05/06 Version 0.7.1 ------------------------ Package fixes contributed by Michael Fladischer. No code changes. * Include template in package * Use isolated binaries for the tox tests * Unset executable bit on docs * Fix DOS line endings in getting-started.txt 2011/03/05 Version 0.7.0 ------------------------ No API changes since 0.7.0 rc1. Many documentation changes including a stylish new `Sphinx theme `_. The full set of changes since 0.6.0 are: * Python 3 compatibility * Ability to mock magic methods with `Mock` and addition of `MagicMock` with pre-created magic methods * Addition of `mocksignature` and `mocksignature` argument to `patch` and `patch.object` * Addition of `patch.dict` for changing dictionaries during a test * Ability to use `patch`, `patch.object` and `patch.dict` as class decorators * Renamed ``patch_object`` to `patch.object` (``patch_object`` is deprecated) * Addition of soft comparisons: `call_args`, `call_args_list` and `method_calls` now return tuple-like objects which compare equal even when empty args or kwargs are skipped * patchers (`patch`, `patch.object` and `patch.dict`) have start and stop methods * Addition of `assert_called_once_with` method * Mocks can now be named (`name` argument to constructor) and the name is used in the repr * repr of a mock with a spec includes the class name of the spec * `assert_called_with` works with `python -OO` * New `spec_set` keyword argument to `Mock` and `patch`. If used, attempting to *set* an attribute on a mock not on the spec will raise an `AttributeError` * Mocks created with a spec can now pass `isinstance` tests (`__class__` returns the type of the spec) * Added docstrings to all objects * Improved failure message for `Mock.assert_called_with` when the mock has not been called at all * Decorated functions / methods have their docstring and `__module__` preserved on Python 2.4. * BUGFIX: `mock.patch` now works correctly with certain types of objects that proxy attribute access, like the django settings object * BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this) * BUGFIX: `spec=True` works with old style classes * BUGFIX: ``help(mock)`` works now (on the module). Can no longer use ``__bases__`` as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this) * BUGFIX: ``side_effect`` now works with ``BaseException`` exceptions like ``KeyboardInterrupt`` * BUGFIX: `reset_mock` caused infinite recursion when a mock is set as its own return value * BUGFIX: patching the same object twice now restores the patches correctly * with statement tests now skipped on Python 2.4 * Tests require unittest2 (or unittest2-py3k) to run * Tested with `tox `_ on Python 2.4 - 3.2, jython and pypy (excluding 3.0) * Added 'build_sphinx' command to setup.py (requires setuptools or distribute) Thanks to Florian Bauer * Switched from subversion to mercurial for source code control * `Konrad Delong `_ added as co-maintainer 2011/02/16 Version 0.7.0 RC 1 ----------------------------- Changes since beta 4: * Tested with jython, pypy and Python 3.2 and 3.1 * Decorated functions / methods have their docstring and `__module__` preserved on Python 2.4 * BUGFIX: `mock.patch` now works correctly with certain types of objects that proxy attribute access, like the django settings object * BUGFIX: `reset_mock` caused infinite recursion when a mock is set as its own return value 2010/11/12 Version 0.7.0 beta 4 ------------------------------- * patchers (`patch`, `patch.object` and `patch.dict`) have start and stop methods * Addition of `assert_called_once_with` method * repr of a mock with a spec includes the class name of the spec * `assert_called_with` works with `python -OO` * New `spec_set` keyword argument to `Mock` and `patch`. If used, attempting to *set* an attribute on a mock not on the spec will raise an `AttributeError` * Attributes and return value of a `MagicMock` are `MagicMock` objects * Attempting to set an unsupported magic method now raises an `AttributeError` * `patch.dict` works as a class decorator * Switched from subversion to mercurial for source code control * BUGFIX: mocks are now copyable (thanks to Ned Batchelder for reporting and diagnosing this) * BUGFIX: `spec=True` works with old style classes * BUGFIX: `mocksignature=True` can now patch instance methods via `patch.object` 2010/09/18 Version 0.7.0 beta 3 ------------------------------- * Using spec with :class:`MagicMock` only pre-creates magic methods in the spec * Setting a magic method on a mock with a ``spec`` can only be done if the spec has that method * Mocks can now be named (`name` argument to constructor) and the name is used in the repr * `mocksignature` can now be used with classes (signature based on `__init__`) and callable objects (signature based on `__call__`) * Mocks created with a spec can now pass `isinstance` tests (`__class__` returns the type of the spec) * Default numeric value for MagicMock is 1 rather than zero (because the MagicMock bool defaults to True and 0 is False) * Improved failure message for :meth:`~Mock.assert_called_with` when the mock has not been called at all * Adding the following to the set of supported magic methods: - ``__getformat__`` and ``__setformat__`` - pickle methods - ``__trunc__``, ``__ceil__`` and ``__floor__`` - ``__sizeof__`` * Added 'build_sphinx' command to setup.py (requires setuptools or distribute) Thanks to Florian Bauer * with statement tests now skipped on Python 2.4 * Tests require unittest2 to run on Python 2.7 * Improved several docstrings and documentation 2010/06/23 Version 0.7.0 beta 2 ------------------------------- * :func:`patch.dict` works as a context manager as well as a decorator * ``patch.dict`` takes a string to specify dictionary as well as a dictionary object. If a string is supplied the name specified is imported * BUGFIX: ``patch.dict`` restores dictionary even when an exception is raised 2010/06/22 Version 0.7.0 beta 1 ------------------------------- * Addition of :func:`mocksignature` * Ability to mock magic methods * Ability to use ``patch`` and ``patch.object`` as class decorators * Renamed ``patch_object`` to :func:`patch.object` (``patch_object`` is deprecated) * Addition of :class:`MagicMock` class with all magic methods pre-created for you * Python 3 compatibility (tested with 3.2 but should work with 3.0 & 3.1 as well) * Addition of :func:`patch.dict` for changing dictionaries during a test * Addition of ``mocksignature`` argument to ``patch`` and ``patch.object`` * ``help(mock)`` works now (on the module). Can no longer use ``__bases__`` as a valid sentinel name (thanks to Stephen Emslie for reporting and diagnosing this) * Addition of soft comparisons: `call_args`, `call_args_list` and `method_calls` now return tuple-like objects which compare equal even when empty args or kwargs are skipped * Added docstrings. * BUGFIX: ``side_effect`` now works with ``BaseException`` exceptions like ``KeyboardInterrupt`` * BUGFIX: patching the same object twice now restores the patches correctly * The tests now require `unittest2 `_ to run * `Konrad Delong `_ added as co-maintainer 2009/08/22 Version 0.6.0 ------------------------ * New test layout compatible with test discovery * Descriptors (static methods / class methods etc) can now be patched and restored correctly * Mocks can raise exceptions when called by setting ``side_effect`` to an exception class or instance * Mocks that wrap objects will not pass on calls to the underlying object if an explicit return_value is set 2009/04/17 Version 0.5.0 ------------------------ * Made DEFAULT part of the public api. * Documentation built with Sphinx. * ``side_effect`` is now called with the same arguments as the mock is called with and if returns a non-DEFAULT value that is automatically set as the ``mock.return_value``. * ``wraps`` keyword argument used for wrapping objects (and passing calls through to the wrapped object). * ``Mock.reset`` renamed to ``Mock.reset_mock``, as reset is a common API name. * ``patch`` / ``patch_object`` are now context managers and can be used with ``with``. * A new 'create' keyword argument to patch and patch_object that allows them to patch (and unpatch) attributes that don't exist. (Potentially unsafe to use - it can allow you to have tests that pass when they are testing an API that doesn't exist - use at your own risk!) * The methods keyword argument to Mock has been removed and merged with spec. The spec argument can now be a list of methods or an object to take the spec from. * Nested patches may now be applied in a different order (created mocks passed in the opposite order). This is actually a bugfix. * patch and patch_object now take a spec keyword argument. If spec is passed in as 'True' then the Mock created will take the object it is replacing as its spec object. If the object being replaced is a class, then the return value for the mock will also use the class as a spec. * A Mock created without a spec will not attempt to mock any magic methods / attributes (they will raise an ``AttributeError`` instead). 2008/10/12 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) * Can now patch objects with ``None`` * 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). Thanks to Konrad Delong, Kevin Dangoor and others for patches and suggestions. 2007/12/03 Version 0.3.1 ------------------------- ``patch`` maintains the name of decorated functions for compatibility with nose test autodiscovery. Tests decorated with ``patch`` that use the two argument form (implicit mock creation) will receive the mock(s) passed in as extra arguments. Thanks to Kevin Dangoor for these changes. 2007/11/30 Version 0.3.0 ------------------------- Removed ``patch_module``. ``patch`` can now take a string as the first argument for patching modules. 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 ------------------------- 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. Added ``sentinel`` for convenient access to unique objects. Distribution includes unit tests. 2007/11/19 Version 0.1.0 ------------------------- Initial release. TODO and Limitations ==================== Contributions, bug reports and comments welcomed! Feature requests and bug reports are handled on the issue tracker: * `mock issue tracker `_ `wraps` is not integrated with magic methods. `patch` could auto-do the patching in the constructor and unpatch in the destructor. This would be useful in itself, but violates TOOWTDI and would be unsafe for IronPython & PyPy (non-deterministic calling of destructors). Destructors aren't called in CPython where there are cycles, but a weak reference with a callback can be used to get round this. `Mock` has several attributes. This makes it unsuitable for mocking objects that use these attribute names. A way round this would be to provide methods that *hide* these attributes when needed. In 0.8 many, but not all, of these attributes are renamed to gain a `_mock` prefix, making it less likely that they will clash. Any outstanding attributes that haven't been modified with the prefix should be changed. If a patch is started using `patch.start` and then not stopped correctly then the unpatching is not done. Using weak references it would be possible to detect and fix this when the patch object itself is garbage collected. This would be tricky to get right though. When a `Mock` is created by `patch`, arbitrary keywords can be used to set attributes. If `patch` is created with a `spec`, and is replacing a class, then a `return_value` mock is created. The keyword arguments are not applied to the child mock, but could be. When mocking a class with `patch`, passing in `spec=True` or `autospec=True`, the mock class has an instance created from the same spec. Should this be the default behaviour for mocks anyway (mock return values inheriting the spec from their parent), or should it be controlled by an additional keyword argument (`inherit`) to the Mock constructor? `create_autospec` does this, so an additional keyword argument to Mock is probably unnecessary. The `mocksignature` argument to `patch` with a non `Mock` passed into `new_callable` will *probably* cause an error. Should it just be invalid? Note that `NonCallableMock` and `NonCallableMagicMock` still have the unused (and unusable) attributes: `return_value`, `side_effect`, `call_count`, `call_args` and `call_args_list`. These could be removed or raise errors on getting / setting. They also have the `assert_called_with` and `assert_called_once_with` methods. Removing these would be pointless as fetching them would create a mock (attribute) that could be called without error. Some outstanding technical debt. The way autospeccing mocks function signatures was copied and modified from `mocksignature`. This could all be refactored into one set of functions instead of two. The way we tell if patchers are started and if a patcher is being used for a `patch.multiple` call are both horrible. There are now a host of helper functions that should be rationalised. (Probably time to split mock into a package instead of a module.) Passing arbitrary keyword arguments to `create_autospec`, or `patch` with `autospec`, when mocking a *function* works fine. However, the arbitrary attributes are set on the created mock - but `create_autospec` returns a real function (which doesn't have those attributes). However, what is the use case for using autospec to create functions with attributes that don't exist on the original? `mocksignature`, plus the `call_args_list` and `method_calls` attributes of `Mock` could all be deprecated. mock-1.0.1/html/_sources/compare.txt0000644000076500001200000004116611677634532020154 0ustar michaeladmin00000000000000========================= Mock Library Comparison ========================= .. testsetup:: def assertEqual(a, b): assert a == b, ("%r != %r" % (a, b)) def assertRaises(Exc, func): try: func() except Exc: return assert False, ("%s not raised" % Exc) sys.modules['somemodule'] = somemodule = mock.Mock(name='somemodule') class SomeException(Exception): some_method = method1 = method2 = None some_other_object = SomeObject = SomeException A side-by-side comparison of how to accomplish some basic tasks with mock and some other popular Python mocking libraries and frameworks. These are: * `flexmock `_ * `mox `_ * `Mocker `_ * `dingus `_ * `fudge `_ Popular python mocking frameworks not yet represented here include `MiniMock `_. `pMock `_ (last release 2004 and doesn't import in recent versions of Python) and `python-mock `_ (last release 2005) are intentionally omitted. .. note:: A more up to date, and tested for all mock libraries (only the mock examples on this page can be executed as doctests) version of this comparison is maintained by Gary Bernhardt: * `Python Mock Library Comparison `_ This comparison is by no means complete, and also may not be fully idiomatic for all the libraries represented. *Please* contribute corrections, missing comparisons, or comparisons for additional libraries to the `mock issue tracker `_. This comparison page was originally created by the `Mox project `_ and then extended for `flexmock and mock `_ by Herman Sheremetyev. Dingus examples written by `Gary Bernhadt `_. fudge examples provided by `Kumar McMillan `_. .. note:: The examples tasks here were originally created by Mox which is a mocking *framework* rather than a library like mock. The tasks shown naturally exemplify tasks that frameworks are good at and not the ones they make harder. In particular you can take a `Mock` or `MagicMock` object and use it in any way you want with no up-front configuration. The same is also true for Dingus. The examples for mock here assume version 0.7.0. Simple fake object ~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.return_value = "calculated value" >>> my_mock.some_attribute = "value" >>> assertEqual("calculated value", my_mock.some_method()) >>> assertEqual("value", my_mock.some_attribute) :: # Flexmock mock = flexmock(some_method=lambda: "calculated value", some_attribute="value") assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) # Mox mock = mox.MockAnything() mock.some_method().AndReturn("calculated value") mock.some_attribute = "value" mox.Replay(mock) assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) # Mocker mock = mocker.mock() mock.some_method() mocker.result("calculated value") mocker.replay() mock.some_attribute = "value" assertEqual("calculated value", mock.some_method()) assertEqual("value", mock.some_attribute) :: >>> # Dingus >>> my_dingus = dingus.Dingus(some_attribute="value", ... some_method__returns="calculated value") >>> assertEqual("calculated value", my_dingus.some_method()) >>> assertEqual("value", my_dingus.some_attribute) :: >>> # fudge >>> my_fake = (fudge.Fake() ... .provides('some_method') ... .returns("calculated value") ... .has_attr(some_attribute="value")) ... >>> assertEqual("calculated value", my_fake.some_method()) >>> assertEqual("value", my_fake.some_attribute) Simple mock ~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.return_value = "value" >>> assertEqual("value", my_mock.some_method()) >>> my_mock.some_method.assert_called_once_with() :: # Flexmock mock = flexmock() mock.should_receive("some_method").and_return("value").once assertEqual("value", mock.some_method()) # Mox mock = mox.MockAnything() mock.some_method().AndReturn("value") mox.Replay(mock) assertEqual("value", mock.some_method()) mox.Verify(mock) # Mocker mock = mocker.mock() mock.some_method() mocker.result("value") mocker.replay() assertEqual("value", mock.some_method()) mocker.verify() :: >>> # Dingus >>> my_dingus = dingus.Dingus(some_method__returns="value") >>> assertEqual("value", my_dingus.some_method()) >>> assert my_dingus.some_method.calls().once() :: >>> # fudge >>> @fudge.test ... def test(): ... my_fake = (fudge.Fake() ... .expects('some_method') ... .returns("value") ... .times_called(1)) ... >>> test() Traceback (most recent call last): ... AssertionError: fake:my_fake.some_method() was not called Creating partial mocks ~~~~~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> SomeObject.some_method = mock.Mock(return_value='value') >>> assertEqual("value", SomeObject.some_method()) :: # Flexmock flexmock(SomeObject).should_receive("some_method").and_return('value') assertEqual("value", mock.some_method()) # Mox mock = mox.MockObject(SomeObject) mock.some_method().AndReturn("value") mox.Replay(mock) assertEqual("value", mock.some_method()) mox.Verify(mock) # Mocker mock = mocker.mock(SomeObject) mock.Get() mocker.result("value") mocker.replay() assertEqual("value", mock.some_method()) mocker.verify() :: >>> # Dingus >>> object = SomeObject >>> object.some_method = dingus.Dingus(return_value="value") >>> assertEqual("value", object.some_method()) :: >>> # fudge >>> fake = fudge.Fake().is_callable().returns("") >>> with fudge.patched_context(SomeObject, 'some_method', fake): ... s = SomeObject() ... assertEqual("", s.some_method()) ... Ensure calls are made in specific order ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock(spec=SomeObject) >>> my_mock.method1() >>> my_mock.method2() >>> assertEqual(my_mock.mock_calls, [call.method1(), call.method2()]) :: # Flexmock mock = flexmock(SomeObject) mock.should_receive('method1').once.ordered.and_return('first thing') mock.should_receive('method2').once.ordered.and_return('second thing') # Mox mock = mox.MockObject(SomeObject) mock.method1().AndReturn('first thing') mock.method2().AndReturn('second thing') mox.Replay(mock) mox.Verify(mock) # Mocker mock = mocker.mock() with mocker.order(): mock.method1() mocker.result('first thing') mock.method2() mocker.result('second thing') mocker.replay() mocker.verify() :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.method1() >>> my_dingus.method2() >>> assertEqual(['method1', 'method2'], [call.name for call in my_dingus.calls]) :: >>> # fudge >>> @fudge.test ... def test(): ... my_fake = (fudge.Fake() ... .remember_order() ... .expects('method1') ... .expects('method2')) ... my_fake.method2() ... my_fake.method1() ... >>> test() Traceback (most recent call last): ... AssertionError: Call #1 was fake:my_fake.method2(); Expected: #1 fake:my_fake.method1(), #2 fake:my_fake.method2(), end Raising exceptions ~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method.side_effect = SomeException("message") >>> assertRaises(SomeException, my_mock.some_method) :: # Flexmock mock = flexmock() mock.should_receive("some_method").and_raise(SomeException("message")) assertRaises(SomeException, mock.some_method) # Mox mock = mox.MockAnything() mock.some_method().AndRaise(SomeException("message")) mox.Replay(mock) assertRaises(SomeException, mock.some_method) mox.Verify(mock) # Mocker mock = mocker.mock() mock.some_method() mocker.throw(SomeException("message")) mocker.replay() assertRaises(SomeException, mock.some_method) mocker.verify() :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.some_method = dingus.exception_raiser(SomeException) >>> assertRaises(SomeException, my_dingus.some_method) :: >>> # fudge >>> my_fake = (fudge.Fake() ... .is_callable() ... .raises(SomeException("message"))) ... >>> my_fake() Traceback (most recent call last): ... SomeException: message Override new instances of a class ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> with mock.patch('somemodule.Someclass') as MockClass: ... MockClass.return_value = some_other_object ... assertEqual(some_other_object, somemodule.Someclass()) ... :: # Flexmock flexmock(some_module.SomeClass, new_instances=some_other_object) assertEqual(some_other_object, some_module.SomeClass()) # Mox # (you will probably have mox.Mox() available as self.mox in a real test) mox.Mox().StubOutWithMock(some_module, 'SomeClass', use_mock_anything=True) some_module.SomeClass().AndReturn(some_other_object) mox.ReplayAll() assertEqual(some_other_object, some_module.SomeClass()) # Mocker instance = mocker.mock() klass = mocker.replace(SomeClass, spec=None) klass('expected', 'args') mocker.result(instance) :: >>> # Dingus >>> MockClass = dingus.Dingus(return_value=some_other_object) >>> with dingus.patch('somemodule.SomeClass', MockClass): ... assertEqual(some_other_object, somemodule.SomeClass()) ... :: >>> # fudge >>> @fudge.patch('somemodule.SomeClass') ... def test(FakeClass): ... FakeClass.is_callable().returns(some_other_object) ... assertEqual(some_other_object, somemodule.SomeClass()) ... >>> test() Call the same method multiple times ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. note:: You don't need to do *any* configuration to call `mock.Mock()` methods multiple times. Attributes like `call_count`, `call_args_list` and `method_calls` provide various different ways of making assertions about how the mock was used. .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> my_mock.some_method() >>> my_mock.some_method() >>> assert my_mock.some_method.call_count >= 2 :: # Flexmock # (verifies that the method gets called at least twice) flexmock(some_object).should_receive('some_method').at_least.twice # Mox # (does not support variable number of calls, so you need to create a new entry for each explicit call) mock = mox.MockObject(some_object) mock.some_method(mox.IgnoreArg(), mox.IgnoreArg()) mock.some_method(mox.IgnoreArg(), mox.IgnoreArg()) mox.Replay(mock) mox.Verify(mock) # Mocker # (TODO) :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> my_dingus.some_method() >>> my_dingus.some_method() >>> assert len(my_dingus.calls('some_method')) == 2 :: >>> # fudge >>> @fudge.test ... def test(): ... my_fake = fudge.Fake().expects('some_method').times_called(2) ... my_fake.some_method() ... >>> test() Traceback (most recent call last): ... AssertionError: fake:my_fake.some_method() was called 1 time(s). Expected 2. Mock chained methods ~~~~~~~~~~~~~~~~~~~~ .. doctest:: >>> # mock >>> my_mock = mock.Mock() >>> method3 = my_mock.method1.return_value.method2.return_value.method3 >>> method3.return_value = 'some value' >>> assertEqual('some value', my_mock.method1().method2().method3(1, 2)) >>> method3.assert_called_once_with(1, 2) :: # Flexmock # (intermediate method calls are automatically assigned to temporary fake objects # and can be called with any arguments) flexmock(some_object).should_receive( 'method1.method2.method3' ).with_args(arg1, arg2).and_return('some value') assertEqual('some_value', some_object.method1().method2().method3(arg1, arg2)) :: # Mox mock = mox.MockObject(some_object) mock2 = mox.MockAnything() mock3 = mox.MockAnything() mock.method1().AndReturn(mock1) mock2.method2().AndReturn(mock2) mock3.method3(arg1, arg2).AndReturn('some_value') self.mox.ReplayAll() assertEqual("some_value", some_object.method1().method2().method3(arg1, arg2)) self.mox.VerifyAll() # Mocker # (TODO) :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> method3 = my_dingus.method1.return_value.method2.return_value.method3 >>> method3.return_value = 'some value' >>> assertEqual('some value', my_dingus.method1().method2().method3(1, 2)) >>> assert method3.calls('()', 1, 2).once() :: >>> # fudge >>> @fudge.test ... def test(): ... my_fake = fudge.Fake() ... (my_fake ... .expects('method1') ... .returns_fake() ... .expects('method2') ... .returns_fake() ... .expects('method3') ... .with_args(1, 2) ... .returns('some value')) ... assertEqual('some value', my_fake.method1().method2().method3(1, 2)) ... >>> test() Mocking a context manager ~~~~~~~~~~~~~~~~~~~~~~~~~ Examples for mock, Dingus and fudge only (so far): .. doctest:: >>> # mock >>> my_mock = mock.MagicMock() >>> with my_mock: ... pass ... >>> my_mock.__enter__.assert_called_with() >>> my_mock.__exit__.assert_called_with(None, None, None) :: >>> # Dingus (nothing special here; all dinguses are "magic mocks") >>> my_dingus = dingus.Dingus() >>> with my_dingus: ... pass ... >>> assert my_dingus.__enter__.calls() >>> assert my_dingus.__exit__.calls('()', None, None, None) :: >>> # fudge >>> my_fake = fudge.Fake().provides('__enter__').provides('__exit__') >>> with my_fake: ... pass ... Mocking the builtin open used as a context manager ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Example for mock only (so far): .. doctest:: >>> # mock >>> my_mock = mock.MagicMock() >>> with mock.patch('__builtin__.open', my_mock): ... manager = my_mock.return_value.__enter__.return_value ... manager.read.return_value = 'some data' ... with open('foo') as h: ... data = h.read() ... >>> data 'some data' >>> my_mock.assert_called_once_with('foo') *or*: .. doctest:: >>> # mock >>> with mock.patch('__builtin__.open') as my_mock: ... my_mock.return_value.__enter__ = lambda s: s ... my_mock.return_value.__exit__ = mock.Mock() ... my_mock.return_value.read.return_value = 'some data' ... with open('foo') as h: ... data = h.read() ... >>> data 'some data' >>> my_mock.assert_called_once_with('foo') :: >>> # Dingus >>> my_dingus = dingus.Dingus() >>> with dingus.patch('__builtin__.open', my_dingus): ... file_ = open.return_value.__enter__.return_value ... file_.read.return_value = 'some data' ... with open('foo') as h: ... data = f.read() ... >>> data 'some data' >>> assert my_dingus.calls('()', 'foo').once() :: >>> # fudge >>> from contextlib import contextmanager >>> from StringIO import StringIO >>> @contextmanager ... def fake_file(filename): ... yield StringIO('sekrets') ... >>> with fudge.patch('__builtin__.open') as fake_open: ... fake_open.is_callable().calls(fake_file) ... with open('/etc/password') as f: ... data = f.read() ... fake:__builtin__.open >>> data 'sekrets'mock-1.0.1/html/_sources/examples.txt0000644000076500001200000010646311745371250020335 0ustar michaeladmin00000000000000.. _further-examples: ================== Further Examples ================== .. currentmodule:: mock .. testsetup:: from datetime import date BackendProvider = Mock() sys.modules['mymodule'] = mymodule = Mock(name='mymodule') def grob(val): "First frob and then clear val" mymodule.frob(val) val.clear() mymodule.frob = lambda val: val mymodule.grob = grob mymodule.date = date class TestCase(unittest2.TestCase): def run(self): result = unittest2.TestResult() out = unittest2.TestCase.run(self, result) assert result.wasSuccessful() from mock import inPy3k For comprehensive examples, see the unit tests included in the full source distribution. Here are some more examples for some slightly more advanced scenarios than in the :ref:`getting started ` guide. Mocking chained calls ===================== Mocking chained calls is actually straightforward with mock once you understand the :attr:`~Mock.return_value` attribute. When a mock is called for the first time, or you fetch its `return_value` before it has been called, a new `Mock` is created. This means that you can see how the object returned from a call to a mocked object has been used by interrogating the `return_value` mock: .. doctest:: >>> mock = Mock() >>> mock().foo(a=2, b=3) >>> mock.return_value.foo.assert_called_with(a=2, b=3) From here it is a simple step to configure and then make assertions about chained calls. Of course another alternative is writing your code in a more testable way in the first place... So, suppose we have some code that looks a little bit like this: .. doctest:: >>> class Something(object): ... def __init__(self): ... self.backend = BackendProvider() ... def method(self): ... response = self.backend.get_endpoint('foobar').create_call('spam', 'eggs').start_call() ... # more code Assuming that `BackendProvider` is already well tested, how do we test `method()`? Specifically, we want to test that the code section `# more code` uses the response object in the correct way. As this chain of calls is made from an instance attribute we can monkey patch the `backend` attribute on a `Something` instance. In this particular case we are only interested in the return value from the final call to `start_call` so we don't have much configuration to do. Let's assume the object it returns is 'file-like', so we'll ensure that our response object uses the builtin `file` as its `spec`. To do this we create a mock instance as our mock backend and create a mock response object for it. To set the response as the return value for that final `start_call` we could do this: `mock_backend.get_endpoint.return_value.create_call.return_value.start_call.return_value = mock_response`. We can do that in a slightly nicer way using the :meth:`~Mock.configure_mock` method to directly set the return value for us: .. doctest:: >>> something = Something() >>> mock_response = Mock(spec=file) >>> mock_backend = Mock() >>> config = {'get_endpoint.return_value.create_call.return_value.start_call.return_value': mock_response} >>> mock_backend.configure_mock(**config) With these we monkey patch the "mock backend" in place and can make the real call: .. doctest:: >>> something.backend = mock_backend >>> something.method() Using :attr:`~Mock.mock_calls` we can check the chained call with a single assert. A chained call is several calls in one line of code, so there will be several entries in `mock_calls`. We can use :meth:`call.call_list` to create this list of calls for us: .. doctest:: >>> chained = call.get_endpoint('foobar').create_call('spam', 'eggs').start_call() >>> call_list = chained.call_list() >>> assert mock_backend.mock_calls == call_list Partial mocking =============== In some tests I wanted to mock out a call to `datetime.date.today() `_ to return a known date, but I didn't want to prevent the code under test from creating new date objects. Unfortunately `datetime.date` is written in C, and so I couldn't just monkey-patch out the static `date.today` method. I found a simple way of doing this that involved effectively wrapping the date class with a mock, but passing through calls to the constructor to the real class (and returning real instances). The :func:`patch decorator ` is used here to mock out the `date` class in the module under test. The :attr:`side_effect` attribute on the mock date class is then set to a lambda function that returns a real date. When the mock date class is called a real date will be constructed and returned by `side_effect`. .. doctest:: >>> from datetime import date >>> with patch('mymodule.date') as mock_date: ... mock_date.today.return_value = date(2010, 10, 8) ... mock_date.side_effect = lambda *args, **kw: date(*args, **kw) ... ... assert mymodule.date.today() == date(2010, 10, 8) ... assert mymodule.date(2009, 6, 8) == date(2009, 6, 8) ... Note that we don't patch `datetime.date` globally, we patch `date` in the module that *uses* it. See :ref:`where to patch `. When `date.today()` is called a known date is returned, but calls to the `date(...)` constructor still return normal dates. Without this you can find yourself having to calculate an expected result using exactly the same algorithm as the code under test, which is a classic testing anti-pattern. Calls to the date constructor are recorded in the `mock_date` attributes (`call_count` and friends) which may also be useful for your tests. An alternative way of dealing with mocking dates, or other builtin classes, is discussed in `this blog entry `_. Mocking a Generator Method ========================== A Python generator is a function or method that uses the `yield statement `_ to return a series of values when iterated over [#]_. A generator method / function is called to return the generator object. It is the generator object that is then iterated over. The protocol method for iteration is `__iter__ `_, so we can mock this using a `MagicMock`. Here's an example class with an "iter" method implemented as a generator: .. doctest:: >>> class Foo(object): ... def iter(self): ... for i in [1, 2, 3]: ... yield i ... >>> foo = Foo() >>> list(foo.iter()) [1, 2, 3] How would we mock this class, and in particular its "iter" method? To configure the values returned from the iteration (implicit in the call to `list`), we need to configure the object returned by the call to `foo.iter()`. .. doctest:: >>> mock_foo = MagicMock() >>> mock_foo.iter.return_value = iter([1, 2, 3]) >>> list(mock_foo.iter()) [1, 2, 3] .. [#] There are also generator expressions and more `advanced uses `_ of generators, but we aren't concerned about them here. A very good introduction to generators and how powerful they are is: `Generator Tricks for Systems Programmers `_. Applying the same patch to every test method ============================================ If you want several patches in place for multiple test methods the obvious way is to apply the patch decorators to every method. This can feel like unnecessary repetition. For Python 2.6 or more recent you can use `patch` (in all its various forms) as a class decorator. This applies the patches to all test methods on the class. A test method is identified by methods whose names start with `test`: .. doctest:: >>> @patch('mymodule.SomeClass') ... class MyTest(TestCase): ... ... def test_one(self, MockSomeClass): ... self.assertTrue(mymodule.SomeClass is MockSomeClass) ... ... def test_two(self, MockSomeClass): ... self.assertTrue(mymodule.SomeClass is MockSomeClass) ... ... def not_a_test(self): ... return 'something' ... >>> MyTest('test_one').test_one() >>> MyTest('test_two').test_two() >>> MyTest('test_two').not_a_test() 'something' An alternative way of managing patches is to use the :ref:`start-and-stop`. These allow you to move the patching into your `setUp` and `tearDown` methods. .. doctest:: >>> class MyTest(TestCase): ... def setUp(self): ... self.patcher = patch('mymodule.foo') ... self.mock_foo = self.patcher.start() ... ... def test_foo(self): ... self.assertTrue(mymodule.foo is self.mock_foo) ... ... def tearDown(self): ... self.patcher.stop() ... >>> MyTest('test_foo').run() If you use this technique you must ensure that the patching is "undone" by calling `stop`. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. `unittest2 `_ cleanup functions make this simpler: .. doctest:: >>> class MyTest(TestCase): ... def setUp(self): ... patcher = patch('mymodule.foo') ... self.addCleanup(patcher.stop) ... self.mock_foo = patcher.start() ... ... def test_foo(self): ... self.assertTrue(mymodule.foo is self.mock_foo) ... >>> MyTest('test_foo').run() Mocking Unbound Methods ======================= Whilst writing tests today I needed to patch an *unbound method* (patching the method on the class rather than on the instance). I needed self to be passed in as the first argument because I want to make asserts about which objects were calling this particular method. The issue is that you can't patch with a mock for this, because if you replace an unbound method with a mock it doesn't become a bound method when fetched from the instance, and so it doesn't get self passed in. The workaround is to patch the unbound method with a real function instead. The :func:`patch` decorator makes it so simple to patch out methods with a mock that having to create a real function becomes a nuisance. If you pass `autospec=True` to patch then it does the patching with a *real* function object. This function object has the same signature as the one it is replacing, but delegates to a mock under the hood. You still get your mock auto-created in exactly the same way as before. What it means though, is that if you use it to patch out an unbound method on a class the mocked function will be turned into a bound method if it is fetched from an instance. It will have `self` passed in as the first argument, which is exactly what I wanted: .. doctest:: >>> class Foo(object): ... def foo(self): ... pass ... >>> with patch.object(Foo, 'foo', autospec=True) as mock_foo: ... mock_foo.return_value = 'foo' ... foo = Foo() ... foo.foo() ... 'foo' >>> mock_foo.assert_called_once_with(foo) If we don't use `autospec=True` then the unbound method is patched out with a Mock instance instead, and isn't called with `self`. Checking multiple calls with mock ================================= mock has a nice API for making assertions about how your mock objects are used. .. doctest:: >>> mock = Mock() >>> mock.foo_bar.return_value = None >>> mock.foo_bar('baz', spam='eggs') >>> mock.foo_bar.assert_called_with('baz', spam='eggs') If your mock is only being called once you can use the :meth:`assert_called_once_with` method that also asserts that the :attr:`call_count` is one. .. doctest:: >>> mock.foo_bar.assert_called_once_with('baz', spam='eggs') >>> mock.foo_bar() >>> mock.foo_bar.assert_called_once_with('baz', spam='eggs') Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times. Both `assert_called_with` and `assert_called_once_with` make assertions about the *most recent* call. If your mock is going to be called several times, and you want to make assertions about *all* those calls you can use :attr:`~Mock.call_args_list`: .. doctest:: >>> mock = Mock(return_value=None) >>> mock(1, 2, 3) >>> mock(4, 5, 6) >>> mock() >>> mock.call_args_list [call(1, 2, 3), call(4, 5, 6), call()] The :data:`call` helper makes it easy to make assertions about these calls. You can build up a list of expected calls and compare it to `call_args_list`. This looks remarkably similar to the repr of the `call_args_list`: .. doctest:: >>> expected = [call(1, 2, 3), call(4, 5, 6), call()] >>> mock.call_args_list == expected True Coping with mutable arguments ============================= Another situation is rare, but can bite you, is when your mock is called with mutable arguments. `call_args` and `call_args_list` store *references* to the arguments. If the arguments are mutated by the code under test then you can no longer make assertions about what the values were when the mock was called. Here's some example code that shows the problem. Imagine the following functions defined in 'mymodule':: def frob(val): pass def grob(val): "First frob and then clear val" frob(val) val.clear() When we try to test that `grob` calls `frob` with the correct argument look what happens: .. doctest:: >>> with patch('mymodule.frob') as mock_frob: ... val = set([6]) ... mymodule.grob(val) ... >>> val set([]) >>> mock_frob.assert_called_with(set([6])) Traceback (most recent call last): ... AssertionError: Expected: ((set([6]),), {}) Called with: ((set([]),), {}) One possibility would be for mock to copy the arguments you pass in. This could then cause problems if you do assertions that rely on object identity for equality. Here's one solution that uses the :attr:`side_effect` functionality. If you provide a `side_effect` function for a mock then `side_effect` will be called with the same args as the mock. This gives us an opportunity to copy the arguments and store them for later assertions. In this example I'm using *another* mock to store the arguments so that I can use the mock methods for doing the assertion. Again a helper function sets this up for me. .. doctest:: >>> from copy import deepcopy >>> from mock import Mock, patch, DEFAULT >>> def copy_call_args(mock): ... new_mock = Mock() ... def side_effect(*args, **kwargs): ... args = deepcopy(args) ... kwargs = deepcopy(kwargs) ... new_mock(*args, **kwargs) ... return DEFAULT ... mock.side_effect = side_effect ... return new_mock ... >>> with patch('mymodule.frob') as mock_frob: ... new_mock = copy_call_args(mock_frob) ... val = set([6]) ... mymodule.grob(val) ... >>> new_mock.assert_called_with(set([6])) >>> new_mock.call_args call(set([6])) `copy_call_args` is called with the mock that will be called. It returns a new mock that we do the assertion on. The `side_effect` function makes a copy of the args and calls our `new_mock` with the copy. .. note:: If your mock is only going to be used once there is an easier way of checking arguments at the point they are called. You can simply do the checking inside a `side_effect` function. .. doctest:: >>> def side_effect(arg): ... assert arg == set([6]) ... >>> mock = Mock(side_effect=side_effect) >>> mock(set([6])) >>> mock(set()) Traceback (most recent call last): ... AssertionError An alternative approach is to create a subclass of `Mock` or `MagicMock` that copies (using `copy.deepcopy `_) the arguments. Here's an example implementation: .. doctest:: >>> from copy import deepcopy >>> class CopyingMock(MagicMock): ... def __call__(self, *args, **kwargs): ... args = deepcopy(args) ... kwargs = deepcopy(kwargs) ... return super(CopyingMock, self).__call__(*args, **kwargs) ... >>> c = CopyingMock(return_value=None) >>> arg = set() >>> c(arg) >>> arg.add(1) >>> c.assert_called_with(set()) >>> c.assert_called_with(arg) Traceback (most recent call last): ... AssertionError: Expected call: mock(set([1])) Actual call: mock(set([])) >>> c.foo When you subclass `Mock` or `MagicMock` all dynamically created attributes, and the `return_value` will use your subclass automatically. That means all children of a `CopyingMock` will also have the type `CopyingMock`. Raising exceptions on attribute access ====================================== You can use :class:`PropertyMock` to mimic the behaviour of properties. This includes raising exceptions when an attribute is accessed. Here's an example raising a `ValueError` when the 'foo' attribute is accessed: .. doctest:: >>> m = MagicMock() >>> p = PropertyMock(side_effect=ValueError) >>> type(m).foo = p >>> m.foo Traceback (most recent call last): .... ValueError Because every mock object has its own type, a new subclass of whichever mock class you're using, all mock objects are isolated from each other. You can safely attach properties (or other descriptors or whatever you want in fact) to `type(mock)` without affecting other mock objects. Multiple calls with different effects ===================================== .. note:: In mock 1.0 the handling of iterable `side_effect` was changed. Any exceptions in the iterable will be raised instead of returned. Handling code that needs to behave differently on subsequent calls during the test can be tricky. For example you may have a function that needs to raise an exception the first time it is called but returns a response on the second call (testing retry behaviour). One approach is to use a :attr:`side_effect` function that replaces itself. The first time it is called the `side_effect` sets a new `side_effect` that will be used for the second call. It then raises an exception: .. doctest:: >>> def side_effect(*args): ... def second_call(*args): ... return 'response' ... mock.side_effect = second_call ... raise Exception('boom') ... >>> mock = Mock(side_effect=side_effect) >>> mock('first') Traceback (most recent call last): ... Exception: boom >>> mock('second') 'response' >>> mock.assert_called_with('second') Another perfectly valid way would be to pop return values from a list. If the return value is an exception, raise it instead of returning it: .. doctest:: >>> returns = [Exception('boom'), 'response'] >>> def side_effect(*args): ... result = returns.pop(0) ... if isinstance(result, Exception): ... raise result ... return result ... >>> mock = Mock(side_effect=side_effect) >>> mock('first') Traceback (most recent call last): ... Exception: boom >>> mock('second') 'response' >>> mock.assert_called_with('second') Which approach you prefer is a matter of taste. The first approach is actually a line shorter but maybe the second approach is more readable. Nesting Patches =============== Using patch as a context manager is nice, but if you do multiple patches you can end up with nested with statements indenting further and further to the right: .. doctest:: >>> class MyTest(TestCase): ... ... def test_foo(self): ... with patch('mymodule.Foo') as mock_foo: ... with patch('mymodule.Bar') as mock_bar: ... with patch('mymodule.Spam') as mock_spam: ... assert mymodule.Foo is mock_foo ... assert mymodule.Bar is mock_bar ... assert mymodule.Spam is mock_spam ... >>> original = mymodule.Foo >>> MyTest('test_foo').test_foo() >>> assert mymodule.Foo is original With unittest2_ `cleanup` functions and the :ref:`start-and-stop` we can achieve the same effect without the nested indentation. A simple helper method, `create_patch`, puts the patch in place and returns the created mock for us: .. doctest:: >>> class MyTest(TestCase): ... ... def create_patch(self, name): ... patcher = patch(name) ... thing = patcher.start() ... self.addCleanup(patcher.stop) ... return thing ... ... def test_foo(self): ... mock_foo = self.create_patch('mymodule.Foo') ... mock_bar = self.create_patch('mymodule.Bar') ... mock_spam = self.create_patch('mymodule.Spam') ... ... assert mymodule.Foo is mock_foo ... assert mymodule.Bar is mock_bar ... assert mymodule.Spam is mock_spam ... >>> original = mymodule.Foo >>> MyTest('test_foo').run() >>> assert mymodule.Foo is original Mocking a dictionary with MagicMock =================================== You may want to mock a dictionary, or other container object, recording all access to it whilst having it still behave like a dictionary. We can do this with :class:`MagicMock`, which will behave like a dictionary, and using :data:`~Mock.side_effect` to delegate dictionary access to a real underlying dictionary that is under our control. When the `__getitem__` and `__setitem__` methods of our `MagicMock` are called (normal dictionary access) then `side_effect` is called with the key (and in the case of `__setitem__` the value too). We can also control what is returned. After the `MagicMock` has been used we can use attributes like :data:`~Mock.call_args_list` to assert about how the dictionary was used: .. doctest:: >>> my_dict = {'a': 1, 'b': 2, 'c': 3} >>> def getitem(name): ... return my_dict[name] ... >>> def setitem(name, val): ... my_dict[name] = val ... >>> mock = MagicMock() >>> mock.__getitem__.side_effect = getitem >>> mock.__setitem__.side_effect = setitem .. note:: An alternative to using `MagicMock` is to use `Mock` and *only* provide the magic methods you specifically want: .. doctest:: >>> mock = Mock() >>> mock.__setitem__ = Mock(side_effect=getitem) >>> mock.__getitem__ = Mock(side_effect=setitem) A *third* option is to use `MagicMock` but passing in `dict` as the `spec` (or `spec_set`) argument so that the `MagicMock` created only has dictionary magic methods available: .. doctest:: >>> mock = MagicMock(spec_set=dict) >>> mock.__getitem__.side_effect = getitem >>> mock.__setitem__.side_effect = setitem With these side effect functions in place, the `mock` will behave like a normal dictionary but recording the access. It even raises a `KeyError` if you try to access a key that doesn't exist. .. doctest:: >>> mock['a'] 1 >>> mock['c'] 3 >>> mock['d'] Traceback (most recent call last): ... KeyError: 'd' >>> mock['b'] = 'fish' >>> mock['d'] = 'eggs' >>> mock['b'] 'fish' >>> mock['d'] 'eggs' After it has been used you can make assertions about the access using the normal mock methods and attributes: .. doctest:: >>> mock.__getitem__.call_args_list [call('a'), call('c'), call('d'), call('b'), call('d')] >>> mock.__setitem__.call_args_list [call('b', 'fish'), call('d', 'eggs')] >>> my_dict {'a': 1, 'c': 3, 'b': 'fish', 'd': 'eggs'} Mock subclasses and their attributes ==================================== There are various reasons why you might want to subclass `Mock`. One reason might be to add helper methods. Here's a silly example: .. doctest:: >>> class MyMock(MagicMock): ... def has_been_called(self): ... return self.called ... >>> mymock = MyMock(return_value=None) >>> mymock >>> mymock.has_been_called() False >>> mymock() >>> mymock.has_been_called() True The standard behaviour for `Mock` instances is that attributes and the return value mocks are of the same type as the mock they are accessed on. This ensures that `Mock` attributes are `Mocks` and `MagicMock` attributes are `MagicMocks` [#]_. So if you're subclassing to add helper methods then they'll also be available on the attributes and return value mock of instances of your subclass. .. doctest:: >>> mymock.foo >>> mymock.foo.has_been_called() False >>> mymock.foo() >>> mymock.foo.has_been_called() True Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted adaptor `_. Having this applied to attributes too actually causes errors. `Mock` (in all its flavours) uses a method called `_get_child_mock` to create these "sub-mocks" for attributes and return values. You can prevent your subclass being used for attributes by overriding this method. The signature is that it takes arbitrary keyword arguments (`**kwargs`) which are then passed onto the mock constructor: .. doctest:: >>> class Subclass(MagicMock): ... def _get_child_mock(self, **kwargs): ... return MagicMock(**kwargs) ... >>> mymock = Subclass() >>> mymock.foo >>> assert isinstance(mymock, Subclass) >>> assert not isinstance(mymock.foo, Subclass) >>> assert not isinstance(mymock(), Subclass) .. [#] An exception to this rule are the non-callable mocks. Attributes use the callable variant because otherwise non-callable mocks couldn't have callable methods. Mocking imports with patch.dict =============================== One situation where mocking can be hard is where you have a local import inside a function. These are harder to mock because they aren't using an object from the module namespace that we can patch out. Generally local imports are to be avoided. They are sometimes done to prevent circular dependencies, for which there is *usually* a much better way to solve the problem (refactor the code) or to prevent "up front costs" by delaying the import. This can also be solved in better ways than an unconditional local import (store the module as a class or module attribute and only do the import on first use). That aside there is a way to use `mock` to affect the results of an import. Importing fetches an *object* from the `sys.modules` dictionary. Note that it fetches an *object*, which need not be a module. Importing a module for the first time results in a module object being put in `sys.modules`, so usually when you import something you get a module back. This need not be the case however. This means you can use :func:`patch.dict` to *temporarily* put a mock in place in `sys.modules`. Any imports whilst this patch is active will fetch the mock. When the patch is complete (the decorated function exits, the with statement body is complete or `patcher.stop()` is called) then whatever was there previously will be restored safely. Here's an example that mocks out the 'fooble' module. .. doctest:: >>> mock = Mock() >>> with patch.dict('sys.modules', {'fooble': mock}): ... import fooble ... fooble.blob() ... >>> assert 'fooble' not in sys.modules >>> mock.blob.assert_called_once_with() As you can see the `import fooble` succeeds, but on exit there is no 'fooble' left in `sys.modules`. This also works for the `from module import name` form: .. doctest:: >>> mock = Mock() >>> with patch.dict('sys.modules', {'fooble': mock}): ... from fooble import blob ... blob.blip() ... >>> mock.blob.blip.assert_called_once_with() With slightly more work you can also mock package imports: .. doctest:: >>> mock = Mock() >>> modules = {'package': mock, 'package.module': mock.module} >>> with patch.dict('sys.modules', modules): ... from package.module import fooble ... fooble() ... >>> mock.module.fooble.assert_called_once_with() Tracking order of calls and less verbose call assertions ======================================================== The :class:`Mock` class allows you to track the *order* of method calls on your mock objects through the :attr:`~Mock.method_calls` attribute. This doesn't allow you to track the order of calls between separate mock objects, however we can use :attr:`~Mock.mock_calls` to achieve the same effect. Because mocks track calls to child mocks in `mock_calls`, and accessing an arbitrary attribute of a mock creates a child mock, we can create our separate mocks from a parent one. Calls to those child mock will then all be recorded, in order, in the `mock_calls` of the parent: .. doctest:: >>> manager = Mock() >>> mock_foo = manager.foo >>> mock_bar = manager.bar >>> mock_foo.something() >>> mock_bar.other.thing() >>> manager.mock_calls [call.foo.something(), call.bar.other.thing()] We can then assert about the calls, including the order, by comparing with the `mock_calls` attribute on the manager mock: .. doctest:: >>> expected_calls = [call.foo.something(), call.bar.other.thing()] >>> manager.mock_calls == expected_calls True If `patch` is creating, and putting in place, your mocks then you can attach them to a manager mock using the :meth:`~Mock.attach_mock` method. After attaching calls will be recorded in `mock_calls` of the manager. .. doctest:: >>> manager = MagicMock() >>> with patch('mymodule.Class1') as MockClass1: ... with patch('mymodule.Class2') as MockClass2: ... manager.attach_mock(MockClass1, 'MockClass1') ... manager.attach_mock(MockClass2, 'MockClass2') ... MockClass1().foo() ... MockClass2().bar() ... >>> manager.mock_calls [call.MockClass1(), call.MockClass1().foo(), call.MockClass2(), call.MockClass2().bar()] If many calls have been made, but you're only interested in a particular sequence of them then an alternative is to use the :meth:`~Mock.assert_has_calls` method. This takes a list of calls (constructed with the :data:`call` object). If that sequence of calls are in :attr:`~Mock.mock_calls` then the assert succeeds. .. doctest:: >>> m = MagicMock() >>> m().foo().bar().baz() >>> m.one().two().three() >>> calls = call.one().two().three().call_list() >>> m.assert_has_calls(calls) Even though the chained call `m.one().two().three()` aren't the only calls that have been made to the mock, the assert still succeeds. Sometimes a mock may have several calls made to it, and you are only interested in asserting about *some* of those calls. You may not even care about the order. In this case you can pass `any_order=True` to `assert_has_calls`: .. doctest:: >>> m = MagicMock() >>> m(1), m.two(2, 3), m.seven(7), m.fifty('50') (...) >>> calls = [call.fifty('50'), call(1), call.seven(7)] >>> m.assert_has_calls(calls, any_order=True) More complex argument matching ============================== Using the same basic concept as `ANY` we can implement matchers to do more complex assertions on objects used as arguments to mocks. Suppose we expect some object to be passed to a mock that by default compares equal based on object identity (which is the Python default for user defined classes). To use :meth:`~Mock.assert_called_with` we would need to pass in the exact same object. If we are only interested in some of the attributes of this object then we can create a matcher that will check these attributes for us. You can see in this example how a 'standard' call to `assert_called_with` isn't sufficient: .. doctest:: >>> class Foo(object): ... def __init__(self, a, b): ... self.a, self.b = a, b ... >>> mock = Mock(return_value=None) >>> mock(Foo(1, 2)) >>> mock.assert_called_with(Foo(1, 2)) Traceback (most recent call last): ... AssertionError: Expected: call(<__main__.Foo object at 0x...>) Actual call: call(<__main__.Foo object at 0x...>) A comparison function for our `Foo` class might look something like this: .. doctest:: >>> def compare(self, other): ... if not type(self) == type(other): ... return False ... if self.a != other.a: ... return False ... if self.b != other.b: ... return False ... return True ... And a matcher object that can use comparison functions like this for its equality operation would look something like this: .. doctest:: >>> class Matcher(object): ... def __init__(self, compare, some_obj): ... self.compare = compare ... self.some_obj = some_obj ... def __eq__(self, other): ... return self.compare(self.some_obj, other) ... Putting all this together: .. doctest:: >>> match_foo = Matcher(compare, Foo(1, 2)) >>> mock.assert_called_with(match_foo) The `Matcher` is instantiated with our compare function and the `Foo` object we want to compare against. In `assert_called_with` the `Matcher` equality method will be called, which compares the object the mock was called with against the one we created our matcher with. If they match then `assert_called_with` passes, and if they don't an `AssertionError` is raised: .. doctest:: >>> match_wrong = Matcher(compare, Foo(3, 4)) >>> mock.assert_called_with(match_wrong) Traceback (most recent call last): ... AssertionError: Expected: ((,), {}) Called with: ((,), {}) With a bit of tweaking you could have the comparison function raise the `AssertionError` directly and provide a more useful failure message. As of version 1.5, the Python testing library `PyHamcrest `_ provides similar functionality, that may be useful here, in the form of its equality matcher (`hamcrest.library.integration.match_equality `_). Less verbose configuration of mock objects ========================================== This recipe, for easier configuration of mock objects, is now part of `Mock`. See the :meth:`~Mock.configure_mock` method. Matching any argument in assertions =================================== This example is now built in to mock. See :data:`ANY`. Mocking Properties ================== This example is now built in to mock. See :class:`PropertyMock`. Mocking open ============ This example is now built in to mock. See :func:`mock_open`. Mocks without some attributes ============================= This example is now built in to mock. See :ref:`deleting-attributes`. mock-1.0.1/html/_sources/getting-started.txt0000644000076500001200000003505611742100665021620 0ustar michaeladmin00000000000000=========================== Getting Started with Mock =========================== .. _getting-started: .. index:: Getting Started .. testsetup:: class SomeClass(object): static_method = None class_method = None attribute = None sys.modules['package'] = package = Mock(name='package') sys.modules['package.module'] = module = package.module sys.modules['module'] = package.module Using Mock ========== Mock Patching Methods --------------------- Common uses for :class:`Mock` objects include: * Patching methods * Recording method calls on objects You might want to replace a method on an object to check that it is called with the correct arguments by another part of the system: .. doctest:: >>> real = SomeClass() >>> real.method = MagicMock(name='method') >>> real.method(3, 4, 5, key='value') Once our mock has been used (`real.method` in this example) it has methods and attributes that allow you to make assertions about how it has been used. .. note:: In most of these examples the :class:`Mock` and :class:`MagicMock` classes are interchangeable. As the `MagicMock` is the more capable class it makes a sensible one to use by default. Once the mock has been called its :attr:`~Mock.called` attribute is set to `True`. More importantly we can use the :meth:`~Mock.assert_called_with` or :meth:`~Mock.assert_called_once_with` method to check that it was called with the correct arguments. This example tests that calling `ProductionClass().method` results in a call to the `something` method: .. doctest:: >>> from mock import MagicMock >>> class ProductionClass(object): ... def method(self): ... self.something(1, 2, 3) ... def something(self, a, b, c): ... pass ... >>> real = ProductionClass() >>> real.something = MagicMock() >>> real.method() >>> real.something.assert_called_once_with(1, 2, 3) Mock for Method Calls on an Object ---------------------------------- In the last example we patched a method directly on an object to check that it was called correctly. Another common use case is to pass an object into a method (or some part of the system under test) and then check that it is used in the correct way. The simple `ProductionClass` below has a `closer` method. If it is called with an object then it calls `close` on it. .. doctest:: >>> class ProductionClass(object): ... def closer(self, something): ... something.close() ... So to test it we need to pass in an object with a `close` method and check that it was called correctly. .. doctest:: >>> real = ProductionClass() >>> mock = Mock() >>> real.closer(mock) >>> mock.close.assert_called_with() We don't have to do any work to provide the 'close' method on our mock. Accessing close creates it. So, if 'close' hasn't already been called then accessing it in the test will create it, but :meth:`~Mock.assert_called_with` will raise a failure exception. Mocking Classes --------------- A common use case is to mock out classes instantiated by your code under test. When you patch a class, then that class is replaced with a mock. Instances are created by *calling the class*. This means you access the "mock instance" by looking at the return value of the mocked class. In the example below we have a function `some_function` that instantiates `Foo` and calls a method on it. The call to `patch` replaces the class `Foo` with a mock. The `Foo` instance is the result of calling the mock, so it is configured by modifying the mock :attr:`~Mock.return_value`. .. doctest:: >>> def some_function(): ... instance = module.Foo() ... return instance.method() ... >>> with patch('module.Foo') as mock: ... instance = mock.return_value ... instance.method.return_value = 'the result' ... result = some_function() ... assert result == 'the result' Naming your mocks ----------------- It can be useful to give your mocks a name. The name is shown in the repr of the mock and can be helpful when the mock appears in test failure messages. The name is also propagated to attributes or methods of the mock: .. doctest:: >>> mock = MagicMock(name='foo') >>> mock >>> mock.method Tracking all Calls ------------------ Often you want to track more than a single call to a method. The :attr:`~Mock.mock_calls` attribute records all calls to child attributes of the mock - and also to their children. .. doctest:: >>> mock = MagicMock() >>> mock.method() >>> mock.attribute.method(10, x=53) >>> mock.mock_calls [call.method(), call.attribute.method(10, x=53)] If you make an assertion about `mock_calls` and any unexpected methods have been called, then the assertion will fail. This is useful because as well as asserting that the calls you expected have been made, you are also checking that they were made in the right order and with no additional calls: You use the :data:`call` object to construct lists for comparing with `mock_calls`: .. doctest:: >>> expected = [call.method(), call.attribute.method(10, x=53)] >>> mock.mock_calls == expected True Setting Return Values and Attributes ------------------------------------ Setting the return values on a mock object is trivially easy: .. doctest:: >>> mock = Mock() >>> mock.return_value = 3 >>> mock() 3 Of course you can do the same for methods on the mock: .. doctest:: >>> mock = Mock() >>> mock.method.return_value = 3 >>> mock.method() 3 The return value can also be set in the constructor: .. doctest:: >>> mock = Mock(return_value=3) >>> mock() 3 If you need an attribute setting on your mock, just do it: .. doctest:: >>> mock = Mock() >>> mock.x = 3 >>> mock.x 3 Sometimes you want to mock up a more complex situation, like for example `mock.connection.cursor().execute("SELECT 1")`. If we wanted this call to return a list, then we have to configure the result of the nested call. We can use :data:`call` to construct the set of calls in a "chained call" like this for easy assertion afterwards: .. doctest:: >>> mock = Mock() >>> cursor = mock.connection.cursor.return_value >>> cursor.execute.return_value = ['foo'] >>> mock.connection.cursor().execute("SELECT 1") ['foo'] >>> expected = call.connection.cursor().execute("SELECT 1").call_list() >>> mock.mock_calls [call.connection.cursor(), call.connection.cursor().execute('SELECT 1')] >>> mock.mock_calls == expected True It is the call to `.call_list()` that turns our call object into a list of calls representing the chained calls. Raising exceptions with mocks ----------------------------- A useful attribute is :attr:`~Mock.side_effect`. If you set this to an exception class or instance then the exception will be raised when the mock is called. .. doctest:: >>> mock = Mock(side_effect=Exception('Boom!')) >>> mock() Traceback (most recent call last): ... Exception: Boom! Side effect functions and iterables ----------------------------------- `side_effect` can also be set to a function or an iterable. The use case for `side_effect` as an iterable is where your mock is going to be called several times, and you want each call to return a different value. When you set `side_effect` to an iterable every call to the mock returns the next value from the iterable: .. doctest:: >>> mock = MagicMock(side_effect=[4, 5, 6]) >>> mock() 4 >>> mock() 5 >>> mock() 6 For more advanced use cases, like dynamically varying the return values depending on what the mock is called with, `side_effect` can be a function. The function will be called with the same arguments as the mock. Whatever the function returns is what the call returns: .. doctest:: >>> vals = {(1, 2): 1, (2, 3): 2} >>> def side_effect(*args): ... return vals[args] ... >>> mock = MagicMock(side_effect=side_effect) >>> mock(1, 2) 1 >>> mock(2, 3) 2 Creating a Mock from an Existing Object --------------------------------------- One problem with over use of mocking is that it couples your tests to the implementation of your mocks rather than your real code. Suppose you have a class that implements `some_method`. In a test for another class, you provide a mock of this object that *also* provides `some_method`. If later you refactor the first class, so that it no longer has `some_method` - then your tests will continue to pass even though your code is now broken! `Mock` allows you to provide an object as a specification for the mock, using the `spec` keyword argument. Accessing methods / attributes on the mock that don't exist on your specification object will immediately raise an attribute error. If you change the implementation of your specification, then tests that use that class will start failing immediately without you having to instantiate the class in those tests. .. doctest:: >>> mock = Mock(spec=SomeClass) >>> mock.old_method() Traceback (most recent call last): ... AttributeError: object has no attribute 'old_method' If you want a stronger form of specification that prevents the setting of arbitrary attributes as well as the getting of them then you can use `spec_set` instead of `spec`. Patch Decorators ================ .. note:: With `patch` it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read :ref:`where to patch `. A common need in tests is to patch a class attribute or a module attribute, for example patching a builtin or patching a class in a module to test that it is instantiated. Modules and classes are effectively global, so patching on them has to be undone after the test or the patch will persist into other tests and cause hard to diagnose problems. mock provides three convenient decorators for this: `patch`, `patch.object` and `patch.dict`. `patch` takes a single string, of the form `package.module.Class.attribute` to specify the attribute you are patching. It also optionally takes a value that you want the attribute (or class or whatever) to be replaced with. 'patch.object' takes an object and the name of the attribute you would like patched, plus optionally the value to patch it with. `patch.object`: .. doctest:: >>> original = SomeClass.attribute >>> @patch.object(SomeClass, 'attribute', sentinel.attribute) ... def test(): ... assert SomeClass.attribute == sentinel.attribute ... >>> test() >>> assert SomeClass.attribute == original >>> @patch('package.module.attribute', sentinel.attribute) ... def test(): ... from package.module import attribute ... assert attribute is sentinel.attribute ... >>> test() If you are patching a module (including `__builtin__`) then use `patch` instead of `patch.object`: .. doctest:: >>> mock = MagicMock(return_value = sentinel.file_handle) >>> with patch('__builtin__.open', mock): ... handle = open('filename', 'r') ... >>> mock.assert_called_with('filename', 'r') >>> assert handle == sentinel.file_handle, "incorrect file handle returned" The module name can be 'dotted', in the form `package.module` if needed: .. doctest:: >>> @patch('package.module.ClassName.attribute', sentinel.attribute) ... def test(): ... from package.module import ClassName ... assert ClassName.attribute == sentinel.attribute ... >>> test() A nice pattern is to actually decorate test methods themselves: .. doctest:: >>> class MyTest(unittest2.TestCase): ... @patch.object(SomeClass, 'attribute', sentinel.attribute) ... def test_something(self): ... self.assertEqual(SomeClass.attribute, sentinel.attribute) ... >>> original = SomeClass.attribute >>> MyTest('test_something').test_something() >>> assert SomeClass.attribute == original If you want to patch with a Mock, you can use `patch` with only one argument (or `patch.object` with two arguments). The mock will be created for you and passed into the test function / method: .. doctest:: >>> class MyTest(unittest2.TestCase): ... @patch.object(SomeClass, 'static_method') ... def test_something(self, mock_method): ... SomeClass.static_method() ... mock_method.assert_called_with() ... >>> MyTest('test_something').test_something() You can stack up multiple patch decorators using this pattern: .. doctest:: >>> class MyTest(unittest2.TestCase): ... @patch('package.module.ClassName1') ... @patch('package.module.ClassName2') ... def test_something(self, MockClass2, MockClass1): ... self.assertTrue(package.module.ClassName1 is MockClass1) ... self.assertTrue(package.module.ClassName2 is MockClass2) ... >>> MyTest('test_something').test_something() When you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal *python* order that decorators are applied). This means from the bottom up, so in the example above the mock for `test_module.ClassName2` is passed in first. There is also :func:`patch.dict` for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends: .. doctest:: >>> foo = {'key': 'value'} >>> original = foo.copy() >>> with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == original `patch`, `patch.object` and `patch.dict` can all be used as context managers. Where you use `patch` to create a mock for you, you can get a reference to the mock using the "as" form of the with statement: .. doctest:: >>> class ProductionClass(object): ... def method(self): ... pass ... >>> with patch.object(ProductionClass, 'method') as mock_method: ... mock_method.return_value = None ... real = ProductionClass() ... real.method(1, 2, 3) ... >>> mock_method.assert_called_with(1, 2, 3) As an alternative `patch`, `patch.object` and `patch.dict` can be used as class decorators. When used in this way it is the same as applying the decorator indvidually to every method whose name starts with "test". For some more advanced examples, see the :ref:`further-examples` page. mock-1.0.1/html/_sources/index.txt0000644000076500001200000003252512034411261017610 0ustar michaeladmin00000000000000==================================== Mock - Mocking and Testing Library ==================================== .. currentmodule:: mock :Author: `Michael Foord `_ :Version: |release| :Date: 2012/10/07 :Homepage: `Mock Homepage`_ :Download: `Mock on PyPI`_ :Documentation: `PDF Documentation `_ :License: `BSD License`_ :Support: `Mailing list (testing-in-python@lists.idyll.org) `_ :Issue tracker: `Google code project `_ .. _Mock Homepage: http://www.voidspace.org.uk/python/mock/ .. _BSD License: http://www.voidspace.org.uk/python/license.shtml .. currentmodule:: mock .. module:: mock :synopsis: Mock object and testing library. .. index:: introduction mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used. mock is now part of the Python standard library, available as `unittest.mock `_ in Python 3.3 onwards. mock provides a core :class:`Mock` class removing the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way. Additionally, mock provides a :func:`patch` decorator that handles patching module and class level attributes within the scope of a test, along with :const:`sentinel` for creating unique objects. See the `quick guide`_ for some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:`patch`. Mock is very easy to use and is designed for use with `unittest `_. Mock is based on the 'action -> assertion' pattern instead of `'record -> replay'` used by many mocking frameworks. mock is tested on Python versions 2.4-2.7, Python 3 plus the latest versions of Jython and PyPy. .. testsetup:: class ProductionClass(object): def method(self, *args): pass module = sys.modules['module'] = ProductionClass ProductionClass.ClassName1 = ProductionClass ProductionClass.ClassName2 = ProductionClass API Documentation ================= .. toctree:: :maxdepth: 2 mock patch helpers sentinel magicmock User Guide ========== .. toctree:: :maxdepth: 2 getting-started examples compare changelog .. index:: installing Installing ========== The current version is |release|. Mock is stable and widely used. If you do find any bugs, or have suggestions for improvements / extensions then please contact us. * `mock on PyPI `_ * `mock documentation as PDF `_ * `Google Code Home & Mercurial Repository `_ .. index:: repository .. index:: hg You can checkout the latest development version from the Google Code Mercurial repository with the following command: ``hg clone https://mock.googlecode.com/hg/ mock`` .. index:: pip .. index:: easy_install .. index:: setuptools If you have pip, setuptools or distribute you can install mock with: | ``easy_install -U mock`` | ``pip install -U mock`` Alternatively you can download the mock distribution from PyPI and after unpacking run: ``python setup.py install`` Quick Guide =========== :class:`Mock` and :class:`MagicMock` objects create all attributes and methods as you access them and store details of how they have been used. You can configure them, to specify return values or limit what attributes are available, and then make assertions about how they have been used: .. doctest:: >>> from mock import MagicMock >>> thing = ProductionClass() >>> thing.method = MagicMock(return_value=3) >>> thing.method(3, 4, 5, key='value') 3 >>> thing.method.assert_called_with(3, 4, 5, key='value') :attr:`side_effect` allows you to perform side effects, including raising an exception when a mock is called: .. doctest:: >>> mock = Mock(side_effect=KeyError('foo')) >>> mock() Traceback (most recent call last): ... KeyError: 'foo' >>> values = {'a': 1, 'b': 2, 'c': 3} >>> def side_effect(arg): ... return values[arg] ... >>> mock.side_effect = side_effect >>> mock('a'), mock('b'), mock('c') (1, 2, 3) >>> mock.side_effect = [5, 4, 3, 2, 1] >>> mock(), mock(), mock() (5, 4, 3) Mock has many other ways you can configure it and control its behaviour. For example the `spec` argument configures the mock to take its specification from another object. Attempting to access attributes or methods on the mock that don't exist on the spec will fail with an `AttributeError`. The :func:`patch` decorator / context manager makes it easy to mock classes or objects in a module under test. The object you specify will be replaced with a mock (or other object) during the test and restored when the test ends: .. doctest:: >>> from mock import patch >>> @patch('module.ClassName2') ... @patch('module.ClassName1') ... def test(MockClass1, MockClass2): ... module.ClassName1() ... module.ClassName2() ... assert MockClass1 is module.ClassName1 ... assert MockClass2 is module.ClassName2 ... assert MockClass1.called ... assert MockClass2.called ... >>> test() .. note:: When you nest patch decorators the mocks are passed in to the decorated function in the same order they applied (the normal *python* order that decorators are applied). This means from the bottom up, so in the example above the mock for `module.ClassName1` is passed in first. With `patch` it matters that you patch objects in the namespace where they are looked up. This is normally straightforward, but for a quick guide read :ref:`where to patch `. As well as a decorator `patch` can be used as a context manager in a with statement: .. doctest:: >>> with patch.object(ProductionClass, 'method', return_value=None) as mock_method: ... thing = ProductionClass() ... thing.method(1, 2, 3) ... >>> mock_method.assert_called_once_with(1, 2, 3) There is also :func:`patch.dict` for setting values in a dictionary just during a scope and restoring the dictionary to its original state when the test ends: .. doctest:: >>> foo = {'key': 'value'} >>> original = foo.copy() >>> with patch.dict(foo, {'newkey': 'newvalue'}, clear=True): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == original Mock supports the mocking of Python :ref:`magic methods `. The easiest way of using magic methods is with the :class:`MagicMock` class. It allows you to do things like: .. doctest:: >>> mock = MagicMock() >>> mock.__str__.return_value = 'foobarbaz' >>> str(mock) 'foobarbaz' >>> mock.__str__.assert_called_with() Mock allows you to assign functions (or other Mock instances) to magic methods and they will be called appropriately. The `MagicMock` class is just a Mock variant that has all of the magic methods pre-created for you (well, all the useful ones anyway). The following is an example of using magic methods with the ordinary Mock class: .. doctest:: >>> mock = Mock() >>> mock.__str__ = Mock(return_value='wheeeeee') >>> str(mock) 'wheeeeee' For ensuring that the mock objects in your tests have the same api as the objects they are replacing, you can use :ref:`auto-speccing `. Auto-speccing can be done through the `autospec` argument to patch, or the :func:`create_autospec` function. Auto-speccing creates mock objects that have the same attributes and methods as the objects they are replacing, and any functions and methods (including constructors) have the same call signature as the real object. This ensures that your mocks will fail in the same way as your production code if they are used incorrectly: .. doctest:: >>> from mock import create_autospec >>> def function(a, b, c): ... pass ... >>> mock_function = create_autospec(function, return_value='fishy') >>> mock_function(1, 2, 3) 'fishy' >>> mock_function.assert_called_once_with(1, 2, 3) >>> mock_function('wrong arguments') Traceback (most recent call last): ... TypeError: () takes exactly 3 arguments (1 given) `create_autospec` can also be used on classes, where it copies the signature of the `__init__` method, and on callable objects where it copies the signature of the `__call__` method. .. index:: references .. index:: articles References ========== Articles, blog entries and other stuff related to testing with Mock: * `Imposing a No DB Discipline on Django unit tests `_ * `mock-django: tools for mocking the Django ORM and models `_ * `PyCon 2011 Video: Testing with mock `_ * `Mock objects in Python `_ * `Python: Injecting Mock Objects for Powerful Testing `_ * `Python Mock: How to assert a substring of logger output `_ * `Mocking Django `_ * `Mocking dates and other classes that can't be modified `_ * `Mock recipes `_ * `Mockity mock mock - some love for the mock module `_ * `Coverage and Mock (with django) `_ * `Python Unit Testing with Mock `_ * `Getting started with Python Mock `_ * `Smart Parameter Checks with mock `_ * `Python mock testing techniques and tools `_ * `How To Test Django Template Tags `_ * `A presentation on Unit Testing with Mock `_ * `Mocking with Django and Google AppEngine `_ .. index:: tests .. index:: unittest2 Tests ===== Mock uses `unittest2 `_ for its own test suite. In order to run it, use the `unit2` script that comes with `unittest2` module on a checkout of the source repository: `unit2 discover` If you have `setuptools `_ as well as unittest2 you can run: ``python setup.py test`` On Python 3.2 you can use ``unittest`` module from the standard library. ``python3.2 -m unittest discover`` .. index:: Python 3 On Python 3 the tests for unicode are skipped as they are not relevant. On Python 2.4 tests that use the with statements are skipped as the with statement is invalid syntax on Python 2.4. .. index:: older versions Older Versions ============== Documentation for older versions of mock: * `mock 0.8 `_ * `mock 0.7 `_ * `mock 0.6 `_ Docs from the in-development version of `mock` can be found at `mock.readthedocs.org `_. Terminology =========== Terminology for objects used to replace other ones can be confusing. Terms like double, fake, mock, stub, and spy are all used with varying meanings. In `classic mock terminology `_ :class:`mock.Mock` is a `spy `_ that allows for *post-mortem* examination. This is what I call the "action -> assertion" [#]_ pattern of testing. I'm not however a fan of this "statically typed mocking terminology" promulgated by `Martin Fowler `_. It confuses usage patterns with implementation and prevents you from using natural terminology when discussing mocking. I much prefer duck typing, if an object used in your test suite looks like a mock object and quacks like a mock object then it's fine to call it a mock, no matter what the implementation looks like. This terminology is perhaps more useful in less capable languages where different usage patterns will *require* different implementations. `mock.Mock()` is capable of being used in most of the different roles described by Fowler, except (annoyingly / frustratingly / ironically) a Mock itself! How about a simpler definition: a "mock object" is an object used to replace a real one in a system under test. .. [#] This pattern is called "AAA" by some members of the testing community; "Arrange - Act - Assert". mock-1.0.1/html/_sources/magicmock.txt0000644000076500001200000001731111731232226020434 0ustar michaeladmin00000000000000 .. currentmodule:: mock .. _magic-methods: Mocking Magic Methods ===================== .. currentmodule:: mock :class:`Mock` supports mocking `magic methods `_. This allows mock objects to replace containers or other objects that implement Python protocols. Because magic methods are looked up differently from normal methods [#]_, this support has been specially implemented. This means that only specific magic methods are supported. The supported list includes *almost* all of them. If there are any missing that you need please let us know! You mock magic methods by setting the method you are interested in to a function or a mock instance. If you are using a function then it *must* take ``self`` as the first argument [#]_. .. doctest:: >>> def __str__(self): ... return 'fooble' ... >>> mock = Mock() >>> mock.__str__ = __str__ >>> str(mock) 'fooble' >>> mock = Mock() >>> mock.__str__ = Mock() >>> mock.__str__.return_value = 'fooble' >>> str(mock) 'fooble' >>> mock = Mock() >>> mock.__iter__ = Mock(return_value=iter([])) >>> list(mock) [] One use case for this is for mocking objects used as context managers in a `with` statement: .. doctest:: >>> mock = Mock() >>> mock.__enter__ = Mock(return_value='foo') >>> mock.__exit__ = Mock(return_value=False) >>> with mock as m: ... assert m == 'foo' ... >>> mock.__enter__.assert_called_with() >>> mock.__exit__.assert_called_with(None, None, None) Calls to magic methods do not appear in :attr:`~Mock.method_calls`, but they are recorded in :attr:`~Mock.mock_calls`. .. note:: If you use the `spec` keyword argument to create a mock then attempting to set a magic method that isn't in the spec will raise an `AttributeError`. The full list of supported magic methods is: * ``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__`` * ``__dir__``, ``__format__`` and ``__subclasses__`` * ``__floor__``, ``__trunc__`` and ``__ceil__`` * Comparisons: ``__cmp__``, ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and ``__ne__`` * Container methods: ``__getitem__``, ``__setitem__``, ``__delitem__``, ``__contains__``, ``__len__``, ``__iter__``, ``__getslice__``, ``__setslice__``, ``__reversed__`` and ``__missing__`` * Context manager: ``__enter__`` and ``__exit__`` * Unary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__`` * The numeric methods (including right hand and in-place variants): ``__add__``, ``__sub__``, ``__mul__``, ``__div__``, ``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``, ``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and ``__pow__`` * Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__``, ``__index__`` and ``__coerce__`` * Descriptor methods: ``__get__``, ``__set__`` and ``__delete__`` * Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, ``__getstate__`` and ``__setstate__`` The following methods are supported in Python 2 but don't exist in Python 3: * ``__unicode__``, ``__long__``, ``__oct__``, ``__hex__`` and ``__nonzero__`` * ``__truediv__`` and ``__rtruediv__`` The following methods are supported in Python 3 but don't exist in Python 2: * ``__bool__`` and ``__next__`` The following methods exist but are *not* supported as they are either in use by mock, can't be set dynamically, or can cause problems: * ``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__`` * ``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__`` Magic Mock ========== There are two `MagicMock` variants: `MagicMock` and `NonCallableMagicMock`. .. class:: MagicMock(*args, **kw) ``MagicMock`` is a subclass of :class:`Mock` with default implementations of most of the magic methods. You can use ``MagicMock`` without having to configure the magic methods yourself. The constructor parameters have the same meaning as for :class:`Mock`. If you use the `spec` or `spec_set` arguments then *only* magic methods that exist in the spec will be created. .. class:: NonCallableMagicMock(*args, **kw) A non-callable version of `MagicMock`. The constructor parameters have the same meaning as for :class:`MagicMock`, with the exception of `return_value` and `side_effect` which have no meaning on a non-callable mock. The magic methods are setup with `MagicMock` objects, so you can configure them and use them in the usual way: .. doctest:: >>> mock = MagicMock() >>> mock[3] = 'fish' >>> mock.__setitem__.assert_called_with(3, 'fish') >>> mock.__getitem__.return_value = 'result' >>> mock[2] 'result' By default many of the protocol methods are required to return objects of a specific type. These methods are preconfigured with a default return value, so that they can be used without you having to do anything if you aren't interested in the return value. You can still *set* the return value manually if you want to change the default. Methods and their defaults: * ``__lt__``: NotImplemented * ``__gt__``: NotImplemented * ``__le__``: NotImplemented * ``__ge__``: NotImplemented * ``__int__`` : 1 * ``__contains__`` : False * ``__len__`` : 1 * ``__iter__`` : iter([]) * ``__exit__`` : False * ``__complex__`` : 1j * ``__float__`` : 1.0 * ``__bool__`` : True * ``__nonzero__`` : True * ``__oct__`` : '1' * ``__hex__`` : '0x1' * ``__long__`` : long(1) * ``__index__`` : 1 * ``__hash__`` : default hash for the mock * ``__str__`` : default str for the mock * ``__unicode__`` : default unicode for the mock * ``__sizeof__``: default sizeof for the mock For example: .. doctest:: >>> mock = MagicMock() >>> int(mock) 1 >>> len(mock) 0 >>> hex(mock) '0x1' >>> list(mock) [] >>> object() in mock False The two equality method, `__eq__` and `__ne__`, are special (changed in 0.7.2). They do the default equality comparison on identity, using a side effect, unless you change their return value to return something else: .. doctest:: >>> MagicMock() == 3 False >>> MagicMock() != 3 True >>> mock = MagicMock() >>> mock.__eq__.return_value = True >>> mock == 3 True In `0.8` the `__iter__` also gained special handling implemented with a side effect. The return value of `MagicMock.__iter__` can be any iterable object and isn't required to be an iterator: .. doctest:: >>> mock = MagicMock() >>> mock.__iter__.return_value = ['a', 'b', 'c'] >>> list(mock) ['a', 'b', 'c'] >>> list(mock) ['a', 'b', 'c'] If the return value *is* an iterator, then iterating over it once will consume it and subsequent iterations will result in an empty list: .. doctest:: >>> mock.__iter__.return_value = iter(['a', 'b', 'c']) >>> list(mock) ['a', 'b', 'c'] >>> list(mock) [] ``MagicMock`` has all of the supported magic methods configured except for some of the obscure and obsolete ones. You can still set these up if you want. Magic methods that are supported but not setup by default in ``MagicMock`` are: * ``__cmp__`` * ``__getslice__`` and ``__setslice__`` * ``__coerce__`` * ``__subclasses__`` * ``__dir__`` * ``__format__`` * ``__get__``, ``__set__`` and ``__delete__`` * ``__reversed__`` and ``__missing__`` * ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, ``__getstate__`` and ``__setstate__`` * ``__getformat__`` and ``__setformat__`` ------------ .. [#] Magic methods *should* be looked up on the class rather than the instance. Different versions of Python are inconsistent about applying this rule. The supported protocol methods should work with all supported versions of Python. .. [#] The function is basically hooked up to the class, but each ``Mock`` instance is kept isolated from the others. mock-1.0.1/html/_sources/mock.txt0000644000076500001200000006521411744401311017435 0ustar michaeladmin00000000000000The Mock Class ============== .. currentmodule:: mock .. testsetup:: class SomeClass: pass `Mock` is a flexible mock object intended to replace the use of stubs and test doubles throughout your code. Mocks are callable and create attributes as new mocks when you access them [#]_. Accessing the same attribute will always return the same mock. Mocks record how you use them, allowing you to make assertions about what your code has done to them. :class:`MagicMock` is a subclass of `Mock` with all the magic methods pre-created and ready to use. There are also non-callable variants, useful when you are mocking out objects that aren't callable: :class:`NonCallableMock` and :class:`NonCallableMagicMock` The :func:`patch` decorators makes it easy to temporarily replace classes in a particular module with a `Mock` object. By default `patch` will create a `MagicMock` for you. You can specify an alternative class of `Mock` using the `new_callable` argument to `patch`. .. index:: side_effect .. index:: return_value .. index:: wraps .. index:: name .. index:: spec .. class:: Mock(spec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec_set=None, **kwargs) Create a new `Mock` object. `Mock` takes several optional arguments that specify the behaviour of the Mock object: * `spec`: This can be either a list of strings or an existing object (a class or instance) that acts as the specification for the mock object. If you pass in an object then a list of strings is formed by calling dir on the object (excluding unsupported magic attributes and methods). Accessing any attribute not in this list will raise an `AttributeError`. If `spec` is an object (rather than a list of strings) then :attr:`__class__` returns the class of the spec object. This allows mocks to pass `isinstance` tests. * `spec_set`: A stricter variant of `spec`. If used, attempting to *set* or get an attribute on the mock that isn't on the object passed as `spec_set` will raise an `AttributeError`. * `side_effect`: A function to be called whenever the Mock is called. See the :attr:`~Mock.side_effect` attribute. Useful for raising exceptions or dynamically changing return values. The function is called with the same arguments as the mock, and unless it returns :data:`DEFAULT`, the return value of this function is used as the return value. Alternatively `side_effect` can be an exception class or instance. In this case the exception will be raised when the mock is called. If `side_effect` is an iterable then each call to the mock will return the next value from the iterable. If any of the members of the iterable are exceptions they will be raised instead of returned. A `side_effect` can be cleared by setting it to `None`. * `return_value`: The value returned when the mock is called. By default this is a new Mock (created on first access). See the :attr:`return_value` attribute. * `wraps`: Item for the mock object to wrap. If `wraps` is not None then calling the Mock will pass the call through to the wrapped object (returning the real result and ignoring `return_value`). Attribute access on the mock will return a Mock object that wraps the corresponding attribute of the wrapped object (so attempting to access an attribute that doesn't exist will raise an `AttributeError`). If the mock has an explicit `return_value` set then calls are not passed to the wrapped object and the `return_value` is returned instead. * `name`: If the mock has a name then it will be used in the repr of the mock. This can be useful for debugging. The name is propagated to child mocks. Mocks can also be called with arbitrary keyword arguments. These will be used to set attributes on the mock after it is created. See the :meth:`configure_mock` method for details. .. method:: assert_called_with(*args, **kwargs) This method is a convenient way of asserting that calls are made in a particular way: .. doctest:: >>> mock = Mock() >>> mock.method(1, 2, 3, test='wow') >>> mock.method.assert_called_with(1, 2, 3, test='wow') .. method:: assert_called_once_with(*args, **kwargs) Assert that the mock was called exactly once and with the specified arguments. .. doctest:: >>> mock = Mock(return_value=None) >>> mock('foo', bar='baz') >>> mock.assert_called_once_with('foo', bar='baz') >>> mock('foo', bar='baz') >>> mock.assert_called_once_with('foo', bar='baz') Traceback (most recent call last): ... AssertionError: Expected to be called once. Called 2 times. .. method:: assert_any_call(*args, **kwargs) assert the mock has been called with the specified arguments. The assert passes if the mock has *ever* been called, unlike :meth:`assert_called_with` and :meth:`assert_called_once_with` that only pass if the call is the most recent one. .. doctest:: >>> mock = Mock(return_value=None) >>> mock(1, 2, arg='thing') >>> mock('some', 'thing', 'else') >>> mock.assert_any_call(1, 2, arg='thing') .. method:: assert_has_calls(calls, any_order=False) assert the mock has been called with the specified calls. The `mock_calls` list is checked for the calls. If `any_order` is False (the default) then the calls must be sequential. There can be extra calls before or after the specified calls. If `any_order` is True then the calls can be in any order, but they must all appear in :attr:`mock_calls`. .. doctest:: >>> mock = Mock(return_value=None) >>> mock(1) >>> mock(2) >>> mock(3) >>> mock(4) >>> calls = [call(2), call(3)] >>> mock.assert_has_calls(calls) >>> calls = [call(4), call(2), call(3)] >>> mock.assert_has_calls(calls, any_order=True) .. method:: reset_mock() The reset_mock method resets all the call attributes on a mock object: .. doctest:: >>> mock = Mock(return_value=None) >>> mock('hello') >>> mock.called True >>> mock.reset_mock() >>> mock.called False This can be useful where you want to make a series of assertions that reuse the same object. Note that `reset_mock` *doesn't* clear the return value, :attr:`side_effect` or any child attributes you have set using normal assignment. Child mocks and the return value mock (if any) are reset as well. .. method:: mock_add_spec(spec, spec_set=False) Add a spec to a mock. `spec` can either be an object or a list of strings. Only attributes on the `spec` can be fetched as attributes from the mock. If `spec_set` is `True` then only attributes on the spec can be set. .. method:: attach_mock(mock, attribute) Attach a mock as an attribute of this one, replacing its name and parent. Calls to the attached mock will be recorded in the :attr:`method_calls` and :attr:`mock_calls` attributes of this one. .. method:: configure_mock(**kwargs) Set attributes on the mock through keyword arguments. Attributes plus return values and side effects can be set on child mocks using standard dot notation and unpacking a dictionary in the method call: .. doctest:: >>> mock = Mock() >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock.configure_mock(**attrs) >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyError The same thing can be achieved in the constructor call to mocks: .. doctest:: >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock = Mock(some_attribute='eggs', **attrs) >>> mock.some_attribute 'eggs' >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyError `configure_mock` exists to make it easier to do configuration after the mock has been created. .. method:: __dir__() `Mock` objects limit the results of `dir(some_mock)` to useful results. For mocks with a `spec` this includes all the permitted attributes for the mock. See :data:`FILTER_DIR` for what this filtering does, and how to switch it off. .. method:: _get_child_mock(**kw) Create the child mocks for attributes and return value. By default child mocks will be the same type as the parent. Subclasses of Mock may want to override this to customize the way child mocks are made. For non-callable mocks the callable variant will be used (rather than any custom subclass). .. attribute:: called A boolean representing whether or not the mock object has been called: .. doctest:: >>> mock = Mock(return_value=None) >>> mock.called False >>> mock() >>> mock.called True .. attribute:: call_count An integer telling you how many times the mock object has been called: .. doctest:: >>> mock = Mock(return_value=None) >>> mock.call_count 0 >>> mock() >>> mock() >>> mock.call_count 2 .. attribute:: return_value Set this to configure the value returned by calling the mock: .. doctest:: >>> mock = Mock() >>> mock.return_value = 'fish' >>> mock() 'fish' The default return value is a mock object and you can configure it in the normal way: .. doctest:: >>> mock = Mock() >>> mock.return_value.attribute = sentinel.Attribute >>> mock.return_value() >>> mock.return_value.assert_called_with() `return_value` can also be set in the constructor: .. doctest:: >>> mock = Mock(return_value=3) >>> mock.return_value 3 >>> mock() 3 .. attribute:: side_effect This can either be a function to be called when the mock is called, or an exception (class or instance) to be raised. If you pass in a function it will be called with same arguments as the mock and unless the function returns the :data:`DEFAULT` singleton the call to the mock will then return whatever the function returns. If the function returns :data:`DEFAULT` then the mock will return its normal value (from the :attr:`return_value`. An example of a mock that raises an exception (to test exception handling of an API): .. doctest:: >>> mock = Mock() >>> mock.side_effect = Exception('Boom!') >>> mock() Traceback (most recent call last): ... Exception: Boom! Using `side_effect` to return a sequence of values: .. doctest:: >>> mock = Mock() >>> mock.side_effect = [3, 2, 1] >>> mock(), mock(), mock() (3, 2, 1) The `side_effect` function is called with the same arguments as the mock (so it is wise for it to take arbitrary args and keyword arguments) and whatever it returns is used as the return value for the call. The exception is if `side_effect` returns :data:`DEFAULT`, in which case the normal :attr:`return_value` is used. .. doctest:: >>> mock = Mock(return_value=3) >>> def side_effect(*args, **kwargs): ... return DEFAULT ... >>> mock.side_effect = side_effect >>> mock() 3 `side_effect` can be set in the constructor. Here's an example that adds one to the value the mock is called with and returns it: .. doctest:: >>> side_effect = lambda value: value + 1 >>> mock = Mock(side_effect=side_effect) >>> mock(3) 4 >>> mock(-8) -7 Setting `side_effect` to `None` clears it: .. doctest:: >>> from mock import Mock >>> m = Mock(side_effect=KeyError, return_value=3) >>> m() Traceback (most recent call last): ... KeyError >>> m.side_effect = None >>> m() 3 .. attribute:: call_args This is either `None` (if the mock hasn't been called), or the arguments that the mock was last called with. This will be in the form of a tuple: the first member is any ordered arguments the mock was called with (or an empty tuple) and the second member is any keyword arguments (or an empty dictionary). .. doctest:: >>> mock = Mock(return_value=None) >>> print mock.call_args None >>> mock() >>> mock.call_args call() >>> mock.call_args == () True >>> mock(3, 4) >>> mock.call_args call(3, 4) >>> mock.call_args == ((3, 4),) True >>> mock(3, 4, 5, key='fish', next='w00t!') >>> mock.call_args call(3, 4, 5, key='fish', next='w00t!') `call_args`, along with members of the lists :attr:`call_args_list`, :attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These are tuples, so they can be unpacked to get at the individual arguments and make more complex assertions. See :ref:`calls as tuples `. .. attribute:: call_args_list This is a list of all the calls made to the mock object in sequence (so the length of the list is the number of times it has been called). Before any calls have been made it is an empty list. The :data:`call` object can be used for conveniently constructing lists of calls to compare with `call_args_list`. .. doctest:: >>> mock = Mock(return_value=None) >>> mock() >>> mock(3, 4) >>> mock(key='fish', next='w00t!') >>> mock.call_args_list [call(), call(3, 4), call(key='fish', next='w00t!')] >>> expected = [(), ((3, 4),), ({'key': 'fish', 'next': 'w00t!'},)] >>> mock.call_args_list == expected True Members of `call_args_list` are :data:`call` objects. These can be unpacked as tuples to get at the individual arguments. See :ref:`calls as tuples `. .. attribute:: method_calls As well as tracking calls to themselves, mocks also track calls to methods and attributes, and *their* methods and attributes: .. doctest:: >>> mock = Mock() >>> mock.method() >>> mock.property.method.attribute() >>> mock.method_calls [call.method(), call.property.method.attribute()] Members of `method_calls` are :data:`call` objects. These can be unpacked as tuples to get at the individual arguments. See :ref:`calls as tuples `. .. attribute:: mock_calls `mock_calls` records *all* calls to the mock object, its methods, magic methods *and* return value mocks. .. doctest:: >>> mock = MagicMock() >>> result = mock(1, 2, 3) >>> mock.first(a=3) >>> mock.second() >>> int(mock) 1 >>> result(1) >>> expected = [call(1, 2, 3), call.first(a=3), call.second(), ... call.__int__(), call()(1)] >>> mock.mock_calls == expected True Members of `mock_calls` are :data:`call` objects. These can be unpacked as tuples to get at the individual arguments. See :ref:`calls as tuples `. .. attribute:: __class__ Normally the `__class__` attribute of an object will return its type. For a mock object with a `spec` `__class__` returns the spec class instead. This allows mock objects to pass `isinstance` tests for the object they are replacing / masquerading as: .. doctest:: >>> mock = Mock(spec=3) >>> isinstance(mock, int) True `__class__` is assignable to, this allows a mock to pass an `isinstance` check without forcing you to use a spec: .. doctest:: >>> mock = Mock() >>> mock.__class__ = dict >>> isinstance(mock, dict) True .. class:: NonCallableMock(spec=None, wraps=None, name=None, spec_set=None, **kwargs) A non-callable version of `Mock`. The constructor parameters have the same meaning of `Mock`, with the exception of `return_value` and `side_effect` which have no meaning on a non-callable mock. Mock objects that use a class or an instance as a `spec` or `spec_set` are able to pass `isintance` tests: .. doctest:: >>> mock = Mock(spec=SomeClass) >>> isinstance(mock, SomeClass) True >>> mock = Mock(spec_set=SomeClass()) >>> isinstance(mock, SomeClass) True The `Mock` classes have support for mocking magic methods. See :ref:`magic methods ` for the full details. The mock classes and the :func:`patch` decorators all take arbitrary keyword arguments for configuration. For the `patch` decorators the keywords are passed to the constructor of the mock being created. The keyword arguments are for configuring attributes of the mock: .. doctest:: >>> m = MagicMock(attribute=3, other='fish') >>> m.attribute 3 >>> m.other 'fish' The return value and side effect of child mocks can be set in the same way, using dotted notation. As you can't use dotted names directly in a call you have to create a dictionary and unpack it using `**`: .. doctest:: >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError} >>> mock = Mock(some_attribute='eggs', **attrs) >>> mock.some_attribute 'eggs' >>> mock.method() 3 >>> mock.other() Traceback (most recent call last): ... KeyError .. class:: PropertyMock(*args, **kwargs) A mock intended to be used as a property, or other descriptor, on a class. `PropertyMock` provides `__get__` and `__set__` methods so you can specify a return value when it is fetched. Fetching a `PropertyMock` instance from an object calls the mock, with no args. Setting it calls the mock with the value being set. .. doctest:: >>> class Foo(object): ... @property ... def foo(self): ... return 'something' ... @foo.setter ... def foo(self, value): ... pass ... >>> with patch('__main__.Foo.foo', new_callable=PropertyMock) as mock_foo: ... mock_foo.return_value = 'mockity-mock' ... this_foo = Foo() ... print this_foo.foo ... this_foo.foo = 6 ... mockity-mock >>> mock_foo.mock_calls [call(), call(6)] Because of the way mock attributes are stored you can't directly attach a `PropertyMock` to a mock object. Instead you can attach it to the mock type object: .. doctest:: >>> m = MagicMock() >>> p = PropertyMock(return_value=3) >>> type(m).foo = p >>> m.foo 3 >>> p.assert_called_once_with() .. index:: __call__ .. index:: calling Calling ======= Mock objects are callable. The call will return the value set as the :attr:`~Mock.return_value` attribute. The default return value is a new Mock object; it is created the first time the return value is accessed (either explicitly or by calling the Mock) - but it is stored and the same one returned each time. Calls made to the object will be recorded in the attributes like :attr:`~Mock.call_args` and :attr:`~Mock.call_args_list`. If :attr:`~Mock.side_effect` is set then it will be called after the call has been recorded, so if `side_effect` raises an exception the call is still recorded. The simplest way to make a mock raise an exception when called is to make :attr:`~Mock.side_effect` an exception class or instance: .. doctest:: >>> m = MagicMock(side_effect=IndexError) >>> m(1, 2, 3) Traceback (most recent call last): ... IndexError >>> m.mock_calls [call(1, 2, 3)] >>> m.side_effect = KeyError('Bang!') >>> m('two', 'three', 'four') Traceback (most recent call last): ... KeyError: 'Bang!' >>> m.mock_calls [call(1, 2, 3), call('two', 'three', 'four')] If `side_effect` is a function then whatever that function returns is what calls to the mock return. The `side_effect` function is called with the same arguments as the mock. This allows you to vary the return value of the call dynamically, based on the input: .. doctest:: >>> def side_effect(value): ... return value + 1 ... >>> m = MagicMock(side_effect=side_effect) >>> m(1) 2 >>> m(2) 3 >>> m.mock_calls [call(1), call(2)] If you want the mock to still return the default return value (a new mock), or any set return value, then there are two ways of doing this. Either return `mock.return_value` from inside `side_effect`, or return :data:`DEFAULT`: .. doctest:: >>> m = MagicMock() >>> def side_effect(*args, **kwargs): ... return m.return_value ... >>> m.side_effect = side_effect >>> m.return_value = 3 >>> m() 3 >>> def side_effect(*args, **kwargs): ... return DEFAULT ... >>> m.side_effect = side_effect >>> m() 3 To remove a `side_effect`, and return to the default behaviour, set the `side_effect` to `None`: .. doctest:: >>> m = MagicMock(return_value=6) >>> def side_effect(*args, **kwargs): ... return 3 ... >>> m.side_effect = side_effect >>> m() 3 >>> m.side_effect = None >>> m() 6 The `side_effect` can also be any iterable object. Repeated calls to the mock will return values from the iterable (until the iterable is exhausted and a `StopIteration` is raised): .. doctest:: >>> m = MagicMock(side_effect=[1, 2, 3]) >>> m() 1 >>> m() 2 >>> m() 3 >>> m() Traceback (most recent call last): ... StopIteration If any members of the iterable are exceptions they will be raised instead of returned: .. doctest:: >>> iterable = (33, ValueError, 66) >>> m = MagicMock(side_effect=iterable) >>> m() 33 >>> m() Traceback (most recent call last): ... ValueError >>> m() 66 .. _deleting-attributes: Deleting Attributes =================== Mock objects create attributes on demand. This allows them to pretend to be objects of any type. You may want a mock object to return `False` to a `hasattr` call, or raise an `AttributeError` when an attribute is fetched. You can do this by providing an object as a `spec` for a mock, but that isn't always convenient. You "block" attributes by deleting them. Once deleted, accessing an attribute will raise an `AttributeError`. .. doctest:: >>> mock = MagicMock() >>> hasattr(mock, 'm') True >>> del mock.m >>> hasattr(mock, 'm') False >>> del mock.f >>> mock.f Traceback (most recent call last): ... AttributeError: f Attaching Mocks as Attributes ============================= When you attach a mock as an attribute of another mock (or as the return value) it becomes a "child" of that mock. Calls to the child are recorded in the :attr:`~Mock.method_calls` and :attr:`~Mock.mock_calls` attributes of the parent. This is useful for configuring child mocks and then attaching them to the parent, or for attaching mocks to a parent that records all calls to the children and allows you to make assertions about the order of calls between mocks: .. doctest:: >>> parent = MagicMock() >>> child1 = MagicMock(return_value=None) >>> child2 = MagicMock(return_value=None) >>> parent.child1 = child1 >>> parent.child2 = child2 >>> child1(1) >>> child2(2) >>> parent.mock_calls [call.child1(1), call.child2(2)] The exception to this is if the mock has a name. This allows you to prevent the "parenting" if for some reason you don't want it to happen. .. doctest:: >>> mock = MagicMock() >>> not_a_child = MagicMock(name='not-a-child') >>> mock.attribute = not_a_child >>> mock.attribute() >>> mock.mock_calls [] Mocks created for you by :func:`patch` are automatically given names. To attach mocks that have names to a parent you use the :meth:`~Mock.attach_mock` method: .. doctest:: >>> thing1 = object() >>> thing2 = object() >>> parent = MagicMock() >>> with patch('__main__.thing1', return_value=None) as child1: ... with patch('__main__.thing2', return_value=None) as child2: ... parent.attach_mock(child1, 'child1') ... parent.attach_mock(child2, 'child2') ... child1('one') ... child2('two') ... >>> parent.mock_calls [call.child1('one'), call.child2('two')] ----- .. [#] The only exceptions are magic methods and attributes (those that have leading and trailing double underscores). Mock doesn't create these but instead of raises an ``AttributeError``. This is because the interpreter will often implicitly request these methods, and gets *very* confused to get a new Mock object when it expects a magic method. If you need magic method support see :ref:`magic methods `. mock-1.0.1/html/_sources/mocksignature.txt0000644000076500001200000001761311710134311021353 0ustar michaeladmin00000000000000mocksignature ============= .. currentmodule:: mock .. note:: :ref:`auto-speccing`, added in mock 0.8, is a more advanced version of `mocksignature` and can be used for many of the same use cases. A problem with using mock objects to replace real objects in your tests is that :class:`Mock` can be *too* flexible. Your code can treat the mock objects in any way and you have to manually check that they were called correctly. If your code calls functions or methods with the wrong number of arguments then mocks don't complain. The solution to this is `mocksignature`, which creates functions with the same signature as the original, but delegating to a mock. You can interrogate the mock in the usual way to check it has been called with the *right* arguments, but if it is called with the wrong number of arguments it will raise a `TypeError` in the same way your production code would. Another advantage is that your mocked objects are real functions, which can be useful when your code uses `inspect `_ or depends on functions being function objects. .. function:: mocksignature(func, mock=None, skipfirst=False) Create a new function with the same signature as `func` that delegates to `mock`. If `skipfirst` is True the first argument is skipped, useful for methods where `self` needs to be omitted from the new function. If you don't pass in a `mock` then one will be created for you. Functions returned by `mocksignature` have many of the same attributes and assert methods as a mock object. The mock is set as the `mock` attribute of the returned function for easy access. `mocksignature` can also be used with classes. It copies the signature of the `__init__` method. When used with callable objects (instances) it copies the signature of the `__call__` method. `mocksignature` will work out if it is mocking the signature of a method on an instance or a method on a class and do the "right thing" with the `self` argument in both cases. Because of a limitation in the way that arguments are collected by functions created by `mocksignature` they are *always* passed as positional arguments (including defaults) and not keyword arguments. mocksignature api ----------------- Although the objects returned by `mocksignature` api are real function objects, they have much of the same api as the :class:`Mock` class. This includes the assert methods: .. doctest:: >>> def func(a, b, c): ... pass ... >>> func2 = mocksignature(func) >>> func2.called False >>> func2.return_value = 3 >>> func2(1, 2, 3) 3 >>> func2.called True >>> func2.assert_called_once_with(1, 2, 3) >>> func2.assert_called_with(1, 2, 4) Traceback (most recent call last): ... AssertionError: Expected call: mock(1, 2, 4) Actual call: mock(1, 2, 3) >>> func2.call_count 1 >>> func2.side_effect = IndexError >>> func2(4, 5, 6) Traceback (most recent call last): ... IndexError The mock object that is being delegated to is available as the `mock` attribute of the function created by `mocksignature`. .. doctest:: >>> func2.mock.mock_calls [call(1, 2, 3), call(4, 5, 6)] The methods and attributes available on functions returned by `mocksignature` are: :meth:`~Mock.assert_any_call`, :meth:`~Mock.assert_called_once_with`, :meth:`~Mock.assert_called_with`, :meth:`~Mock.assert_has_calls`, :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock.call_count`, :attr:`~Mock.called`, :attr:`~Mock.method_calls`, `mock`, :attr:`~Mock.mock_calls`, :meth:`~Mock.reset_mock`, :attr:`~Mock.return_value`, and :attr:`~Mock.side_effect`. Example use ----------- Basic use ~~~~~~~~~ .. doctest:: >>> def function(a, b, c=None): ... pass ... >>> mock = Mock() >>> function = mocksignature(function, mock) >>> function() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (0 given) >>> function.return_value = 'some value' >>> function(1, 2, 'foo') 'some value' >>> function.assert_called_with(1, 2, 'foo') Keyword arguments ~~~~~~~~~~~~~~~~~ Note that arguments to functions created by `mocksignature` are always passed in to the underlying mock by position even when called with keywords: .. doctest:: >>> def function(a, b, c=None): ... pass ... >>> function = mocksignature(function) >>> function.return_value = None >>> function(1, 2) >>> function.assert_called_with(1, 2, None) Mocking methods and self ~~~~~~~~~~~~~~~~~~~~~~~~ When you use `mocksignature` to replace a method on a class then `self` will be included in the method signature - and you will need to include the instance when you do your asserts. As a curious factor of the way Python (2) wraps methods fetched from a class, we can *get* the `return_value` from a function set on a class, but we can't set it. We have to do this through the exposed `mock` attribute instead: .. doctest:: >>> class SomeClass(object): ... def method(self, a, b, c=None): ... pass ... >>> SomeClass.method = mocksignature(SomeClass.method) >>> SomeClass.method.mock.return_value = None >>> instance = SomeClass() >>> instance.method() Traceback (most recent call last): ... TypeError: () takes at least 4 arguments (1 given) >>> instance.method(1, 2, 3) >>> instance.method.assert_called_with(instance, 1, 2, 3) When you use `mocksignature` on instance methods `self` isn't included (and we can set the `return_value` etc directly): .. doctest:: >>> class SomeClass(object): ... def method(self, a, b, c=None): ... pass ... >>> instance = SomeClass() >>> instance.method = mocksignature(instance.method) >>> instance.method.return_value = None >>> instance.method(1, 2, 3) >>> instance.method.assert_called_with(1, 2, 3) mocksignature with classes ~~~~~~~~~~~~~~~~~~~~~~~~~~ When used with a class `mocksignature` copies the signature of the `__init__` method. .. doctest:: >>> class Something(object): ... def __init__(self, foo, bar): ... pass ... >>> MockSomething = mocksignature(Something) >>> instance = MockSomething(10, 9) >>> assert instance is MockSomething.return_value >>> MockSomething.assert_called_with(10, 9) >>> MockSomething() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (0 given) Because the object returned by `mocksignature` is a function rather than a `Mock` you lose the other capabilities of `Mock`, like dynamic attribute creation. mocksignature with callable objects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When used with a callable object `mocksignature` copies the signature of the `__call__` method. .. doctest:: >>> class Something(object): ... def __call__(self, spam, eggs): ... pass ... >>> something = Something() >>> mock_something = mocksignature(something) >>> result = mock_something(10, 9) >>> mock_something.assert_called_with(10, 9) >>> mock_something() Traceback (most recent call last): ... TypeError: () takes at least 2 arguments (0 given) mocksignature argument to patch ------------------------------- `mocksignature` is available as a keyword argument to :func:`patch` or :func:`patch.object`. It can be used with functions / methods / classes and callable objects. .. doctest:: >>> class SomeClass(object): ... def method(self, a, b, c=None): ... pass ... >>> @patch.object(SomeClass, 'method', mocksignature=True) ... def test(mock_method): ... instance = SomeClass() ... mock_method.return_value = None ... instance.method(1, 2) ... mock_method.assert_called_with(instance, 1, 2, None) ... >>> test() mock-1.0.1/html/_sources/patch.txt0000644000076500001200000005366711765173623017633 0ustar michaeladmin00000000000000================== Patch Decorators ================== .. currentmodule:: mock .. testsetup:: class SomeClass(object): static_method = None class_method = None attribute = None sys.modules['package'] = package = Mock(name='package') sys.modules['package.module'] = package.module class TestCase(unittest2.TestCase): def run(self): result = unittest2.TestResult() super(unittest2.TestCase, self).run(result) assert result.wasSuccessful() .. testcleanup:: patch.TEST_PREFIX = 'test' The patch decorators are used for patching objects only within the scope of the function they decorate. They automatically handle the unpatching for you, even if exceptions are raised. All of these functions can also be used in with statements or as class decorators. patch ===== .. note:: `patch` is straightforward to use. The key is to do the patching in the right namespace. See the section `where to patch`_. .. function:: patch(target, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs) `patch` acts as a function decorator, class decorator or a context manager. Inside the body of the function or with statement, the `target` is patched with a `new` object. When the function/with statement exits the patch is undone. If `new` is omitted, then the target is replaced with a :class:`MagicMock`. If `patch` is used as a decorator and `new` is omitted, the created mock is passed in as an extra argument to the decorated function. If `patch` is used as a context manager the created mock is returned by the context manager. `target` should be a string in the form `'package.module.ClassName'`. The `target` is imported and the specified object replaced with the `new` object, so the `target` must be importable from the environment you are calling `patch` from. The target is imported when the decorated function is executed, not at decoration time. The `spec` and `spec_set` keyword arguments are passed to the `MagicMock` if patch is creating one for you. In addition you can pass `spec=True` or `spec_set=True`, which causes patch to pass in the object being mocked as the spec/spec_set object. `new_callable` allows you to specify a different class, or callable object, that will be called to create the `new` object. By default `MagicMock` is used. A more powerful form of `spec` is `autospec`. If you set `autospec=True` then the mock with be created with a spec from the object being replaced. All attributes of the mock will also have the spec of the corresponding attribute of the object being replaced. Methods and functions being mocked will have their arguments checked and will raise a `TypeError` if they are called with the wrong signature. For mocks replacing a class, their return value (the 'instance') will have the same spec as the class. See the :func:`create_autospec` function and :ref:`auto-speccing`. Instead of `autospec=True` you can pass `autospec=some_object` to use an arbitrary object as the spec instead of the one being replaced. By default `patch` will fail to replace attributes that don't exist. If you pass in `create=True`, and the attribute doesn't exist, patch will create the attribute for you when the patched function is called, and delete it again afterwards. This is useful for writing tests against attributes that your production code creates at runtime. It is off by by default because it can be dangerous. With it switched on you can write passing tests against APIs that don't actually exist! Patch can be used as a `TestCase` class decorator. It works by decorating each test method in the class. This reduces the boilerplate code when your test methods share a common patchings set. `patch` finds tests by looking for method names that start with `patch.TEST_PREFIX`. By default this is `test`, which matches the way `unittest` finds tests. You can specify an alternative prefix by setting `patch.TEST_PREFIX`. Patch can be used as a context manager, with the with statement. Here the patching applies to the indented block after the with statement. If you use "as" then the patched object will be bound to the name after the "as"; very useful if `patch` is creating a mock object for you. `patch` takes arbitrary keyword arguments. These will be passed to the `Mock` (or `new_callable`) on construction. `patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are available for alternate use-cases. `patch` as function decorator, creating the mock for you and passing it into the decorated function: .. doctest:: >>> @patch('__main__.SomeClass') ... def function(normal_argument, mock_class): ... print mock_class is SomeClass ... >>> function(None) True Patching a class replaces the class with a `MagicMock` *instance*. If the class is instantiated in the code under test then it will be the :attr:`~Mock.return_value` of the mock that will be used. If the class is instantiated multiple times you could use :attr:`~Mock.side_effect` to return a new mock each time. Alternatively you can set the `return_value` to be anything you want. To configure return values on methods of *instances* on the patched class you must do this on the `return_value`. For example: .. doctest:: >>> class Class(object): ... def method(self): ... pass ... >>> with patch('__main__.Class') as MockClass: ... instance = MockClass.return_value ... instance.method.return_value = 'foo' ... assert Class() is instance ... assert Class().method() == 'foo' ... If you use `spec` or `spec_set` and `patch` is replacing a *class*, then the return value of the created mock will have the same spec. .. doctest:: >>> Original = Class >>> patcher = patch('__main__.Class', spec=True) >>> MockClass = patcher.start() >>> instance = MockClass() >>> assert isinstance(instance, Original) >>> patcher.stop() The `new_callable` argument is useful where you want to use an alternative class to the default :class:`MagicMock` for the created mock. For example, if you wanted a :class:`NonCallableMock` to be used: .. doctest:: >>> thing = object() >>> with patch('__main__.thing', new_callable=NonCallableMock) as mock_thing: ... assert thing is mock_thing ... thing() ... Traceback (most recent call last): ... TypeError: 'NonCallableMock' object is not callable Another use case might be to replace an object with a `StringIO` instance: .. doctest:: >>> from StringIO import StringIO >>> def foo(): ... print 'Something' ... >>> @patch('sys.stdout', new_callable=StringIO) ... def test(mock_stdout): ... foo() ... assert mock_stdout.getvalue() == 'Something\n' ... >>> test() When `patch` is creating a mock for you, it is common that the first thing you need to do is to configure the mock. Some of that configuration can be done in the call to patch. Any arbitrary keywords you pass into the call will be used to set attributes on the created mock: .. doctest:: >>> patcher = patch('__main__.thing', first='one', second='two') >>> mock_thing = patcher.start() >>> mock_thing.first 'one' >>> mock_thing.second 'two' As well as attributes on the created mock attributes, like the :attr:`~Mock.return_value` and :attr:`~Mock.side_effect`, of child mocks can also be configured. These aren't syntactically valid to pass in directly as keyword arguments, but a dictionary with these as keys can still be expanded into a `patch` call using `**`: .. doctest:: >>> config = {'method.return_value': 3, 'other.side_effect': KeyError} >>> patcher = patch('__main__.thing', **config) >>> mock_thing = patcher.start() >>> mock_thing.method() 3 >>> mock_thing.other() Traceback (most recent call last): ... KeyError patch.object ============ .. function:: patch.object(target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs) patch the named member (`attribute`) on an object (`target`) with a mock object. `patch.object` can be used as a decorator, class decorator or a context manager. Arguments `new`, `spec`, `create`, `spec_set`, `autospec` and `new_callable` have the same meaning as for `patch`. Like `patch`, `patch.object` takes arbitrary keyword arguments for configuring the mock object it creates. When used as a class decorator `patch.object` honours `patch.TEST_PREFIX` for choosing which methods to wrap. You can either call `patch.object` with three arguments or two arguments. The three argument form takes the object to be patched, the attribute name and the object to replace the attribute with. When calling with the two argument form you omit the replacement object, and a mock is created for you and passed in as an extra argument to the decorated function: .. doctest:: >>> @patch.object(SomeClass, 'class_method') ... def test(mock_method): ... SomeClass.class_method(3) ... mock_method.assert_called_with(3) ... >>> test() `spec`, `create` and the other arguments to `patch.object` have the same meaning as they do for `patch`. patch.dict ========== .. function:: patch.dict(in_dict, values=(), clear=False, **kwargs) Patch a dictionary, or dictionary like object, and restore the dictionary to its original state after the test. `in_dict` can be a dictionary or a mapping like container. If it is a mapping then it must at least support getting, setting and deleting items plus iterating over keys. `in_dict` can also be a string specifying the name of the dictionary, which will then be fetched by importing it. `values` can be a dictionary of values to set in the dictionary. `values` can also be an iterable of `(key, value)` pairs. If `clear` is True then the dictionary will be cleared before the new values are set. `patch.dict` can also be called with arbitrary keyword arguments to set values in the dictionary. `patch.dict` can be used as a context manager, decorator or class decorator. When used as a class decorator `patch.dict` honours `patch.TEST_PREFIX` for choosing which methods to wrap. `patch.dict` can be used to add members to a dictionary, or simply let a test change a dictionary, and ensure the dictionary is restored when the test ends. .. doctest:: >>> from mock import patch >>> foo = {} >>> with patch.dict(foo, {'newkey': 'newvalue'}): ... assert foo == {'newkey': 'newvalue'} ... >>> assert foo == {} >>> import os >>> with patch.dict('os.environ', {'newkey': 'newvalue'}): ... print os.environ['newkey'] ... newvalue >>> assert 'newkey' not in os.environ Keywords can be used in the `patch.dict` call to set values in the dictionary: .. doctest:: >>> mymodule = MagicMock() >>> mymodule.function.return_value = 'fish' >>> with patch.dict('sys.modules', mymodule=mymodule): ... import mymodule ... mymodule.function('some', 'args') ... 'fish' `patch.dict` can be used with dictionary like objects that aren't actually dictionaries. At the very minimum they must support item getting, setting, deleting and either iteration or membership test. This corresponds to the magic methods `__getitem__`, `__setitem__`, `__delitem__` and either `__iter__` or `__contains__`. .. doctest:: >>> class Container(object): ... def __init__(self): ... self.values = {} ... def __getitem__(self, name): ... return self.values[name] ... def __setitem__(self, name, value): ... self.values[name] = value ... def __delitem__(self, name): ... del self.values[name] ... def __iter__(self): ... return iter(self.values) ... >>> thing = Container() >>> thing['one'] = 1 >>> with patch.dict(thing, one=2, two=3): ... assert thing['one'] == 2 ... assert thing['two'] == 3 ... >>> assert thing['one'] == 1 >>> assert list(thing) == ['one'] patch.multiple ============== .. function:: patch.multiple(target, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs) Perform multiple patches in a single call. It takes the object to be patched (either as an object or a string to fetch the object by importing) and keyword arguments for the patches:: with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'): ... Use :data:`DEFAULT` as the value if you want `patch.multiple` to create mocks for you. In this case the created mocks are passed into a decorated function by keyword, and a dictionary is returned when `patch.multiple` is used as a context manager. `patch.multiple` can be used as a decorator, class decorator or a context manager. The arguments `spec`, `spec_set`, `create`, `autospec` and `new_callable` have the same meaning as for `patch`. These arguments will be applied to *all* patches done by `patch.multiple`. When used as a class decorator `patch.multiple` honours `patch.TEST_PREFIX` for choosing which methods to wrap. If you want `patch.multiple` to create mocks for you, then you can use :data:`DEFAULT` as the value. If you use `patch.multiple` as a decorator then the created mocks are passed into the decorated function by keyword. .. doctest:: >>> thing = object() >>> other = object() >>> @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) ... def test_function(thing, other): ... assert isinstance(thing, MagicMock) ... assert isinstance(other, MagicMock) ... >>> test_function() `patch.multiple` can be nested with other `patch` decorators, but put arguments passed by keyword *after* any of the standard arguments created by `patch`: .. doctest:: >>> @patch('sys.exit') ... @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) ... def test_function(mock_exit, other, thing): ... assert 'other' in repr(other) ... assert 'thing' in repr(thing) ... assert 'exit' in repr(mock_exit) ... >>> test_function() If `patch.multiple` is used as a context manager, the value returned by the context manger is a dictionary where created mocks are keyed by name: .. doctest:: >>> with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as values: ... assert 'other' in repr(values['other']) ... assert 'thing' in repr(values['thing']) ... assert values['thing'] is thing ... assert values['other'] is other ... .. _start-and-stop: patch methods: start and stop ============================= All the patchers have `start` and `stop` methods. These make it simpler to do patching in `setUp` methods or where you want to do multiple patches without nesting decorators or with statements. To use them call `patch`, `patch.object` or `patch.dict` as normal and keep a reference to the returned `patcher` object. You can then call `start` to put the patch in place and `stop` to undo it. If you are using `patch` to create a mock for you then it will be returned by the call to `patcher.start`. .. doctest:: >>> patcher = patch('package.module.ClassName') >>> from package import module >>> original = module.ClassName >>> new_mock = patcher.start() >>> assert module.ClassName is not original >>> assert module.ClassName is new_mock >>> patcher.stop() >>> assert module.ClassName is original >>> assert module.ClassName is not new_mock A typical use case for this might be for doing multiple patches in the `setUp` method of a `TestCase`: .. doctest:: >>> class MyTest(TestCase): ... def setUp(self): ... self.patcher1 = patch('package.module.Class1') ... self.patcher2 = patch('package.module.Class2') ... self.MockClass1 = self.patcher1.start() ... self.MockClass2 = self.patcher2.start() ... ... def tearDown(self): ... self.patcher1.stop() ... self.patcher2.stop() ... ... def test_something(self): ... assert package.module.Class1 is self.MockClass1 ... assert package.module.Class2 is self.MockClass2 ... >>> MyTest('test_something').run() .. caution:: If you use this technique you must ensure that the patching is "undone" by calling `stop`. This can be fiddlier than you might think, because if an exception is raised in the setUp then tearDown is not called. `unittest2 `_ cleanup functions make this easier. .. doctest:: >>> class MyTest(TestCase): ... def setUp(self): ... patcher = patch('package.module.Class') ... self.MockClass = patcher.start() ... self.addCleanup(patcher.stop) ... ... def test_something(self): ... assert package.module.Class is self.MockClass ... >>> MyTest('test_something').run() As an added bonus you no longer need to keep a reference to the `patcher` object. It is also possible to stop all patches which have been started by using `patch.stopall`. .. function:: patch.stopall Stop all active patches. Only stops patches started with `start`. TEST_PREFIX =========== All of the patchers can be used as class decorators. When used in this way they wrap every test method on the class. The patchers recognise methods that start with `test` as being test methods. This is the same way that the `unittest.TestLoader` finds test methods by default. It is possible that you want to use a different prefix for your tests. You can inform the patchers of the different prefix by setting `patch.TEST_PREFIX`: .. doctest:: >>> patch.TEST_PREFIX = 'foo' >>> value = 3 >>> >>> @patch('__main__.value', 'not three') ... class Thing(object): ... def foo_one(self): ... print value ... def foo_two(self): ... print value ... >>> >>> Thing().foo_one() not three >>> Thing().foo_two() not three >>> value 3 Nesting Patch Decorators ======================== If you want to perform multiple patches then you can simply stack up the decorators. You can stack up multiple patch decorators using this pattern: .. doctest:: >>> @patch.object(SomeClass, 'class_method') ... @patch.object(SomeClass, 'static_method') ... def test(mock1, mock2): ... assert SomeClass.static_method is mock1 ... assert SomeClass.class_method is mock2 ... SomeClass.static_method('foo') ... SomeClass.class_method('bar') ... return mock1, mock2 ... >>> mock1, mock2 = test() >>> mock1.assert_called_once_with('foo') >>> mock2.assert_called_once_with('bar') Note that the decorators are applied from the bottom upwards. This is the standard way that Python applies decorators. The order of the created mocks passed into your test function matches this order. Like all context-managers patches can be nested using contextlib's nested function; *every* patching will appear in the tuple after "as": .. doctest:: >>> from contextlib import nested >>> with nested( ... patch('package.module.ClassName1'), ... patch('package.module.ClassName2') ... ) as (MockClass1, MockClass2): ... assert package.module.ClassName1 is MockClass1 ... assert package.module.ClassName2 is MockClass2 ... .. _where-to-patch: Where to patch ============== `patch` works by (temporarily) changing the object that a *name* points to with another one. There can be many names pointing to any individual object, so for patching to work you must ensure that you patch the name used by the system under test. The basic principle is that you patch where an object is *looked up*, which is not necessarily the same place as where it is defined. A couple of examples will help to clarify this. Imagine we have a project that we want to test with the following structure:: a.py -> Defines SomeClass b.py -> from a import SomeClass -> some_function instantiates SomeClass Now we want to test `some_function` but we want to mock out `SomeClass` using `patch`. The problem is that when we import module b, which we will have to do then it imports `SomeClass` from module a. If we use `patch` to mock out `a.SomeClass` then it will have no effect on our test; module b already has a reference to the *real* `SomeClass` and it looks like our patching had no effect. The key is to patch out `SomeClass` where it is used (or where it is looked up ). In this case `some_function` will actually look up `SomeClass` in module b, where we have imported it. The patching should look like: `@patch('b.SomeClass')` However, consider the alternative scenario where instead of `from a import SomeClass` module b does `import a` and `some_function` uses `a.SomeClass`. Both of these import forms are common. In this case the class we want to patch is being looked up on the a module and so we have to patch `a.SomeClass` instead: `@patch('a.SomeClass')` Patching Descriptors and Proxy Objects ====================================== Since version 0.6.0 both patch_ and patch.object_ have been able to correctly patch and restore descriptors: class methods, static methods and properties. You should patch these on the *class* rather than an instance. Since version 0.7.0 patch_ and patch.object_ work correctly with some objects that proxy attribute access, like the `django setttings object `_. .. note:: In django `import settings` and `from django.conf import settings` return different objects. If you are using libraries / apps that do both you may have to patch both. Grrr... mock-1.0.1/html/_sources/sentinel.txt0000644000076500001200000000300111707122346020316 0ustar michaeladmin00000000000000========== Sentinel ========== .. currentmodule:: mock .. testsetup:: class ProductionClass(object): def something(self): return self.method() class Test(unittest2.TestCase): def testSomething(self): pass self = Test('testSomething') .. data:: sentinel The ``sentinel`` object provides a convenient way of providing unique objects for your tests. Attributes are created on demand when you access them by name. Accessing the same attribute will always return the same object. The objects returned have a sensible repr so that test failure messages are readable. .. data:: DEFAULT The `DEFAULT` object is a pre-created sentinel (actually `sentinel.DEFAULT`). It can be used by :attr:`~Mock.side_effect` functions to indicate that the normal return value should be used. Sentinel Example ================ Sometimes when testing you need to test that a specific object is passed as an argument to another method, or returned. It can be common to create named sentinel objects to test this. `sentinel` provides a convenient way of creating and testing the identity of objects like this. In this example we monkey patch `method` to return `sentinel.some_object`: .. doctest:: >>> real = ProductionClass() >>> real.method = Mock(name="method") >>> real.method.return_value = sentinel.some_object >>> result = real.method() >>> assert result is sentinel.some_object >>> sentinel.some_object sentinel.some_object mock-1.0.1/html/_static/0000755000076500001200000000000012046031032015532 5ustar michaeladmin00000000000000mock-1.0.1/html/_static/adctheme.css0000644000076500001200000003261411532040043020025 0ustar michaeladmin00000000000000/** * Sphinx stylesheet -- basic theme * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ h3 { color:#000000; font-size: 17px; margin-bottom:0.5em; margin-top:2em; } /* -- main layout ----------------------------------------------------------- */ div.clearer { clear: both; } /* -- header ---------------------------------------------------------------- */ #header #title { background:#29334F url(title_background.png) repeat-x scroll 0 0; border-bottom:1px solid #B6B6B6; height:25px; overflow:hidden; } #headerButtons { position: absolute; list-style: none outside; top: 26px; left: 0px; right: 0px; margin: 0px; padding: 0px; border-top: 1px solid #2B334F; border-bottom: 1px solid #EDEDED; height: 20px; font-size: 8pt; overflow: hidden; background-color: #D8D8D8; } #headerButtons li { background-repeat:no-repeat; display:inline; margin-top:0; padding:0; } .headerButton { display: inline; height:20px; } .headerButton a { text-decoration: none; float: right; height: 20px; padding: 4px 15px; border-left: 1px solid #ACACAC; font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; color: black; } .headerButton a:hover { color: white; background-color: #787878; } li#toc_button { text-align:left; } li#toc_button .headerButton a { width:198px; padding-top: 4px; font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; color: black; float: left; padding-left:15px; border-right:1px solid #ACACAC; background:transparent url(triangle_open.png) no-repeat scroll 4px 6px; } li#toc_button .headerButton a:hover { background-color: #787878; color: white; } li#page_buttons { position:absolute; right:0; } #breadcrumbs { color: black; background-image:url(breadcrumb_background.png); border-top:1px solid #2B334F; bottom:0; font-size:10px; height:15px; left:0; overflow:hidden; padding:3px 10px 0; position:absolute; right:0; white-space:nowrap; z-index:901; } #breadcrumbs a { color: black; text-decoration: none; } #breadcrumbs a:hover { text-decoration: underline; } #breadcrumbs img { padding-left: 3px; } /* -- sidebar --------------------------------------------------------------- */ #sphinxsidebar { position: absolute; top: 84px; bottom: 19px; left: 0px; width: 229px; background-color: #E4EBF7; border-right: 1px solid #ACACAC; border-top: 1px solid #2B334F; overflow-x: hidden; overflow-y: auto; padding: 0px 0px 0px 0px; font-size:11px; } div.sphinxsidebarwrapper { padding: 10px 5px 0 10px; } #sphinxsidebar li { margin: 0px; padding: 0px; font-weight: normal; margin: 0px 0px 7px 0px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; } #sphinxsidebar ul { list-style: none; margin: 0px 0px 0px 0px; padding: 0px 5px 0px 5px; } #sphinxsidebar ul ul, #sphinxsidebar ul.want-points { list-style: square; } #sphinxsidebar ul ul { margin-top: 0; margin-bottom: 0; } #sphinxsidebar form { margin-top: 10px; } #sphinxsidebar input { border: 1px solid #787878; font-family: sans-serif; font-size: 1em; } img { border: 0; } #sphinxsidebar li.toctree-l1 a { font-weight: bold; color: #000; text-decoration: none; } #sphinxsidebar li.toctree-l2 a { font-weight: bold; color: #4f4f4f; text-decoration: none; } /* -- search page ----------------------------------------------------------- */ ul.search { margin: 10px 0 0 20px; padding: 0; } ul.search li { padding: 5px 0 5px 20px; background-image: url(file.png); background-repeat: no-repeat; background-position: 0 7px; } ul.search li a { font-weight: bold; } ul.search li div.context { color: #888; margin: 2px 0 0 30px; text-align: left; } ul.keywordmatches li.goodmatch a { font-weight: bold; } #sphinxsidebar input.prettysearch {border:none;} input.searchbutton { float: right; } .search-wrapper {width: 100%; height: 25px;} .search-wrapper input.prettysearch { border: none; width:200px; height: 16px; background: url(searchfield_repeat.png) center top repeat-x; border: 0px; margin: 0; padding: 3px 0 0 0; font: 11px "Lucida Grande", "Lucida Sans Unicode", Arial, sans-serif; } .search-wrapper input.prettysearch { width: 184px; margin-left: 20px; *margin-top:-1px; *margin-right:-2px; *margin-left:10px; } .search-wrapper .search-left { display: block; position: absolute; width: 20px; height: 19px; background: url(searchfield_leftcap.png) left top no-repeat; } .search-wrapper .search-right { display: block; position: relative; left: 204px; top: -19px; width: 10px; height: 19px; background: url(searchfield_rightcap.png) right top no-repeat; } /* -- index page ------------------------------------------------------------ */ table.contentstable { width: 90%; } table.contentstable p.biglink { line-height: 150%; } a.biglink { font-size: 1.3em; } span.linkdescr { font-style: italic; padding-top: 5px; font-size: 90%; } /* -- general index --------------------------------------------------------- */ table.indextable td { text-align: left; vertical-align: top; } table.indextable dl, table.indextable dd { margin-top: 0; margin-bottom: 0; } table.indextable tr.pcap { height: 10px; } table.indextable tr.cap { margin-top: 10px; background-color: #f2f2f2; } img.toggler { margin-right: 3px; margin-top: 3px; cursor: pointer; } /* -- general body styles --------------------------------------------------- */ .document { border-top:1px solid #2B334F; overflow:auto; padding-left:2em; padding-right:2em; position:absolute; z-index:1; top:84px; bottom:19px; right:0; left:230px; } a.headerlink { visibility: hidden; } h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, h4:hover > a.headerlink, h5:hover > a.headerlink, h6:hover > a.headerlink, dt:hover > a.headerlink { visibility: visible; } div.body p.caption { text-align: inherit; } div.body td { text-align: left; } .field-list ul { padding-left: 1em; } .first { margin-top: 0 !important; } p.rubric { margin-top: 30px; font-weight: bold; } /* -- sidebars -------------------------------------------------------------- */ /*div.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; padding: 7px 7px 0 7px; background-color: #ffe; width: 40%; float: right; } p.sidebar-title { font-weight: bold; } */ /* -- topics ---------------------------------------------------------------- */ div.topic { border: 1px solid #ccc; padding: 7px 7px 0 7px; margin: 10px 0 10px 0; } p.topic-title { font-size: 1.1em; font-weight: bold; margin-top: 10px; } /* -- admonitions ----------------------------------------------------------- */ .admonition { border: 1px solid #a1a5a9; background-color: #f7f7f7; margin: 20px; padding: 0px 8px 7px 9px; text-align: left; } .warning { background-color:#E8E8E8; border:1px solid #111111; margin:30px; } .admonition p { font: 12px 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-top: 7px; margin-bottom: 0px; } div.admonition dt { font-weight: bold; } div.admonition dl { margin-bottom: 0; } p.admonition-title { margin: 0px 10px 5px 0px; font-weight: bold; padding-top: 3px; } div.body p.centered { text-align: center; margin-top: 25px; } /* -- tables ---------------------------------------------------------------- */ table.docutils { border-collapse: collapse; border-top: 1px solid #919699; border-left: 1px solid #919699; border-right: 1px solid #919699; font-size:12px; padding:8px; text-align:left; vertical-align:top; } table.docutils td, table.docutils th { padding: 8px; font-size: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #919699; } table.docutils th { font-weight: bold; } /* This alternates colors in up to six table rows (light blue for odd, white for even)*/ .docutils tr { background: #F0F5F9; } .docutils tr + tr { background: #FFFFFF; } .docutils tr + tr + tr { background: #F0F5F9; } .docutils tr + tr + tr + tr { background: #FFFFFF; } .docutils tr + tr + tr +tr + tr { background: #F0F5F9; } .docutils tr + tr + tr + tr + tr + tr { background: #FFFFFF; } .docutils tr + tr + tr + tr + tr + tr + tr { background: #F0F5F9; } table.footnote td, table.footnote th { border: 0 !important; } th { text-align: left; padding-right: 5px; } /* -- other body styles ----------------------------------------------------- */ dl { margin-bottom: 15px; } dd p { margin-top: 0px; font-size: 12px; } dd ul, dd table { margin-bottom: 10px; } dd { margin-top: 3px; margin-bottom: 10px; margin-left: 30px; font-size: 12px; } dt:target, .highlight { background-color: #fbe54e; } dl.glossary dt { font-weight: bold; font-size: 0.8em; } dl.glossary dd { font-size:12px; } .field-list ul { vertical-align: top; margin: 0; padding-bottom: 0; list-style: none inside; } .field-list ul li { margin-top: 0; } .field-list p { margin: 0; } .refcount { color: #060; } .optional { font-size: 1.3em; } .versionmodified { font-style: italic; } .system-message { background-color: #fda; padding: 5px; border: 3px solid red; } .footnote:target { background-color: #ffa } /* -- code displays --------------------------------------------------------- */ pre { overflow: auto; background-color:#F1F5F9; border:1px solid #C9D1D7; border-spacing:0; font-family:"Bitstream Vera Sans Mono",Monaco,"Lucida Console",Courier,Consolas,monospace; font-size:11px; padding: 10px; } td.linenos pre { padding: 5px 0px; border: 0; background-color: transparent; color: #aaa; } table.highlighttable { margin-left: 0.5em; } table.highlighttable td { padding: 0 0.5em 0 0.5em; } tt { font-family:"Bitstream Vera Sans Mono",Monaco,"Lucida Console",Courier,Consolas,monospace; } tt.descname { background-color: transparent; font-weight: bold; font-size: 1em; } tt.descclassname { background-color: transparent; } tt.xref, a tt { background-color: transparent; font-weight: bold; } h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { background-color: transparent; } /* -- math display ---------------------------------------------------------- */ img.math { vertical-align: middle; } div.body div.math p { text-align: center; } span.eqno { float: right; } /* -- printout stylesheet --------------------------------------------------- */ @media print { div.document, div.documentwrapper, div.bodywrapper { margin: 0; width: 100%; } div.sphinxsidebar, div.related, div.footer, #top-link { display: none; } } body { font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; } dl.class dt { padding: 3px; /* border-top: 2px solid #999;*/ } em.property { font-style: normal; } dl.class dd p { margin-top: 6px; } dl.class dd dl.exception dt { padding: 3px; background-color: #FFD6D6; border-top: none; } dl.class dd dl.method dt { padding: 3px; background-color: #e9e9e9; border-top: none; } dl.function dt { padding: 3px; border-top: 2px solid #999; } ul { list-style-image:none; list-style-position:outside; list-style-type:square; margin:0 0 0 30px; padding:0 0 12px 6px; } #docstitle { height: 36px; background-image: url(header_sm_mid.png); left: 0; top: 0; position: absolute; width: 100%; } #docstitle p { padding:7px 0 0 45px; margin: 0; color: white; text-shadow:0 1px 0 #787878; background: transparent url(documentation.png) no-repeat scroll 10px 3px; height: 36px; font-size: 15px; } #header { height:45px; left:0; position:absolute; right:0; top:36px; z-index:900; } #header h1 { font-size:10pt; margin:0; padding:5px 0 0 10px; text-shadow:0 1px 0 #D5D5D5; white-space:nowrap; } h1 { -x-system-font:none; color:#000000; font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; font-size:30px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold; line-height:normal; margin-bottom:25px; margin-top:1em; } .footer { border-top:1px solid #DDDDDD; clear:both; padding-top:9px; width:100%; font-size:10px; } p { -x-system-font:none; font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; font-size:12px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:normal; line-height:normal; margin-bottom:10px; margin-top:0; } h2 { border-bottom:1px solid #919699; color:#000000; font-size:24px; margin-top:2.5em; padding-bottom:2px; } a:link:hover { color:#093D92; text-decoration:underline; } a:link { color:#093D92; text-decoration:none; } ol { list-style-position:outside; list-style-type:decimal; margin:0 0 0 30px; padding:0 0 12px 6px; } li { margin-top:7px; font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; font-size:12px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:normal; line-height:normal; } li p { margin-top:8px; }mock-1.0.1/html/_static/basic.css0000644000076500001200000002041712046030515017336 0ustar michaeladmin00000000000000/* * basic.css * ~~~~~~~~~ * * Sphinx stylesheet -- basic theme. * * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /* -- main layout ----------------------------------------------------------- */ div.clearer { clear: both; } /* -- relbar ---------------------------------------------------------------- */ div.related { width: 100%; font-size: 90%; } div.related h3 { display: none; } div.related ul { margin: 0; padding: 0 0 0 10px; list-style: none; } div.related li { display: inline; } div.related li.right { float: right; margin-right: 5px; } /* -- sidebar --------------------------------------------------------------- */ div.sphinxsidebarwrapper { padding: 10px 5px 0 10px; } div.sphinxsidebar { float: left; width: 230px; margin-left: -100%; font-size: 90%; } div.sphinxsidebar ul { list-style: none; } div.sphinxsidebar ul ul, div.sphinxsidebar ul.want-points { margin-left: 20px; list-style: square; } div.sphinxsidebar ul ul { margin-top: 0; margin-bottom: 0; } div.sphinxsidebar form { margin-top: 10px; } div.sphinxsidebar input { border: 1px solid #98dbcc; font-family: sans-serif; font-size: 1em; } div.sphinxsidebar #searchbox input[type="text"] { width: 170px; } div.sphinxsidebar #searchbox input[type="submit"] { width: 30px; } img { border: 0; } /* -- search page ----------------------------------------------------------- */ ul.search { margin: 10px 0 0 20px; padding: 0; } ul.search li { padding: 5px 0 5px 20px; background-image: url(file.png); background-repeat: no-repeat; background-position: 0 7px; } ul.search li a { font-weight: bold; } ul.search li div.context { color: #888; margin: 2px 0 0 30px; text-align: left; } ul.keywordmatches li.goodmatch a { font-weight: bold; } /* -- index page ------------------------------------------------------------ */ table.contentstable { width: 90%; } table.contentstable p.biglink { line-height: 150%; } a.biglink { font-size: 1.3em; } span.linkdescr { font-style: italic; padding-top: 5px; font-size: 90%; } /* -- general index --------------------------------------------------------- */ table.indextable { width: 100%; } table.indextable td { text-align: left; vertical-align: top; } table.indextable dl, table.indextable dd { margin-top: 0; margin-bottom: 0; } table.indextable tr.pcap { height: 10px; } table.indextable tr.cap { margin-top: 10px; background-color: #f2f2f2; } img.toggler { margin-right: 3px; margin-top: 3px; cursor: pointer; } div.modindex-jumpbox { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin: 1em 0 1em 0; padding: 0.4em; } div.genindex-jumpbox { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin: 1em 0 1em 0; padding: 0.4em; } /* -- general body styles --------------------------------------------------- */ a.headerlink { visibility: hidden; } h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, h4:hover > a.headerlink, h5:hover > a.headerlink, h6:hover > a.headerlink, dt:hover > a.headerlink { visibility: visible; } div.body p.caption { text-align: inherit; } div.body td { text-align: left; } .field-list ul { padding-left: 1em; } .first { margin-top: 0 !important; } p.rubric { margin-top: 30px; font-weight: bold; } img.align-left, .figure.align-left, object.align-left { clear: left; float: left; margin-right: 1em; } img.align-right, .figure.align-right, object.align-right { clear: right; float: right; margin-left: 1em; } img.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } .align-left { text-align: left; } .align-center { text-align: center; } .align-right { text-align: right; } /* -- sidebars -------------------------------------------------------------- */ div.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; padding: 7px 7px 0 7px; background-color: #ffe; width: 40%; float: right; } p.sidebar-title { font-weight: bold; } /* -- topics ---------------------------------------------------------------- */ div.topic { border: 1px solid #ccc; padding: 7px 7px 0 7px; margin: 10px 0 10px 0; } p.topic-title { font-size: 1.1em; font-weight: bold; margin-top: 10px; } /* -- admonitions ----------------------------------------------------------- */ div.admonition { margin-top: 10px; margin-bottom: 10px; padding: 7px; } div.admonition dt { font-weight: bold; } div.admonition dl { margin-bottom: 0; } p.admonition-title { margin: 0px 10px 5px 0px; font-weight: bold; } div.body p.centered { text-align: center; margin-top: 25px; } /* -- tables ---------------------------------------------------------------- */ table.docutils { border: 0; border-collapse: collapse; } table.docutils td, table.docutils th { padding: 1px 8px 1px 5px; border-top: 0; border-left: 0; border-right: 0; border-bottom: 1px solid #aaa; } table.field-list td, table.field-list th { border: 0 !important; } table.footnote td, table.footnote th { border: 0 !important; } th { text-align: left; padding-right: 5px; } table.citation { border-left: solid 1px gray; margin-left: 1px; } table.citation td { border-bottom: none; } /* -- other body styles ----------------------------------------------------- */ ol.arabic { list-style: decimal; } ol.loweralpha { list-style: lower-alpha; } ol.upperalpha { list-style: upper-alpha; } ol.lowerroman { list-style: lower-roman; } ol.upperroman { list-style: upper-roman; } dl { margin-bottom: 15px; } dd p { margin-top: 0px; } dd ul, dd table { margin-bottom: 10px; } dd { margin-top: 3px; margin-bottom: 10px; margin-left: 30px; } dt:target, .highlighted { background-color: #fbe54e; } dl.glossary dt { font-weight: bold; font-size: 1.1em; } .field-list ul { margin: 0; padding-left: 1em; } .field-list p { margin: 0; } .refcount { color: #060; } .optional { font-size: 1.3em; } .versionmodified { font-style: italic; } .system-message { background-color: #fda; padding: 5px; border: 3px solid red; } .footnote:target { background-color: #ffa; } .line-block { display: block; margin-top: 1em; margin-bottom: 1em; } .line-block .line-block { margin-top: 0; margin-bottom: 0; margin-left: 1.5em; } .guilabel, .menuselection { font-family: sans-serif; } .accelerator { text-decoration: underline; } .classifier { font-style: oblique; } abbr, acronym { border-bottom: dotted 1px; cursor: help; } /* -- code displays --------------------------------------------------------- */ pre { overflow: auto; overflow-y: hidden; /* fixes display issues on Chrome browsers */ } td.linenos pre { padding: 5px 0px; border: 0; background-color: transparent; color: #aaa; } table.highlighttable { margin-left: 0.5em; } table.highlighttable td { padding: 0 0.5em 0 0.5em; } tt.descname { background-color: transparent; font-weight: bold; font-size: 1.2em; } tt.descclassname { background-color: transparent; } tt.xref, a tt { background-color: transparent; font-weight: bold; } h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { background-color: transparent; } .viewcode-link { float: right; } .viewcode-back { float: right; font-family: sans-serif; } div.viewcode-block:target { margin: -1px -10px; padding: 0 10px; } /* -- math display ---------------------------------------------------------- */ img.math { vertical-align: middle; } div.body div.math p { text-align: center; } span.eqno { float: right; } /* -- printout stylesheet --------------------------------------------------- */ @media print { div.document, div.documentwrapper, div.bodywrapper { margin: 0 !important; width: 100%; } div.sphinxsidebar, div.related, div.footer, #top-link { display: none; } }mock-1.0.1/html/_static/breadcrumb_background.png0000644000076500001200000000021011532040043022537 0ustar michaeladmin00000000000000‰PNG  IHDRQ g pHYs  šœ:IDAT=Ì1 CQÂýäììhÑÏàÒ<Ò†Xût¶;Òv¤,‚³Qª/Šig7dä&Þ« »8ï³;ºkIEND®B`‚mock-1.0.1/html/_static/doctools.js0000644000076500001200000001527012046027736017743 0ustar michaeladmin00000000000000/* * doctools.js * ~~~~~~~~~~~ * * Sphinx JavaScript utilities for all documentation. * * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /** * select a different prefix for underscore */ $u = _.noConflict(); /** * make the code below compatible with browsers without * an installed firebug like debugger if (!window.console || !console.firebug) { var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {}; } */ /** * small helper function to urldecode strings */ jQuery.urldecode = function(x) { return decodeURIComponent(x).replace(/\+/g, ' '); } /** * small helper function to urlencode strings */ jQuery.urlencode = encodeURIComponent; /** * This function returns the parsed url parameters of the * current request. Multiple values per key are supported, * it will always return arrays of strings for the value parts. */ jQuery.getQueryParameters = function(s) { if (typeof s == 'undefined') s = document.location.search; var parts = s.substr(s.indexOf('?') + 1).split('&'); var result = {}; for (var i = 0; i < parts.length; i++) { var tmp = parts[i].split('=', 2); var key = jQuery.urldecode(tmp[0]); var value = jQuery.urldecode(tmp[1]); if (key in result) result[key].push(value); else result[key] = [value]; } return result; }; /** * small function to check if an array contains * a given item. */ jQuery.contains = function(arr, item) { for (var i = 0; i < arr.length; i++) { if (arr[i] == item) return true; } return false; }; /** * highlight a given string on a jquery object by wrapping it in * span elements with the given class name. */ jQuery.fn.highlightText = function(text, className) { function highlight(node) { if (node.nodeType == 3) { var val = node.nodeValue; var pos = val.toLowerCase().indexOf(text); if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { var span = document.createElement("span"); span.className = className; span.appendChild(document.createTextNode(val.substr(pos, text.length))); node.parentNode.insertBefore(span, node.parentNode.insertBefore( document.createTextNode(val.substr(pos + text.length)), node.nextSibling)); node.nodeValue = val.substr(0, pos); } } else if (!jQuery(node).is("button, select, textarea")) { jQuery.each(node.childNodes, function() { highlight(this); }); } } return this.each(function() { highlight(this); }); }; /** * Small JavaScript module for the documentation. */ var Documentation = { init : function() { this.fixFirefoxAnchorBug(); this.highlightSearchWords(); this.initIndexTable(); }, /** * i18n support */ TRANSLATIONS : {}, PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, LOCALE : 'unknown', // gettext and ngettext don't access this so that the functions // can safely bound to a different name (_ = Documentation.gettext) gettext : function(string) { var translated = Documentation.TRANSLATIONS[string]; if (typeof translated == 'undefined') return string; return (typeof translated == 'string') ? translated : translated[0]; }, ngettext : function(singular, plural, n) { var translated = Documentation.TRANSLATIONS[singular]; if (typeof translated == 'undefined') return (n == 1) ? singular : plural; return translated[Documentation.PLURALEXPR(n)]; }, addTranslations : function(catalog) { for (var key in catalog.messages) this.TRANSLATIONS[key] = catalog.messages[key]; this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); this.LOCALE = catalog.locale; }, /** * add context elements like header anchor links */ addContextElements : function() { $('div[id] > :header:first').each(function() { $('\u00B6'). attr('href', '#' + this.id). attr('title', _('Permalink to this headline')). appendTo(this); }); $('dt[id]').each(function() { $('\u00B6'). attr('href', '#' + this.id). attr('title', _('Permalink to this definition')). appendTo(this); }); }, /** * workaround a firefox stupidity */ fixFirefoxAnchorBug : function() { if (document.location.hash && $.browser.mozilla) window.setTimeout(function() { document.location.href += ''; }, 10); }, /** * highlight the search words provided in the url in the text */ highlightSearchWords : function() { var params = $.getQueryParameters(); var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; if (terms.length) { var body = $('div.body'); window.setTimeout(function() { $.each(terms, function() { body.highlightText(this.toLowerCase(), 'highlighted'); }); }, 10); $('') .appendTo($('#searchbox')); } }, /** * init the domain index toggle buttons */ initIndexTable : function() { var togglers = $('img.toggler').click(function() { var src = $(this).attr('src'); var idnum = $(this).attr('id').substr(7); $('tr.cg-' + idnum).toggle(); if (src.substr(-9) == 'minus.png') $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); else $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); }).css('display', ''); if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { togglers.click(); } }, /** * helper function to hide the search marks again */ hideSearchWords : function() { $('#searchbox .highlight-link').fadeOut(300); $('span.highlighted').removeClass('highlighted'); }, /** * make the url absolute */ makeURL : function(relativeURL) { return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; }, /** * get the current relative url */ getCurrentURL : function() { var path = document.location.pathname; var parts = path.split(/\//); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { if (this == '..') parts.pop(); }); var url = parts.join('/'); return path.substring(url.lastIndexOf('/') + 1, path.length - 1); } }; // quick alias for translations _ = Documentation.gettext; $(document).ready(function() { Documentation.init(); }); mock-1.0.1/html/_static/documentation.png0000644000076500001200000000063411532040043021115 0ustar michaeladmin00000000000000‰PNG  IHDRvø©cIDATH‰í–±J\A@Ï5* ‹1EHŒ¨)ì!` UŠ$]ÒÙéˆ]ªÈ˜ÒÚV„Xe;+-ü€…¬UšnvçXø„Çòöé¢yÝÓ 3sgνs› z >ž5à 8ˆ_½âû%ºd£À;ࣺÏ€Q £þŽˆ`؉ˆãܹYà0Lã@hGÀPˆvQ…oRJ?½Ômu5¥´—ͯ¢®®¨‘—¾W[×”Þ”u€¡Ì= ŒÜBë®D}™§*¤—}¾GIì?a¨k¬\üß*¾âA+žúî‹=®L\ùSgcQÅgê)Њˆ1à)·˜`‘øØö#¢üåâ‹; ¼>‹]÷4] 4€À0,3…võKöûª>.ËTVߦ”~¨õ»ú¢$~\ý”R:Ìßò›êZ™°GK}Ä×ÔÏêf~ñQ?Ò› >¬ÊUÈ9FrYȦ=¨IEND®B`‚mock-1.0.1/html/_static/file.png0000644000076500001200000000061012046027736017174 0ustar michaeladmin00000000000000‰PNG  IHDRóÿabKGDÿÿÿ ½§“ pHYs  šœtIMEÕ  )¶TIDAT8Ë­‘±JÄ@†¿Ir('[ "&xØÙYZ ‚Xø0‚!i|†_@±Ô÷•t§ÓDÄæÏ] ¹#¹Äxÿjv˜ùç› Y–ÐN‡ažE‘i«(ŠÌÄÉ™yž£µ@D¦£&±ˆ`Û6®ë–P¦Zk’$)5%"ôz½Ê.NñA#Aœba‘`Vsø¾_3ñc°,«™àä2m¼Ýñþjó [kŸìlv¹y|!IÕ´ðþyô;ÀðvÈé "Œß®°—a©?ŸAúðÄ7Œ`ô˜ñÇc^énôk?¸²Bg}»TЙ¹D#ÁÑÞ "R¹D1÷£çyüEŽRê*ŽãÝ6MJ©3þK_U«t8F~ÇIEND®B`‚mock-1.0.1/html/_static/header_sm_mid.png0000644000076500001200000000023711532040043021023 0ustar michaeladmin00000000000000‰PNG  IHDR$Ê·tEXtSoftwareAdobe ImageReadyqÉe<AIDATxÚb ϪeÀ, ÿÿcý÷ï/VÑXDÿãPû«ÚÄ«ýK¼pÙFW_üý;X]F¼Z&l`8‹cH#>þIEND®B`‚mock-1.0.1/html/_static/jquery.js0000644000076500001200000021475612046027736017446 0ustar michaeladmin00000000000000/*! * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Sat Feb 13 22:33:48 2010 -0500 */ (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); (function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= {},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); mock-1.0.1/html/_static/minus.png0000644000076500001200000000030712046027736017413 0ustar michaeladmin00000000000000‰PNG  IHDR &Îàq pHYs  šœtIME× <®8åtEXtCommentöÌ–¿RIDATÓczô(BÅñãÇáÒpö¿ÿ¨èˆip»‘¹P÷îÝÃc· ¸ |¶IEND®B`‚mock-1.0.1/html/_static/pygments.css0000644000076500001200000000753412046030515020130 0ustar michaeladmin00000000000000.highlight .hll { background-color: #ffffcc } .highlight { background: #f0f0f0; } .highlight .c { color: #60a0b0; font-style: italic } /* Comment */ .highlight .err { border: 1px solid #FF0000 } /* Error */ .highlight .k { color: #007020; font-weight: bold } /* Keyword */ .highlight .o { color: #666666 } /* Operator */ .highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */ .highlight .cp { color: #007020 } /* Comment.Preproc */ .highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */ .highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #A00000 } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #FF0000 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #00A000 } /* Generic.Inserted */ .highlight .go { color: #808080 } /* Generic.Output */ .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .highlight .gt { color: #0040D0 } /* Generic.Traceback */ .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #007020 } /* Keyword.Pseudo */ .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #902000 } /* Keyword.Type */ .highlight .m { color: #40a070 } /* Literal.Number */ .highlight .s { color: #4070a0 } /* Literal.String */ .highlight .na { color: #4070a0 } /* Name.Attribute */ .highlight .nb { color: #007020 } /* Name.Builtin */ .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ .highlight .no { color: #60add5 } /* Name.Constant */ .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ .highlight .ne { color: #007020 } /* Name.Exception */ .highlight .nf { color: #06287e } /* Name.Function */ .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #bb60d5 } /* Name.Variable */ .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mf { color: #40a070 } /* Literal.Number.Float */ .highlight .mh { color: #40a070 } /* Literal.Number.Hex */ .highlight .mi { color: #40a070 } /* Literal.Number.Integer */ .highlight .mo { color: #40a070 } /* Literal.Number.Oct */ .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ .highlight .sc { color: #4070a0 } /* Literal.String.Char */ .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ .highlight .sx { color: #c65d09 } /* Literal.String.Other */ .highlight .sr { color: #235388 } /* Literal.String.Regex */ .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ .highlight .ss { color: #517918 } /* Literal.String.Symbol */ .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ .highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */mock-1.0.1/html/_static/scrn1.png0000644000076500001200000032301611532040043017274 0ustar michaeladmin00000000000000‰PNG  IHDR¬0 ŠqŸžiCCPICC ProfilexíZuTo·~gNr8twwºëД´tw(”4‚X¤ X  ¨€ŠÒˆ ˆ6* ‚Š‚‚RÂôç÷­»îúþº÷¿ë¬53{ïÙûeÞ™y÷ÙÏ@ì¤gDD  ‹‰²1"ó::9óâž €8 žÞѺÖÖæˆÉؾOhW5.µëë?ý'1]È1`ôÿ}v±×o·‹ÄDÄ 6»Ø;ÀÑC5–Œ²³ÑCð=ðDÿ_˜âÉ.öú…éÞíbOÏ(Ø–{^OO³ÓþÆ^»˜´‹÷{û#þÙ‘1`éÃ|ëåãí €p=bããí €˜ŽèÅvwDr­²ÁÝ{‡œ‘m×·Ê0â#üß²0}šÚßÇþ-–€5€‹bÿ–}³»÷b~í'/÷ËD$€™ÞÙù& î?Kvv6Oïìü¬õ€îïØ¨ý¿lz÷„@à@H9  Ô0¦À Ø'à¼AQàHiàÈÅà(§@=¸š@+h  ‚0&Á3ðÌ‚` ¬‚M‚p¢‡X!nH’€d!H 2€Ì È ò€ü P(J‚2 <èTÕBç¡ËPÔ AcÐè5´-C0 SÂŒ0',KÃʰl Û®°ÇÃp!|®…ákp< OÀ¯à𠼃" ˜P¼( ”2ŠŒ²@9¡|Q¨$Tê(ªuu5€z„šF}D­¡Ñh:47Z­Š6DÛ¡=Ñáè$tú$ú,ú*ºýý ý½…¡Ä°cD1Ê#ŒÆƒÉÄ”bê0W0}˜qÌ[Ì7, ˈÄ*b °Xl6[ŽmÄÞÂŽb_c¿âP8&œNgŽsÇEà2pÇqçq7q£¸7¸<Ï—Á“ñø | þþ,þ~ÿÿƒ‚HÁG¡DaFáAK‘GQCqb„â5Åw‘ÀOP%X| I„#„ „nÂcÂgJ %¥¥¥7e"e)e#eåsÊoD"Q¨It †³‰µÄÄqâ"–Š—JÊŽ*Œ*‡ê4U'Õcªej"µ5™Ú:Žº”º™z˜zަá¦Q£q ‰¢)¢i¤¢yG ÑrÓªÓ:Òî§-¥m¡¥ýDG ¥3¤ó¡Ë «¥ë¦{E·MÏE¯AïBŸ@_Nþ)ý:ƒ*ƒCC9ÃM†ç [Œ\ŒZŒûÓO3ö3Î2á˜Ä˜Ì˜B™Š™Z™&™~0³3k2{0g0ŸcfþÌBÏ¢ÈâÄ’Ìršeå+ ««k2këë"› ›;[&[ÛÛwv.v=ö öbövöi,‡‡GGÇÇ7NN=ÎΣœ·8縨¹”¹<¸ò¸®p½äÆr“¸¹3¹›¸Ÿð x¤xy2xšxžò¢yI¼.¼Ù¼Wx§ù|Ê|Þ|‡ù:ùø™øÉüüUüÃükB¶iÍ/‰‚j‚‚'W……ì„2„®ÍÓ “…£„ë„ÇEP" "¾"ÇE‰Š‹ºˆŠÞ]ã³Ë».öIœGÜFScQ³S;¢ö@JÝL=WýŽVC_#C£WÒÔÑLÕìÒÜÖÒÒJѺ­µ­­­ªÝ­ttuÒuúu1ºFº9ºÃd"Ù’\B×cÖsԫЛÖçÓ÷Õ?¯ÿÉ€dcÐa°e¨c˜e8lDmdkTf4m,`hÜl¼j¢n’frÇ”ÚÔÞ´ÂtÆLÜ,ҬØ››?±àµ°h±Ø°$[XNZq[ù[µXmZX¶~ºGpOØžë6h+›r›Y[YÛ$Û!;F;»Kvëö†öGì_9H:$8ÜÙ˸×kïå½ÛŽæŽåŽ N*N‡œ&cœû\\¼]Z]Q®¶®u®+núnÇܿܕÝsÝŸí“Ü—²õß#ÆãŽ'›gˆg—½—¯×uo¢·‡÷U¼«O‹/Æ×Ù·Ùíçä×ìöwö¿€ p h ¤ÜØDäÔÌÜÂ2*š:&–ö:\-¼4|1Â(¢6b3Ò!òre”_TO4gt\ôxŒLL~ÌûX½ØšØ­ýNûÛ0ˆ80'—÷>Þ ¾.NðHèJäNLN|‘¤‘T‘´™ì’|3…#%)åEªfjuêÎAƒ½iiYiïÓMÒ3¨3"2Æ3•2Ë2·²<²ú‰Ê?ô%Û.»#‡+'-g.×<·%9/)o&ß8¿©€± ±`¦Ð¸°¹ˆ¥(¥hö°ÅákÅ\ÅYÅŸKJºŽˆ)9²QêSzÿ¨òÑÚc”Çb½>nzüÚ Þù'~œô:9Z¦Vv¶œ¾<¥ücÅÞŠþJÙÊSUĪøª÷ÕöÕ}§dOÕÔÐÔ$×|ªu©9­vº¡Ž½.¯n£>¨þùó3g¥Ïž:G{.ýÜÊyßóO.˜^èli8ÝÈÔ˜Ó¸y1üâÛK—Fš´›®4‹6W]¦»œ}y«%²å}«[ëø“+]W•®^º&x­¢¾-·jo_îìxsÝùú£f7úojÝlï$u6ܼU}›íviuWn7º;µ{£gÏrohïBŸ_ßLÿ¾þNSƒ¶ƒïXÞ¹7d:t÷®ÑÝÁaƒáþ½‘Þ{ä{=÷uï÷Œ’G{è=èÓ|hôpè‘é£{ã–ãc¶S“Ž“Ï§Ü§fû>^xúdùiìÓg©ÏQÏs^P¿(}Éö²zZpºá•ì«ö×Z¯Þ˜¿Ÿqž™yôö뻄Yx6Ža®ò½Ðûæy•ùÞó…©>|Œý¸ó)o‘y±ö³äçŽ/ú_Æ–\—–c¿Â_ãüÖ°¢¼2°j»úæ{ø÷íkk ëªëw7œ6æ7ã¶ð[e?Å~ÞØ6Û~±ö7ø› üÍþæs¿¹Àß\ào.ð·.ð·.ð·.ð·.ð·.ð·.ð·.ðÿ·.áåù+@!GØÏ€¯ç r€a JÔÿVÿ›GùmBbìKh@‹ðf t@0d µÀ.r]ô•8¥„œ¤»T¾t»Ìœ,ƒœª¼B‘b‹Ò¤ò¦*›š¢º‰†«f´V¶öi›º“ä%} aC#/ã“ Ó6³‡æ‹–VÖZ{lmBmsìºð{M‹œº0¸îq+rñÀxêz%z·ù|õ“õ h\ VI½N!©eí³?6ÍkqÃñoÖ“h“ESôRÝƧLoϘÌ\ÎÚ>ô-ûEÎ@îå¼êü¼‚øBÿ"‡ÃzÅR%L%ÛGfKïm8–sÜ÷„îI±2‰r• ƒJ«*»jûS¶5æµ:§Iuœõ˜úgFÎ6žË=ï}A«·‘ý"é’A“ssðåø–ŒÖ¼+‡¯_+n+jÏéH¿žx#æfxgÀ-ÏÛN]–Ýz=J½¢}ìý„þƒÏï ݼÛ8\6’/ñ~ب÷ó1¡±ïï>ª?8á1Iž}L÷xóÉÜÓ±g7ž×¿(|3íøJû5éè ï[úwèwK³“síïKæ}H kÚ>F~ùôt1û3ù ×oK–¯|=ñ-iÅoÕá»ù“5ëu¯ÄÍS[£ÛðŽØÎ2ÿXÀ ôviaˆr¡58PÕh `p³øU+¥.1…j€†ŠÖ®ž~…Qƒé óm–56QvŽ}œ\Îܶ<6¼¶|Îü~Ñ‚iBG…DD_‰­I0IÊIYKÉdªdÛå†å_+¬*¡•©Uª(ÕMµõ%šï´^i?Õ™Ô'éÝ×1240DªÑCfCæ#–_­y÷˜ÙÄØVÛ ÙÞËè¨æäîœîrÖuÄmi«‡¶g€× ï>äYô·pt ò ö  K?Qy*ª)úvÌXìÜþŸqLñr Ö‰aIùÉ)'Só¦¤E¥‡dxgºfÙ²ÌÖÏQÊÉcÍGç/Lv•Þ_ìTârÄ£Ô÷hÀ±€ãÞ'\NZ—‘ËI•èÊU÷ª›NÕÕšœ–¨©W;c~Öý\èù„  ¹…‹/7•4^ÎoÉiͺ’y5ãZZ[F{ò<¤ÝH½™ØyàVÌ툮€^ÿ>¿þ€ Áð;†î& ÇÄ!OCêh惼±#+oš¸6ykjàñÈ“‡O'ž=~¾ø=ÍýŠôZÿÍŒûÛ wQ³qs‰ïSæÓ2?ä~,øT²XþùÒ—‘¥_IßÂVÚ¾ƒ†kYë×7^l~ÜzƒÔ!ãv8v Í?ÐI`ƒ°‹Cä À²pJ5†ÞÃ|ÄvâŽà#)\æ”d¢2•,µ - í6Ý<ýC=c$“Óæ–V1ÖÏlíì9L9Ù9¸nrñxñªðÑðÍò_(ô’F OˆÔ‰FŠiˆCâC’VRLRSÒÇeH ¤‡²…r†r;òm !мŠJÙÊêÊ‹*§TmÔ0jƒêE{5ù4?i]×>¤c§+¨»JÒ«Ò1036‚Þ÷šÔ™fšš›[ˆ[b-g¬º¬«ö$Û¸ÚjØqÙûww÷^v¬pÊvŽqñsur3w×Þ'åAï±âùīۻѧÌ7×/Ñ?2À/Ð9È"X/D9T<Œ#œ"|5âMäxÔdôtÌlìÂþùoâ&ãû.%IŠJ¶LLù‘z÷`YšOºlúNƃ̺¬‡,²³7sÆs/æåäûJÑmž-/é;ÒVzöhú1‹ãlÇߟh?™_æSN®ª$V®U-TOŸšªyT;zz¬n¢þá™þ³WÏ=_¡¾¡¡±õb雷¦÷Í[-4­|W䯒¯Y´Ùµïë8z}ê&g§Û­S·_v³ôìéÍé»ÙÿqýŽÁPä݊ᾑO÷EGoŒ¹=ü:ž>É9uûIð3¹Ór¯¾¥šÝ\HXlüº¾!½;ÿ¿ùôÝ5«ÀI_œ²°e ÿ§€…€5vªX°D€\Eÿµ~°"̵)Øb@¨D8é^0æÀ:D‰°Îr!ä …CYP%tºÍÃh˜&ÃÞp.Ü¿BÑ tQ1¨ó¨l„NE·£—0âL-fˉuÅVa_ápA¸Ü:Þ_ŠC!K‘Eñœ H(!,RZP6"ìjñ•2Õ)j,u8õ3#šk´Â´'é¨èÒé6ècè¿0„3|fŒ`\`rae6`îDÍ&V Ö6 ¶‹ì²ìíZw8÷p¾ä àZåÎäaà©EøÇ>¾·ü±Ìƒ‚ÉBŠBKÈÍOTPôØYñ )‰¯’7¥2¤ÍeXð²l²œ…<ü…9Å%¥-äÛÆ¤&¬®¬aªé¡•¤]­3 ûQOßÁà¸á3c!{So³ób‹&ËGV;{H6!¶—í~:ìÙÛìÄæœí²å–ä¾áìYí5éCåkêWè?(”ü8T5¬&‚2ò`ÔjLDìâ ¸O Q‰›É‡Sùv¥;g‚¬³Ù–9[y— ö1~X’]jxtçø“õå­•ÝÕ·jnž¾\_w¶ø|JCðE·&ÛËæ­æWíÚ:ünØtªßVíVî5î,š±¸ÿ`,n\yŠã)óóÊ—ß^[Íœ÷ó½õÂñ£‹ëK,_¹Wؾ~|XïÚ,þéôëûA ø€"0® d€ t!OÀ؆‘ErAz CHOÁ{‹Áp \߃·Qò¨Ô)Ôš™ûtô-ôÂîÇb®a~`U±ÉØ^g‹;…û€WÃà§)ä) (æ æ„VJÊ,Ê%¢;ñ•.UµõiNš´L´Çè˜éÊþ»ŽA’¡Q—q˜É©—™ÌÜÏbÄ2ÂjÃú’-€m•=‹ƒ™ã§&çW7Ì]É£Äó€7˜Ïwá—çj½„„æ…/ŠDŠªˆAbÃâG%öIŠK®IõKËx¤I›²Ãròa 抚JšÊZ*ºª:j†êf¶šîZáÚÙ:uº=äOúl{ M™0›Š™›ûYäY^µšÛÃmãf[o÷ÍÁxï'*ç8—7÷—Öž‡¼z¼·|ÕýÒüG9ƒ¢ƒGC¥ÃކoF†D½ˆÙ{ç€V\[‚BâÅdÉ”¦ƒŠi·2,3_ŠÎ¡È­Ë×(x\]L_r©ÔòèûãéH¾ò¸"¯J£z¡¦ü´qÝÖ™†s®h/¦5i7o·ô_)¸æÚ.Ý1sãd§ÑmB×POIŸÏ€ê†¡ïïöŒu<º8Q?Uû¤ìYÁ‹àiÍW?ß\zë:‹š«'/Ì<¾hý…cõvuÏÏ›Ä_óÏ HÈûï ’‘¹o÷Á„…!}ÈÊ.A“Ð, »Á¥ðC¤Äuõ­†ÎE?AÞódÌ8V›…ÁéáÎá©ññø÷NcKÂ(¥=åKbq‡ê$µõšƒ´2´ïèªè]xæ¯0…1K0`id cS`Ûdïç(âtäâZæîâ)äuå“á‡ø \<)”"ì'b)ª&&*Î"“X—\”š–~(3Hêm”«‘/S(S¼ tKùÊ´êgµŸDM6-qm-ÝPrž^£þ˜Á¶‘´±I¦i¹ÙUóq‹u+Qk¯=§m–íLì/íes<áÌårÞMÏý…G¼µ÷Y_ ¿©€È êà ¡ä°'Á‘;ÑűÜû/Æ)Ç&¦&û§¥‰eÀ™‡*sÜ,ãnáÃÅwŽDe8Ör¹Œ³|¾²¥: †»ö~]âž³½ç}pÍ—œšq—o´F_UhƒÛ{®+Þhíºu¾K¨û|¯l_Ï€ÕàÌPò0çHïýÀ,cÃ’&ä'—_zþlèåK“éÂW/ßfÒÞÞŸežs}_=ÿüÅG©OÆ‹6Ÿ¿X,i,ó,o}½÷­lÅz·ÚôÝòûçIk¸µÒu†õÜ °qÉT7Ol®lÙlUoÍþ”úó³s½í¸Ý»#±slwþ÷`í®€ Åk®‡4RýŸn¡!±HŸ×¯9ÃB,w{»˜‘}ÞÇSß 9s"ûvDȯ>8Äb÷ ³·Ed»X2ÌËÒê¬åehƒ`äZÈ:"†¼‹‘µò‹ˆ±¶ûGž’ g‰`""?êmðÇOM§)Òƒ¨ykT¬=‚ܽßÖÁ´~—`·÷›_ýä0ìhhòÛ¦Œ1Ùňüã7Û VB~……_‹t|ù‚0¤'Ìè!¹ùï£ðžˆf?¢‹ÁÈ…ô†™!_Ýd¼ÿØéý‰á¯ëü‘ëþ»G^ä­ G¢ý‰ù;/óÏ@àƒà?rO$Æ®nwtÑûÓÿóÅ®¿_£!5’H[Æ„FË¡Ñd´&Z ­ xÑÌhv …V@« uÑÚhuD§ Á;ijÿŸ1îúmõÛ2<^Í!Ñîþï^´Àá—uà¿þþ#£ŸÚ?ýÒ?ù«'¹Ó‹ÌSåÁ]Ô'´°{úo[ŒoÜn¯ Ð ˆ ôˆáÕEº&}%yM¼¥%yåH$Uð_5ûÛ^xÙ pHYs  šœ IDATxì\S×ÛÇOHB€°e(¢(( ¨Tp+Ú:êÀ¿‹VqÕÙÖ]k«ÖRÛ:jm몕ªµîâjqŠŠ TPP@¡({ 2n’÷¹÷&!€à«u=çÓ&çžñœç|OÔ_žœ{.'ðã¯&$€@H $ðÖx·£O¡¿5óʼn"$€@H šˆ`EýI˜Y[𠆔ŒzRV^RZ^ÿ¾Ø $€@H ¼"xÊzD‚y\î;Þ=ü:´láhaaÆçñä …HT‘•[p;>)2úΣ¬\v>ö¶mZµpqr´mdŠ6åŒÌœø¤Ô¤Ô‡ ܯ t $€@HàÍ#À6i^ݳòlÓêÃaÚ´r®­™D"½w÷^J×NíÛº¹@œXoˤÔŸ<sGo-"$€@H ÿ†À ®œ€ sêÌ·C»…ŸNâñ¸u´iPUÈÎ'ï4¨ 6FH $€@Ï‘ÀàîížrcœµÅsTÀàº5ÞŠ÷—M!$€@H <žR^×éŠ:kŸa<0X÷ˆÏ`» $€@H xÊéJeƒ¬=½±R©ÄÛ㞎 [ $€@H ¼HOÙAÈsVÁŒ®+öü"'ûÙ¶oÙÊ$ë~zEÝÃYvéÕÚ‚H3nÄ$<¥¥ÆŽå¼Õ‹:Rq ïQÆ¡©Á @H $€@C<åˆ4ÎóÁ }‡²5Y¶u¹ŸE•ã%)É}xéŸ!²ÙÒ€…k>îd½cÉ’cª’ªÖ¯FιkÀ”\,¼”CßÎüëA­~µzÿÏoG6æ±õ¢ó¿®øA=ÍZ»ÐÇÆÖ6ÄÑF!Ï©³Ý›TÙbðœÍ¼ãö-^xøí™ô›´€8$€@¯(We;„9ŸT–û0_L„Bs+›¦nÿût¹«õ7 >€*C‡~å“Wv7…ÿˆŸæà#“”œÚýôú•QÀi/59Ì×ÿÓ/ߟ½ë‘ºo­ïÌnj®\Z»éZ»¾ì Ÿ‘S>êd|øÛ çDOq¥ZK._ø¼WwÝŸ2¬FH $€^IO‰?÷í`P_$XAÑt*Îþ²î\%gs š Ÿ;Ã×ÞÐëÃOÿ섈œÙ²"Å‚Wœ­¯û+öJè¶2NJqËq †yÀ$kóÓeÔàVŽÌž Jwþ¯yϱ½4¯MÞ±ñc¿âËÛ§°]’Íû%…~¿pjÒˇ&L{½Ó¤ktw"Džp6ü^ýÐés‡oNéãÔÈÃÇYq6•é©óâÔwCpG#:šsç¶’9¯2¼L&,\4º›+=KB R"Ö|½ù†:ÎÚîÝ ŸïíhAw$„Š Y´ä„xáºU½ŒãfOÛÀ ÔháOß÷jR°iÎÒãù¤Éû³6Oö¸z„ôÞÃQ}Ò/¬›²[°ù§)­,€—$áìöYP„t=ëËÀ. F(ß=‹eÛsëºIäÆþ¿K:ÎÖúPORÿ\¾r_RÅð%?Nô =µnóÿHùî…óö=Ô¿‚5[žo¸d²×­mÁߜȢ§Rû2Õ½ôt_LH $€P€H°Z€ª‹^ì;sg\!T§PÈ8@e+%é)‘‡/ š×שY7¥â®SÓ&F<G;K¥"Ÿ8¹ùµiZ’—œYîèùŽ‹c—EÁ ÿ > =ͬ͌,šŽŸîJ* ’Óä®.öG}wg4Ôy~ðÕª±í Þœp5²ÄÒ­«‡#´oÞÔ†&`ÚkÇÖÍ@J&_~LÚwöõzoò¡F†Ãƒk»š›*ãõtîý~÷Ÿ.\¢+LÆ ïfÊ£òî?#ÒÊJ)!ª -} †v_uÞÕÍä`Ù£ø|CaÅ£[#ÚY9*)êFªwðjýdð*7ájR¹e{ßöæt; ç§¿ü:¢¥@^ö0âjªeëN^-{®úÃþ‹QÁðe åð/×Mjm Òbr(G§ær%G©0jÖDhD,͘î„5s°02á7*”¹ÄLhiʳè1vø––låîæÜ{Î¹Þ ×‹““+Z¸5õxoÌ]Ø—G_5¶=©È¼‘Ú´S7÷&oÈK›ùW*ÚØ &½ÇÍ™iE¼ÆNö®ã¦½¿wÞþòÜœ‚ŠÆ6&Ü’ÌÇ…¤¼\¢P6Ó¿‚5[šš€cB{Kã§.SK¯â‰oH $€Pà=å$àç}FH}#ªõ"Ä8åj×Hej‘ .äè"çС»?>ýÍ¢[Ò²Òâ ¹©SÙÚàþFfæj³ôÖá²´ˆŸ~ Ë©TŽYôcϦ–­šÉO?°3°ôêoßìˆ.‘ð…WÏZ0ÈŒBÇ!s›RwðûsyäÄÉ{‹W·ïð¡Ííƒ$9/&éÖ|d ÃŽH›a½›rå¹—÷ĉ5n«5°Þi‚kRfª†\JÕE.¦'ÆmÔ¦™<üäªR¿i#À«Ü«;WìºZLñmÿn?ûûÉN\[ƒ>ÜR@*Ò6.[_!0?9rÁ²þNî]¢öON+à̈m?î.+M…Æâ¼l…¼)}è3—S ÝéA”ô¸€WÉ2§¹ÉË’ÿüiKt®¤ç¬åx˜IscÖÿ²7¥L>ø³åƒ]xÖ&ÐÒ†1^öÏŠ5ÿdV˜ž+]½|°»OÅždPçŒAyÂñß·¹'1ê½ò‡ÿ™9´v‘˯ÜÖÜå‡Ûr/üöë¿b*7[®0п‚5[ÚÚ1ø¿ËTÛÒÓÓÄ„@H mOÙ¡Ýô¹äk9"M-A©õ0 GIè­Â°¥ª}”œˆ‹sü¦LëãíÒÄ”Ç3¤Ã£p#+ê yÅùm».Þ)„ëŒ2œrå\¹BØÎv:ȳ/žMI¤÷ÖCÜ–Nб‘9ì)Ç_ø7&5JgŸ‰H9Êg-Ôñ‡(J÷ûßgÝ<ߦؽvtPoêÆ>–QÁM[Óñ“.¨–ÌŽ¹Œh,³=$b©¦DÕÅÉÞrù÷ïÞJ§½zðȸTBã€ÝÆ®m]aèŠGÑ'ïfгÉ-8výˆ`§N^аBz¦¤àì_á1i•S'Õ˜/+‚Ù• s6Ÿzvç?×SŸ(ˆ­'Iú¥gn§‰ éãÂr€Ï,Fb6ìû_†ÑeL²wóTÈcåôJIþ»v_Ľ iB16 àkVInŽÔ€ž7Uñ8!í£k¶´e›3ëþ´eªeéµ>Q*cø†@H ¼õþëã@ë»cL­S”rõvzeû;ÃkÁ£ èª4¸­òÞã¾ß8ΓҤ蛑%Výúziî·c›UçQŒI9³‹tžÒĘ>B.+(W™Iض´AFòÉ+ sÕ{ÊXYË8©Ú5Ú!B²/…ÅOëæeï3£ƒ·æ¤"yÿ±Tíƒt;ýÓ„ ‘¥ 'õ©-;Ú˜€xÌ»•¥)¡ @bƒßÅ¥jû¥*Ó 9˸¥ŠÔ!èb1£é ¸JbÌL‡+Í/WÁÚcgBÏ—±£Þ>Ìxº͑Q%T• 7++ûêžÐ‘5.¥·”fG6áñ¨‡9`“™8%+M„XzUÒ ÇEÆV+¨êªn©þ)âéËÄ.§ž¥g½¯r sH $€ O9"­*²ùœX)!Ž©ìU™eŒ\š_UÙ瓃›B¸³à쨪R¦{Ÿ®n O¯ùöpRq±A¿> ‚)ÝsêPcæÝά V&ÎÃÚDÏ#f~s‡6̬ÒÊÏÄÛ¿«â {ïWûn. L+¤5-¿vù¡×@§1+gA÷ÌÇ"‹dÚ*+OJG¯)i‘–ÏÄÑÕɆTÞ¦Ã̹ñ¹»ÛwÚI±: ZZ ïî“ɾ3€k­¤¤½#]ìŠLÈXtØœ ³ÉÈ““Ö&MÝŠÇL—^žN𞟖¢x’YFlͬú|èµcÓm¦’}ðÀžÀÞ[¡¸ ÖÞá Ö é̱8ÝKhùä6c\™±cg{ Ç@Y™ ³eÖ4¸jâì’‚}mª‹§¯ º¥êv]×g™t]Ö3_|AH $€ˆ¤:”¨Ÿ†FÊè¯nx©þ³ÃLPѬ×Â/*dDfâêåíl[¤1ÿû~™VD“ŽZ}¾3hX¡3ñèZNnßv ‹ñ‰ú¼Hüª8+s —’ÿD¤µàÒcÞ¶Ó“ÊM-é 2‚Á“.|à9ľ÷¼Mâ&©¤ËˆQ°áVúðêá´êÑY*b÷ù‚m˜Þg÷]©Pì0xâ`¡¡cc¨±÷÷…­¨<áôÆc‰¤É˜m!A¦D¼wÚð)ò³{}Ø}rÓ~Ÿ¯ÌYw¦ ÕÜO:Á4/> ±CfRxDâ„6>͇.þÝêb¶‰Û»>-èb91RÈ ®žÔÓ׿߾=ݨSÀHú®¹ÜðC7•”ìàùäöCÝZÞípúL²È«‹¯ìÌê/%?,{4µñÓ|çJç÷:·`˜ËYVêufð2£3/º—€‘zpðlBûáï~¹ÎöÔ‰³ E-<|½šd5ï×Ǫ˜­º‹±’¶Ï¥½ãŒ~5¸hþ“37"]¨c«µT;F9WŸeÒ³ôÕ¾[TÍsH $€ÀÛKà){‚9µyNˆèmjÕ¨eRÁÜFœ|èóØ$ÉM»~ú¯ƒço%æjý@ÏÄåGO\öÿ´o£6ÝÇ´!ÅpF„Ek7›ö_­ž;ì;Z$"iö×Â%—Ùö*¿°ó§Fâ Ã{µ2ä Š^=u×òÃA…ÁŸ¬ë¡+·Î×ß{@73|ArÄëweTVí `݂ײ̓FŒô0+K¸xø~¹&~Û¡ß íèÃÅ Y»wêN$-ò×¹ ‚¾¿È `k²‚&Zþ›ã×Óú÷¿°']BíÖs9;t“RN…ìô\2¾«SÛýÚBÔ9&BÔª§—‚»ðd% ¿~ÿïó Ž­ºOŸßšÃ1G·ÿòw*íÏ•}k· fŽëïáÜyÐôδ­Ø« …èøÙ¨^»Ú{ûõŸp½´‰‹1¬XKÀÒS–VÒñl±TuIè%Pa¼ºá7ÁÔ ½Œö@'EÑf°ÏX!¥{Rùe UHé}RÚ[P¡'Ž\øŸÇ›VþÓ[ù›ß:WÇ VkyŽùRJQ=–‰WßÒÓ>bBH $€€6Žowµ¯«å?š0vúä‰Õ ÿ?—;÷†þºyk ‚v<íà·ª$=)LMÊ(`ô#Oþõð4O³;»fMÙrkÑį‹ss{iqnæã¬ ÃfíÝmDÃ.'Úzx»[‘”ë±LǦô%'%úvÜÞ{7oíhÁåp‰¸ð׎mgž¸kæÄ-IPŵhüNÇæŽMÀ iyö£ŒìØ„LíÛÊèþêÔ´µ·{#¾´ðÁå{ê2ÒÔ£½»]UÉŸd\¼›Gø6]}[YJt,ë1kÜÙ³—‡=4¥%ݺ›ŠQO²qníåîÔÜJHDÅñ‰É2Ë&ÖÅ×¢RÇ„Þ-œš[ÓÜÊ3fß¿[>Ødíèêé³1•B*,LO½—#1lÔ̯uËæÍAùæ¦&?’˜ÚZ ¨¤ë±™2bܸUW‹¢ô;·³hOš¸{¶±0½à’™¯F‡ž-š:9Øó‰¬¸(»¬´ðÚÍôJ¾MwßœâŒK °ë¢ñ̬¥Å×n0ÞšØunßÊÕÁà^9sþ‘ Ö”ê¶ÌµhÙ¥¥eaZ\l6½é¹ŽebÖºÖ¥§]„@H †ÀÔñœwºù×AcÊÄqÓ§Lª£AC«vîùkÃo¿×¿WóÀe›G5ºq«Ô§Og{AÙÎ £7¤²zÑÀÌÌD.©¨ Ïã[š ¤ì±µXoøã¡YîÉ7o%>(qðéÑÉÙöü6jâÙUÔDh ûfå²Ê æ6³Z,=—b¾µµ1’=)-c"§µ5X @mJJÄê/ZMyFÆ´Ç„*Õ¬å› ypš\,©š!á›™ ˆ¬¢LüÿÜ%``&4áy¥¸RR·ÿUÞB‘Seª‰Ô±‚ÕZV™`sÿá2U¯‘@H 7€Àô‰cžò° Ìû\l‡€ýõ7Y)“›7öx~¿'Òäð½‡Ò*Õûƒ¥OJÕv$ÅO´džº´Ú{eyq™ÜÔínïÐ5ð0{·ͬÔÞð!*SŸ™P­óó¿”Â9bõIâÊbqm!iP³zįڪ¤´¬æ’Òz°R[¨ã]QZ¦á_G3í*èBï²P§:V°ZKuõû¸Lê!ñ $€x³èü|_sjÕD0ýÓzQ1%“ …BKK ö|€šýž[IÑù?—æŸ613#e%YïeÖ7è¨Ç¢Ë;ƒŸœ †††Ò²¢’âûñ÷™_îõ4Æ"$€@H 7˜ÀÓD°zê)©i‡‹ºq3?¿€¢(ccc‡Æ>:ôõïÙ®­‡º),*ºr52înB~~>Hd{;;6î;´wl ç€=K¢ „_|À3ä©L;Šø ¶¨âŒˆˆ Âåò¸p‹š¬Þ?â?ÃPØ $€@Hà•&ðÌãÑ vìÞ÷ÇŸ»Dê»®à°Z©´äÉ“„Ĥ½¡ü:ùŒûO‡öGŽØòǎܼ|ÿML…ÂîݺŒý`t›ÖnÜg SÒš^uiÀ…\NÁ è€M‘@H $€Þ4Ÿ.½ê˜ÓÄqcÊËEÿ«£ Tq¹\ˆøÞ¹›PG3##£ A†Ší;÷ÔÑ «@H $€À %0㣠§ˆ`Ø> Aßçè½÷¹|޾¡)$€@H ·ˆà§ÜÙö|00Eü6|°pŽH $€xÅ t $€@HàYàvˆg¡†}@H $€^kÿ¯íÒòœìì'\ëfŽL^:i^ô?Çnð» êçmøÒ½yaT>Î+’Z7iò 0a³DÃH $€x±êÁç—õÛxMÛמ#GõojJ¬öøäÂ϶¤I[¶ÑnôRò ÑÃ}í$-mû½ëÉ{)ü'ƒæœ_<ÿ÷2ñ÷Cxü'â H $€x Ô½‚caDÏÙwôÔÍùvî]zjÉŸ?··ã6wA°ÍCKWûWሠ€öÕÚˆ§P¾§¾eünIhŽÏÚõ³šÖuR³üöÞËw§~²Í¿ÝΡ˜E²ìÜ›¾ Ìià˜@H $ð¨ûÆ8•˜ì?jê`gC»àã‹ý?:Fb–ŒØ3£—%ÚØóy\æî:yAjlRrzN~‘ŒoÚªcÏöî´º“—gÜŒN&–nܸ×NœÈ:û ðs·gY•¦^¿x%VÄ·nߥÉM/{t÷µbD¡´(ùÆåkJ¤|¾½{—žíZXêÃ+M¹rêfj®ÐÁÛ«Y9Û€RßêWtåZL‚HF„¶¾=:Û3Ñkh#}’qëê•ôür¾Ð´q ¿Î>.äIÚÍÛiÄÔ¥ƒ‹!‘gD_~TN<»8[–>ˆ¹“RÔ¨í;6E7ÿ½šÎ·vîòþ»$ãâ‰óÙ"ÒªÛ Wv\qvÂå«7 DR¡­w¯~¾æô,¤ÑוóZúxUÄž‰J(²póëÙËKC\¹z-•Ô«§ÝÝZ¿Ó®…™^z¥".ì>†R# sÜ=}ܸ\•Ï@©º£Q^r/2">5WF ›´íâçãÆ|m!¬Û­ßiN%Ÿˆ•ñ»¾ß·¹Å¼O„]|EH $€@½pö9_{CñÝ_®8Oæ†õmb Í &ÂØŸ†,ÜOÈÀ•¡ "|ñk´Ë´ï»‘ÊÄ1Ÿ@›–­HÊ}Úäû_ýäk/}6qÖZ¸lNH]L§¹!§}›ÄìœýÍv¶Dýê³zÿG#RšphÆ—Õ…ô{÷9!ŸôuÓ.‰y}kÿµGtË|ïúê=.‘Æîúò‡·´ê\æ†üƒ–&šñ¹¶åO·ÉÍ›8s-qûÇ/FDñÍÀÍ1dòº£}M³Î,X°±Ú“¥;x[ *Ó¿ ý©¥1)ŽûëÓ¯Bª†óœ¹yùs"¾öÍÀ 1UÅó³mn_»ˆùC6§¨Ê]¦mû¾¯D/½¬3Ÿ/ØxSÝÞG†žþìó_cœ§ý¶|pkR™¶-pò9u5ýî9ó×å#¬Ñã¶óôÍë>0×nŒy$€@H ¼•D¹)uo‡ ìƒ48„Ãþø®¨U4qgX‰ ”FfM ßÂL@× [þ}फGs%ytbÙÀ…ûEe"(ç Y¶£—ŸœêvøÓQ[’‰œ’*EŒ¼ï‡Ñ^E ÿLµ$™X˜p” YÖ1F>ðÃh¢èý=Æ/»¼îGßv¿u´e¢ÄŒEyN$«€ƒ÷]í%Œúãë~:50(õ8œQÀn¿ÝÝÏ…w~팙[®¯Ýqzëg1 ØwêÆu³üÍ)QVay¡H)1bœl$ä3[)l˜ ³…=k¡)=GH‹víXx`Ô¼„Ü¢Æÿrr\£íïßOb r*\‹O1 xѾëA^ò?&uùéúÆ»é;;˜«â׃CŽ~*;Ûwé#/aÂý‰™!1NfÆ h%­€û,:¿6ÈN”°¬Ë¨ýw6†]î<¾«ƒÆí©¿Þ8y·K’Ó“ŠEJScf2ø‚@H ·›@Ý7Æ©&§TÂÕU[#$•¬ 倨”+éªZض`\ôçokãÁ.(7à‚ˆQÉq›zvQÿŠÜ²&Ž„$.W©‰òiônïvpŒNÊ66u…0o2-a ñ“ºÊwxwºÊÁk4!ûIŠTªšH³©8÷ñ îf/N*±÷ó#„ÁàlÞý8ºªÏø¶Qt’²å€!dËur5&g’+cÙmÒˆN©Ù®™À€RP*' ½ÇÀ^—ÁuHì}?Û7¤™U‰µŸÙ™ì6sóÜneye­| ¹N8¹¢¬ ›\9ô[ÚIRRBç¹0ÆagÿÙ¾/]JI÷dãuR(¡²û9bFŽš–åæÇÀ÷¢Ÿ^þc‘3cEiyt’̲þГTH*òè`ò`ÿwŠR³ñõÙ¿2<½¨@¡h¬r{æÓ:9d•Kê¦Ћö @H $€Þru‹`µbbt.K*/Ñ—ÄÅœ§¨PÁ£™,ÿÊÇ?‚’Þƒ† 9L £"AIírS‹("‘±—`ÏaÔ£‘\¬P*E"13=’¤"ŸÙ`WñDmDOøÍ¹ÉcTµjLBd…Œ 5%‹¤„ä•ÊØ*pF` ¦óJQF© NŠx\ÀzÊáKXË–Tù“Jh W¾­(ùàáã×! å péVeŠJ…¤ªj0…R.'L÷ð“QㆾcŸvñø ÆšR©4´wéCH89–˜1¥££1‘fG1H Ú “£_ì\\ (ÚŸÔ IDAT9O“ó§vµáJ/^¤K•ÍUš;1U™Ee'„’”ÓU¤©m3Öòõ¨„bÿÖª P±`º¾L}¥™×N§¯8©ò^e–È+i ©T€l‡€±Ê…Ò°‰ã01cÕmLèsˆ¬¬äNÖÖ]ˆ-ƒ)•1¥RÝÕbTÀ‡*R=LÊøBª•b B3Ú>6)§›#ÌWžGïÅîãé.T(‹Ù^b94# v` caBH $€¨W$øðŸÜíÍÊ #.3a`·©Kœó²ÊU™ùmÞ¶©м~áï•ÿ^ømäÏÿ¼Õ}õÌŽt1è8$Q°ÑZ%\ñœ&ö“°Õ“ÂØêfRY³ãÝÂw&ÿºaË”:—\þóT¹}Ö»¥a~±\ÓVàÔÙA±ï‹ïs{‡G°ÁX¼ …E›~ƒÉÖcÉ![C8ïvä_þqôê<ÈœjÌZÞýu`Ñ”%.f…÷Ò|ÐÝÔÄ‚6{ã§Ÿ×_M¼¬:™vBª*Õɺ¯¼Ú\¤²&Lu ß’¼êƒÎ7'ÌoiN²þ-vûx\/Ø¿K']S´‡pŽ£`ÏïßãÞÞ·»{-ô|š2Öþþ[PÏ;{à & ‚®“?#çŠùäˆáwÍJc6†Ávò¾o1%S¹ ¬iêZs@¬ˆoH $€À[Mà)"˜UO©×N¤²”Ü|gN˜16 }V|6ˆ+µ¶¢•–ý;Žw;¾3zÿîhòið¢‡ËV#—Ï$öñãÓ]Mé6°XhB_•LÖþóó˾[²3öµ®þ£oÄGó`K/ìÏUÈ*[ÎÙú‹ùêym]yÚûŽ^´t¹ÚýÚ3ߟ¹‘ćGÑ¿üÒlÞ¼ŸˆŸ«P—Ø-9¿³Éã·œÛOß;FÆïü´¿Ãí"å[—Ó½¾ ·˜Ùx­í¶p2(àÑÁ«›EoýéX²¡’ÙÓ̸oB[Õ¨IÕ\ Ù¹p2qói†Ø¬¾rÿ¿;~þ—¶KÆtB‘!´¡óÌã¡‚×êÓÕS/,ÜrñïÍÖm׌ÐO¯ƒ£›ÿg£ÎÏ =¾;6»¥§ã¡wTÈÊì><b<}e؆¥ônƒW/ÿ¢½ ÊVmœÖÁˆH $€x«ð*³9¿î¬vÐn}”G|5&4CÕrÞoÿ´²¿ÒsL<¹L&Ëã›r•pBíöò"X¶éŠvýÔ'ß³”å«ûðx|—È+¤ê"íÖlžÇ3ƒØAkÔ |¤5kÁ²‘‘…D˲À×9V ûÕ ÀÚ,‘I뚸¦í—Èd”Œž_ô L\¹œ’°{—5ýUºö\ˆë¤]½^#$€@Hàm%`(Éå¬ÿóŸ†OßÀ¤(:êvº„˜wÐÉŠŠÉ©¤­‡ÑF¶üòäÛÉ©JK%[÷nïöq6,½þˆ>¶@H $€xAŒeùœµЧ=40q[4q474 ŠâÜ‚Ä\ö²Ú€ßï„.ÍÍM ù<ØV+ÉÉ.Ì(Q…Ð`[Ø $€@H Ô€P^7Æ©no«_¶•2#-S½¢!ýtÛ**Ê“ÒØÃËt+ð $€@H ¼HuŸñ"GFÛH $€@Hà¥àÁ/<Š@H $ðòÀaíš«ŸfñòÜÀ‘‘@H $€ÀF 3³”ÓÖ'à?BH $€@/À܃9÷îÝ{é~ H >îÞ½Û®]»ú´Ä6H $€þcoá?R¯õ”/]ºÄ>äâ?þœàpH $€@Hàe@ü2éãØH $€@/…Šà—‚EH $€x™P¿Lú86@H $€ÀK!€"ø¥`ÇA‘@H $€^&'‚%±§GçIªMŽ*J8üWxU­¸!—TѥЭ+W®Ü]Ý:˜‘ˆŠòŠŠŠJE’ÿÏ ñÛ"$€@Hà% b/Ü Oª¨}dºÁÍ‚×R%¥‡^ÈÑ£ôjŸmCk"‚%ñŸ¶Ö“&l×7*7gqTvuç%97³¶F±>µ”¥Z:5ø’£§»¡´BwUK/m nííÓµg×®]}}¼Ûµþô°¨#XŒ@H ל€"îïŒÏbJkŸ…"nOÆõ\]¹T{ë]“pðßösê©ÍrÚSP]G>Wy °&pÿ."| Å3╞úþšÞ›"&´£ÄÏ´‘~#îÄÇ­^Å3$Ä’_½´þ×ÔýèsîKŽŒì¦ÛGtl¡ï‚#î+öœäí@$…¹é÷2y ™m/ãXp¿“b,е^÷•q¬]¿ˆ#wW»5t¼ºíb-@H $€j%``jBœ ë hšÁ+#Nšvn»ÕS(¬u::F&|bbPCGê´ù^T—œœ¼víÚÇë³Ë³¶spp°³¶³7³$~6ö£¯ÍyÑ¡T1âODZ}AíJsc¶2Ñ々»2jˆyIVôʺ›ÞZ0’©6;aedýÍ!íðâ9GHÒòϡӱ´ªï’Œó Žé[¶ ÷i.àñBsï>=Ú2Z¶4"ÄLZ¸é4»C’qzBÀÊKѧ2å+Ç÷$Qòá~ BɹÞ­B“™á·2¶^Ë~J;¶rÂÊ׎ýÂÚ;VJ$ißõ[@È‘ÏG´>ÝD—‚U8ÆWù¨(–!$€@o%IfêÄ9×/Eߟ9õL‡©gvÅ–æÅÞ…L‡©BcËY$Ñ ™Ú‹®GæHÙBIÎãà9t—™›n_+ –L©äáýasn¦1ZKò¶œ\Cw¥]ŽÆX[y$‡U5¢Ì‡Á‹hS¦^I¨cWÅsZ ')™D‚_ª¹Ç¦.dý9©Ù'[qlkíÏ¢+›#ÄÄD5puÏåE¿Ì9³ðP[qùV‡E±Yò{Y]ƒû÷ïÃŽÛ;wVTÔ—Gyôý-‡""N¬<·øç³¬ðã;’õŸL}ÔsÓž-+,,ï÷ó%p¼$mEŸ±÷†l‰ˆ82$·F-!¥ñ»úM n½bm¶Åމ}hAiß90÷ B­ðµ¯ú.!ÊÏ!į_G»¨È_|?YS°îPxÄ‘-dýœžß…ƒ”¸$*iÇÔ±s<7íÙ´`èŽÅ«“DDèÔyE ;!¶„®èÑX¼ÿÉš ¡g­‰ ÜOÿÜ@‰Š£v,žº@¼%ôÏÙ~Gæì¸F š_Æ8µ(tÅØŽ"¹¼qj¨ýŠð«á¡Ú¾2_¿jÁ$€@HॠĒ؊’Ù›3úÎh÷ŸáÏ#ûo,Z5³Ý—®ÒU<ÍQšt7`óc÷áíN¯|çk»’—FÒ:U^²bi‘Í­ô ´—%Ä”™EÉV”—1B¢*c+**uE!X±#wÂ\ßã œ£ŽÆíKƒ¨¹¼+éˆEóã«;ÿ9ÃÙæ…]'ÅOÊ®Þ-§fç¾1ÕsB»Ÿú÷NHf$gäÎkK£¸ë¿ì|èƒFy„ÑÝôxεc}öÔÝm±bRö8`GþÔ‘® ÷_fü$QQQK—.=~ü8{Y÷«Kÿq=ÚZ[ÛÛ²ßG˜Ö²Çd¦ðe}|z _²¬/Ùq9KK‹R®„ÐŕdztïáG"è*n*öÈrâ¾lþp;;—á‹ù‘s×RJ…í¼ýˆ¥c;ï¶míª40ÉN¸¥þèz*IÚB×-éßÖÁέÇW{f“КèìŠC×ÇõñéÙÇGÕGàÐÞѸ»øz·u0'7if·kbddëÖ›ƒ1˜f ð'œ¸»¨‡wç}Éí¼ "hÝÉöx¸wðnëæ¢WM’f—›zwö±kо ]ßñ $€x³ ¬ú¦×ÿ|ÞëaCwýÊžý½<@ÍÁ6Eì¹,bâ8 ƒõÿ>iïMÄ×ÒÅ¢Ã?§·v±±ì1¢Ó—6D4f0©·›ÒêNgù)nÒÖlÛÚóŒYõ"äÐ]:´'ƒ¨lvyv…¡·Ã¥X¸šðà× zŽëîг«ë"‘ì¾$:Ö³‡«¹‹w믇zo~Ïü:®ïa¸q㕉_%VÓ|Øï*Kõ|Óx¢§½‰‰‰µµµžŠEY‘¡‹&GAŒªüTÕµ·µ·`/xBXÝ{ÅRµ}˜OkØÅ#ú¨Z ÐUðY÷éí¤ÒýEçRÜ£)Þ-dtæEÕ“~kÖ±3ÈT±î—¶>=UnÌèñÕsîëÞÒ.µ‘ ˜Ïhu©È’Öí¹žµ3¶wЩœø¹Ø3&(Ø6·)VÜ3Ý ë{Áöœ8¶_é;ûÄêO\´Ä:k_‘@H $¡Îf6´¤ x [¹˜_ÿyBV¾J³ øæi®BrFÝ+ý ½¶ÀUèe¨Ö9Ú•Ò|°V‘¸(Ÿ-}„÷Þ§7%Lù&‚8Úú¼ƒ‹zûvÏ–7roAGzµd˜tUfLø˜vvz=‡~=Fºy_º[Áýmг¾)?Ýqý½ŒŒŒúôéãïï:øé6$ñ €[¬9±c°KÆáOûí¨ê!à«íK!¨í×D[ÒñR÷=×Ã|h!Z3 ,í ¹_QèåÐkåçѤf;¶ÄÄ 6B$ýq2Þ'°­NFžf劈=6%£÷Ó°’•–³*ÙªÓC}abÛ²Ëbwª>ê R¢É©3´YS¸Øu^vïî§ñç>1gÞá^aãt]RwÂw$€@Hàí&  zâw¬øãYB/µ\-„híëÛÒ”Py41uàPªû3:[þ¤:Ñíµ’¡-%â¹ÒC[Õl—mqø4)}ášÔù'óþA7ú¯R¹3( ËAœ©âŽŒ'ú=‡ñ¥½‰±t ùîcY?tx·«1¢-øùù-^¼xРAõRÀÐA%Z|޲'ŒÌ4t$Ë×íJ.‰òbC¡|¶ÎŽ]aK¿¡$iìO¡¥"Qi^rrµç†O'Q‹ÇfQ”(úÐÖsĽ£s­aižCïuä\ðˆ•‡£‹$8,8-úØÊ_N‹„-F %!kö$I¨Ò´‹—¿÷µµx5f|S’”ö HDÞ;èàMÇâEIi^Z|†ê†¿j=àRHëås×neHh’ØðKiEë–m &®µ=¤f?,AH $€€Š€îÏܼïY“‚Œñ¥”\}<é ávln"°#ýóðüâ’c›.ý\¡Ú̘¦=(͈Mè¿9¿SƒwúÙ“‚Ç›ÎæÁƒJ Š2A>S±—¦SÖ-ù¾ ŠÅÄ´‡ ÙòGBBNyòå[G¥„Ö}z='yѱ³£äëW÷;7ÃöJ8l† rƒ“:R«îèÆ$õUï†êÝ&Bç1üæ, {|',˜î¾fMŸÉÖÑ;úC¤ÕÝôÖЮkh+}—„O† lbömÜ‚Ïl!ý¦ö ¦Ký–Eïh®ýíÄ®ó'{–•Œ 쳘®v_¶gKgFƒLÕ—ý—]]g¿jÎâ±;˜Ðfè’?D88øDÎÂ÷‡v ¡{ùM?´!BÏ…Öì!æñ`"*£.ÝÇõ%Gtݱ ôúï)GÖI‡ÎÁô$}—ùµ9x`ªuÂäiCÄ®í²¡$xb¿5îK¢Ã†§žšºø¦Ü}Bè w&‡/H $€¨F@;iÀgâ»<¾ªÐΧýÖ!7¦¬ü–îÄýr¦_gz÷¬óžáùc' 'NìÇÛä¦2í…-gÚ<^º&¶XÌbùóQ1;Høµ’y[ïб·÷ÜÞ¹Ÿ¾ì6¤ãƦ¼´ËIßîH¢¯M,ÿìcCg^lâcÍ”U½„Í›|°°Õ­oî]zŒS=¸[˜¨·ϭʿݜ?z‚oâãý[ˆ7Ƽ³®§·IüçÜ»[_ŸC’ˆJ‰À΢“ˆDD „ EQ<8¨*$Äܼ¶è+%*…[Ë ƒ¶®ò‡’Ð~ã …ú««ªr`b¾<èaN;£IàU}ÍÐC²3`zS’Ò J`BϨîÄt°ÍX·BáÓ:Õmkuܽ{·]»v:Ex@HàÕ ð‚þ‘¢$R‰œðL µ…VH‰¹™ö¶  •Iy&Fõf =`äTi…BÖÔmXûPò Šå…L™ö˜iÏ—žH ÏõÌ®!E—.]z†)ëŽæe+@ù±ZC‚Šêó`ëU­@­j_WËÑ¿¼ººWkN‹_íS#4ÕàU}ÍÐCjúÁ®qÈi­ëZ³ ä5u u[Ó3H $€Ðà ôÈS(Ô§M „fª»Ê4Ý«g¸¯‰·è&@H $€xŠ rçW>Kh ¼x‘1âŃ# $€@¯ððp™Lfii)‹áŒ2‡#ø|>Õ¯l†ËåÊårx¤Äµk×ôÝ÷úÍ=FH $€x« €ÀupphÚ´©¨áŠŠ PÃg0û — …¢²’£~«?.8y$€@H ¼@ƒÆ…Äê]xòqyy9HaˆC!Ô² "Á)ãéoƺã,@H $ðV€ýšùC„/è`È@R `•J†*h‰"Xƒ 3H $€@¯+¶¬äÕLbÀP¢)×äQka $€@HàM#ª7>>^£}!3„W6ƒ‘à7m½q>H $€@@àáÇ[¶lyðàR©Ô޳pP㇠$€@HàM bW{ûöíƒËƒÂÍpl•vÁÚ¬0@H $ðZ€X/$ëQQQIIIp™žž~óæMVþ²!Ø6UM5}0ƒ@H $€^/ sY¥ nà Á‡Ò\BÎÖVÀÐEðëµ¾è-@H $€€~™ O+((Ð4*++;~ü¸F³åø° Ì $€@H ¼ ÞÿýAƒÁVàââbCCCöÉɉÌÎð…F‚Å·ŽnÝ}ôºäM€‰s@H $€x¥ T“¹ð„dp— CUµHpCD°øÖl[cG[ãUáÙ*9gFÓ%Ý)×K„ŠY3ëËnˆõVꊶ‚eõVí»‚ÒY—^!$€@H ÔE@[æ‚–Hh9 ò—M×nЬtãŸÿŠ˜ü½ó]¥3ú%0!¦#C“.ßk¡îøÔ÷)k†þ±¦+¹¸qö»a÷A<‹ sÒRî¦<ΧžÚ $€@H B@———ÃV`Èh€5¬Áó,"˜œÜs›Þjœ}~3}úˆ]ø_òøødu(÷ËÇŸÐååGÝ»î¡óâ»ßôêôÍŽãû—€pï{ÿš©OÕ¶ìÔ¿ÛO—÷‚…¥â;¿÷ðölÛ»W§Þš·øê8ÛãÞÑïÑuúò«™£{ ø'–à¢ô3ßü $÷šy!½6Q 1!$€@H ¼ ÊËz¥Ri6“JKKE"¨aH–Éd ˆ53o˜†ð”/frñèµ êqÄò„^3§QE‚eÂá‡oħglÿ¢×îe#/?¦%«¡!Öææ;Ù£„»[ŒÎÏ^5“)b"ŠÛúîGß%\þï­Ý+S®&\,¤(R~}¶oÀV³5—o/±Þä»>Wc3H $€@oö`»p0pddä¿ÿþ '£Áã¶mÛ¶ÿþ .€0†£Ó4ÎhØée„´ô¹àè†5'vN:C¦ÏêßáäF’`ÎÝsOî]·ÿaR!\æ•ÇêÆÛÌ=¸É ê¾ 8ä¢!_Ïj¬ ì´Š»OÞ¾<Ø×’HÄ»¿ù>8„7çUR$-ò Ô/[0­µ£iËcçï¹LDq§áíäÅ“}ÉCÈ¿–/¶§ÃÓ˜@H $€Þ 囘˜xþÜݨ(_Ù4Sà­4ãY6ÍÊl}ïjrrrïÞ½[µjÅnЍ®SŸÉÜcÀGCÖ,X2ÄèÅ¿¬1]¨³_YM ! 6‡ iMvŸ¼KˆËÍ ±DVë=oËNeLö±Uù@%}îÙë°Çç¡Wãe§? Z¦m‘6.*ÌW·dÞ»·néÒªåô°³,]T5ø†@H $ð6€½p6𩣩§#¬ãåM*+±äæ mòm•&?ˆ‘= (œœ`¯BÖ!‘ñZ÷ÿA9y€‡%UÎnÀ-ψ'Äãó½<+ÒïA­ô D«§²ZÕ¯º%ßXƒmÄOriÓ£C ãì  â[ZXN¹tî ‚ƒ¿Þ¿oEÛ!KØÆÂæmºB®¨ˆßÈÓ·³gc [$0!$€@H ¼Uboe?cz¿Â®ÒÖvä+>±Ø[·µ4vqö*môNBNé­[·à†9ÀÒ°=ÁfÐfã' =·¤)\1wÅbÙ-hIøñÝ6.ç$-Ú²ü«Ã̽q„Ð}è$„¬€ÍÒ¯ZYíB-õjê6fz»Ä1~¾3ê²ûâòƒ1B¯‰G×Þæò†ù›³V-Ÿ¥êiÙmËÕƒÃɶ ^.m[¹¼;`Mž–™*ë˜CH $€xC Ànà› †‰’FO[ˆÓ‘à¦V&NV&™;ØZ5nÛ¹Xèúøñ㬬,`Àyœ_ù¼P@TXÂ3&c$4Ò³#¢¡cI Òlj ŠYTR΃ /ÿzx¼µ›»¯ôÜAówÞÝx½x˜3»û•éj<¡)n†h(æ×£}äÅã#FŒx=|E/‘@H ÿ–ÀéÓ§¿^§¸)¶òbodÉ{XFRdÄÛܸ‘™±•gfLÕP˜e—¼Ïßß???ÿ9èTÍA¤²æ4MÕ3g¦ªÜ„–LFœ»;pàaµ¹ 5ÿV)`(ù‹wéÑà;@H $€Þ&pW\Z©IŸ6ý¼Ì —SXAŽ?[™Ú,-¸¦&„g@.žOnm…3ÔÌóÁÿg£vëó‹¿+(SÏÔ¶‘Juÿ#ãH $€@¯2%ßËÅXhl@ɉ…1ÇÜPafĵp…†Ä܈ð ‰Ç$O"a~ÝD0 ÞÈÂÆ¨þO¡{•— }CH $€x.àœ`‡cjÎ7æÈ8DÎå˜ó„†\16$ÆBçóòôÃ䨅_Gü\@¡$€@H 7Š€‚K”„oÀ‘+”pG™1W)àrbÌ£÷B˜.E?9™7ìtˆ7ŠN $€@HàM"Àå%‡‚ÿi¥KÄ@IˆÔ.‡ž¤\ ´ÆHð›´æ8$€@H “ȥR…˜"rRPFñ¹<>_` ò "7 b­CÑ0Œ$€@H 7„(% %D|)‘ŽœH”D"'29 ‘aˆ sèÈ0Šà7dÉqH $€@ ¹’Kˆ t0h_È_œÚWx“©¼ŠÞWÅsH $€@¯58úAiÀ1¤u0ǘ¹IŽÏ#po^ù„¾]NP«Ià;@H $€ÀëN€Cø„Ì¿ì IDAT@˜kOÌPÒDph ê—§¤3š„Û!4(0ƒ@H $ðšàqˆ‡ÇDbhÈ3às¹<Âáhb>­Œ5©á‘`qþ·2JD†|¡…­ƒkÛvŒ4Öê•‘<Ê.#¶ÎÍ„õjþ’Q9×Ij5tT‡Æ œçKv‡GH $€ÀÛGAƒÃ‚il`H(Ø[„y\bGC„X+Ü0œ¹5hȬD-ž3Oeéc©Uðôlü·¡«Èᕾ¯ƒ –äݘ¿dÁ’ÎCP?}i±@H $€^*8"˜‡x:Ÿ¡_d¸\ú,”V$X+ûTK®Ï¢p»UG“çW>Î/‹¿?ÎÕTo¿”}3m·%ˆéZñÝÙ¶ÆŽÿÛ*ašºÞ8|ê†»ÖÆd½R(þçccGÛÑw˜ÑêѱíÆæ`¶WcBH $€xÅ (9JÃnøvF@þƒ]Âpc\j)_­ìÓæôàÒΫ„ôþ5¨ss¦-Ï¢±KSK:–ü ü×Ñ smßûø×å zo­Ÿ½ ʃ{Y}¹ïî½ÐŸÃÅåY®¶3ï‰Iþ­ýK¾ÛŸ GTˆï~Ó«Ó7;Žï_>€í›IцŸ$ü=»mmòg gÿ¯Ó7‡îÒ¥UI|}Ç×ìp޶AQÂúèÀfÆûÊ%Ofœ _n<þ„îX~ü«£¿úõŸßAš¾~S§=Ô^ù}!4fÚŸ1¥œúù=º¤ÓW›2ø‚ÀI@¾~ñ¼Ålš·x}x}¿áþ—>âXH $ðêPr `˃„~ 8|—Ï¥å¯ìW à„à* ‚ÅEyÐÏ¿GUo&÷$nk÷À—ÿ}=Ìêà‚îë.£Vý§·ƒÊ 5a3ÞkѬkÿ6pá1k÷¹ùÍŒU˜x%¡‚Ö»²G w·.yŒ\6½WâÁGbKHù­ù½ÆN²ýbüt/røòÝG…p²›Vʉ¾àÇ«7D¥gü{t†!Âæ§ÐõíV…^íÛ܈ȄÃ߈OÏØþE¯ÝËF^~LTœqñjÈ‚™{Ȳ5#ìœuÚßÙñQà’ ËŽÆ_>¼|÷²€ —²E »z[’Ø}éÉë¿·#éZccö­ @•å?¬;eå—=U••í§qkÒôzÿRñV@~Ú$e÷ÿY¹v%›Ö®üç®Ö#~žÖëßâ;Ó5€ 3noÙ35œ@/Œýœd0®€mô.C.n†ƒ§'Óa›ä4I+«)«%#cv3H*™h-øë.÷^Ó~¾˜ïu Ä VOûæÖ±µ1O–ôvoëIÈÝvz¶°1"¦mA':yvñrÑl‚€¸4›ÚÌ=¸É ê¾ 8ä¢!ŸˆÒ®ž†xóòEïy¸·ÉÃlÈQ·T½›Úö'äôÉY?¬* œ0®5=f „œtöîÚ¾KÏ´³{îɽëö?L*„ºœ¢râÈcö3|uñÛ¦´•r­öå'ÏѱޫçNr>ûh!]²lÙlOgÓ63f¹s\bz{Ämô™sþéóõòŸ;2pø¨!=Z;èm\¦ó/vn|›cþˆèmŒ…ÕèHš$hÀ_UšN˜yÝ Èd¹ÚSÈ,Sýó£]ˆy$€€.>W *XÏŠS(er¥TIätqLQ„ÒŠ¬6 lצ=Œ¼õ4»µ—Gè÷2°G`éêÞʱ¥÷ÔаÝGÁ o””.„wæEÆì1èýû«¹#- $¬Ä¦[³‰Éå €ÍÔEªwÓÛÒoo ž•²$°kóUáP.­jCýʪ÷1’Ö݇€4†¤þ׳{sÍ|ZíU=[¹´pm7bwhØòþÎl‘¾/€c•¥ªøöÖà ˜ïJOoÜùµ_ÏèÙ¦©÷ôõ©:zWÕSó•½Ö|ñ{ªal€M€¯û÷¿¹æos㨕<(N‡P€ùK)(J.§ Ã<+„0ü§N Áö]‚fB·ƒÇ-ß•’“ÿ(‡Þ©I»^ðZ\TÚØ£›¯WK >í¾FÖvP˜’˜ð¤œ"F&¶pñ09ùq~M\ÆjjhÀ$¡KW:лäÛmû¶Înõ.dÖMTέ³·dïÍ\ýÛ³ æþ#©<+z€ôÔø Už[/>Ð˳"ý”JŸÔ”'ÚíMÛvÍJÊøm:wkãìÀ—/ZîïØ°ízôß³û.€<&$P¸ßç´4w©Æ§[¢óªTëËgư ¼R¨‡1áî]¿ú»yÓÇõ·:µæ_âÏèo½,gjO×ý×B» óH 5x62!psA(Ž ˜¬¤ƒ² –Qðeu»ª(iUIí9^ó/ÓoÛ®š¼vZﵪff<ž…×§vI>·àÝŒ^¸!i§{‹.'Û¶Îèµ5øâã™—OÞ½dÃç¦ß0&ð3§JЇ¤i…Ëè¬i‡Õ§~'ó§ÏN_²fy×KªiXyeò¤áUÃ\úy½ù¸ó¨ d笙Ü—œÊöšEfüøn›ƒæÎ‚mË¿:<æâº}UHÙH»ýÇÓ~ß.?iIÀî%t«þknl›ðÉÆéÏ Y0ü`»™_L>ýÃ6-é6˜Þ.Óö¤w#ÌF Š'™i‰a;Wî>¯ awO»f”+œªJÍ&„ k$ƒ‘mÕ'°ªæÀ«M ,lRß9q 6×çóI®‡e£ŽayyU»ïÌžÏÈšÙ` 7‘€RIåVrd”\AG„é]29Úçsà°³†”—”‹e„gljjZµS‹àß{ž‘ÐH½ý€P¢r1ÏHÕ†—KOhôÔM‘TÊ¥ð²Æ­›[ñSÏ.>{[ÐæøU#\t¤$åô`BS-k´D`JO•—Kx¦B¸ Îh»¤eF«=”ÒîÑîWͦIñ,Á¦W„@äÅã#FŒøœ¹2ÎkÆnÍ@›ãþ™î©¹d3Å÷ŽLj¦[:mObȘֺexU?Eñ˜Hªæe!ÃÌghøúo. ŸþbE‰á¾æo­úyûµ¢þÆŸ¤Y'Ûåù|h½8ËoÑòàT‘Ð&pêÔ©«-¾™Ý¢IccJAD2ƒSi²&V&¬Œ­„ÄÔ‚˜˜6%7—6lXQQѳüe&0µ˜jÊäAkV/‘ZUú²~ƒ‰ïn ˜yRe¿Íø óª)`¨â @WsAËž©j,M¦Z[úR«=sUÝ=zšzºaÑÛG@¢g#ƒUë¡¥ðk9ª*FFÈïcw.£ SQ{7I è‘DB\'Ïã õg@\œ{ëêů\ŒM?>Žxy‘8°æ0mXPЇÃzØj5f¡çGÜ|&QÀZ,!½gÎïáÀËŠ9òã·K׆©ñúvÙ÷Ÿ÷pªåÛ•jÛ/«7­„ñ˜ä´è“™Ó'ø9ýùݶGŒiI é6}vŸš¨â¨öÿ±{Óïê±À‚—ÐÈñcÇàô¬5ÿΩ_V¯¦#ë^þ^qç‰Ðä¹ó>êQ¯ ß³»Tv'üè¾íûWîfôÃÞ èìíÙ¥ÿ¤ *øÅ1ë7W/¡¤YïÉ{hÝIeíýy[*Q­°‘ë OÆt¬Z4*ëàÏÛ™Z‰DÕWœ³ccȦ•¿³øÞ' NàÉ®Ôþþã·sÖ‚K^„ÄyùO[º2x¤ŸÖˆì¢±¯Å©wmÛ´M³”ÌZ 5nXk«*/ضÏöÉɺ´wÛ…«0Û½ôs·®M’I·éŸk}HÄY÷b¯F^¼rîjl\úù¸8//¯8ø8à ÿaÖô–5Mª¯e-†ÌŸ¡~óÇøUŸmèÇ@¯Y*ëȦ—ÎY«ú“Aü¿Ý³òó1~µüAÒL3H ¼r8  ÷¬Ér ¥Èr)¡„ô¶`¹ nB«røY"ÁU½_XNT’/CdÈÌÞ¦JF¿°ÑÐðëAà¥E‚×Eÿ3»£^F1!Ã|ªÂ•t“퉕™#Kà®Ñ>æ3ª6MøG–†ûi”¢8f˜±Žº¨>€ÿİ‘­5èê˜õÃ|æTuÚWÔëΗmÆþ^½+¸]4±£UµrñÃð©-úî®VÊ\xíÖ’¶ë¢‹fëvÏŠÚÔylÕljù!,qáІFÁ©K!Ÿöœ¡Çø*@ÎWÍ”è‹?³KùwŽÌ÷ ÐË™VÕJ•Ŭ7÷™£™«ÿÑá µ> e1Ã̵Ñk]Qìì*èe1}Ì}4ĶG¯sý·EÏ/4Öª2sÔ¿ ͺ´¾iϪ±4µsÃR~ꪹd3÷N­n3PŸ)ºÚk{ô…j«ÿlŸœj½ªù ý!¹2ÌK÷BµÆþ‹ÂÂV Õ|šëkY—!©F˜ãY>ÕÌl/Úåó¥¹—žbTM¬ZÓj³ÂK$€^1l$xùÌfv8!­LJޤÉ-…,Œ--ˆ…™8«!q¥*Ü€ãþË™ -m5n‚ ø¿dŽc=ŽÃgûëv»ó@S {È—yµÓ!4‚@Ó^7s~T›¯áY0Ú‰/Ðé4#¨·^ ]&ùüøP»'˲Â߯ECCm¬Û¾º³w^Ó:0´ù" MŸïNiv@×4R³$jýHý šj+àš=ÿ.Ý;¸Ø®. ƒi­_ç× ójQÁjg4ªÚF»Ì'Mµ<›ä£_C›µKW‡¬¨OÓ•«Ý‹2®v =â&ùŒ×½MóÿóÉÑš„NV÷³©óÉÔiÇ\œ_ðõÁÔšåzKª,ë2$Õ?óÇ šÙ°I½»ëSÀàÜîI?žªö'I¯ËXˆÀ+D@!WÂs1d°XI$ ¸N·ÊQp{üS(gΈP;ûŠŠ`µ{øŽ^m¶†éªàÜ‚Šzy,#ìmïA‹Ö…‹Ly™——öü ®•ÖžI¨v_¨V%d韛uKª®V†Åh÷-ÛÿE_MT’m5mÝÉÄ”Äs~ÐA• 6G¥ô«¾–-ò_‘ø óAôæi:ßÿzàÊð¬êýk¹³µ¢ÚL« ÑÑa‹jé£.~f—¨‡ÛŒZ©6£zúvóÉsçÂölÿaÑ4zB/ìZÚ^Ä}1ã õ¯ðÚål~í¥”ª¥ßû³³Ö†uhñíÈÌÌ”ßjS;?osDMCU%õûä4ö Z·îÛj o×mÞ¼nÝëº42Ö”I˜³кía‘q‰ô§91rîÇcí¦5Ó¨¿eÍ53Ïü1Ð1Å, ½©–´rõ)Ûµ4Áb$€^- ¥ÇËáq9Æ„O?7Ž˜'eøÄP+¸"øÕZ9ôæu#`æÖ¹šH¨ß Œ/ÜsòA©r׊ÙCûø¹:9ØÚ:ø ]øï¹oµû§§©"Ô.Ôäé¾ãÈ¢=‘¥2¥²(nQuGªÂ²Tê鱺?ÿ/ K ™= µkë>#†—Öì«D¼ÿ›Qš :°./|EÖNN§‡D…éŽúõ¼muZ×z±í;ݺ¹q¥»FöèØ±ÇÐÿÈ"·ÏÕ­Õ¾zf—Äû¿Ò ñÚ]´kéô}ú 3qáŠðXY^f¨÷SšÚÎÔ7»Ža±üÈ,U*e6éé8mó¹<™RVWMx–2Ød:ˆ/Ÿ¤Ýs]dÞRØ5ìà:ré_´žê÷u轪õ×îAçëùÉqð9{ö¢ñÚêš-\4{úôÙ³ÎÖÞwÞ¬û“Ñ”á»fOêçÙšþ4·ö›rò[Fbª†?/OíRý-Ww½êú™?U&èÈ_zm`3þ¢ÈE°6qÑ—˜x} pà§8æqð”8¥1W ˜þnSÒMB¬A$ð xM›?C7Âs0FÏÍd¶ºi[KÏz¢}Y-ÿ|ÿp.sÅ?3¸WÈÊóÃ@µ¢Ý8ñ_] ì¿y‘ö6S3ϯ×mÖn_•Ϻðƒn×?}¢u‹“ÑÐEktFûZ7]eI'GÝÙ¾R'øöCÄמUÒ“ç7ñÛÍ:vµz?³K5:.:yrŒîÖgøÒÖÁ¶Ú®­±Ÿ= ±Æ€"ÂWŒt€iòœ&,¬|î”é}à†<ž•ç˜)ZzVkLêáåðúáC?ÍjõÿhVÛßÏÄÕÁ¬ÿ'‡jÇ•ɪ0CÚv0 £“ÖèlÖaÐdíUL/Ðé«s{èõZ®aS]Pc5Ÿý“ kã¿.3|…ŸìþåyûPÛiõxøŽÀëC€Ç!<%™CCžŸ Jæp 41ŸÀ#”5I+«)à @õ& u›i½ûè6¤ÊŠSï݉ºtéRTLÔ íØ™nÃêWA›£ö©:: q+Ÿê-T×ew.‡iWÍ; Jp2µÍ¢,硎Võú¡—+(n­dæ5c®ŽËñ÷ØZmjd©‡IºÒzÚÐ. ?t’ÖV:åÏìRõŽdîäw«èéŒñ".6o_أʰînc¯¹'Yu÷[SÏŽU-µr•¥Ù:Ëál!++ÎgSqYfnŽV[¿úÕ–êýÉ©Í@åTqVêúã—ž®Ý´v´[Õ+_}5ÿ_ŸÌ è°ÙU^£®:Ÿèzùƒx…pè'Æp l`H”|Boæq‰!D £ Öý÷욺‚^ e7ÂuôeCœß»tlçï›jÅåUÁе@ûǵîT­ú\ëß"úZ¡ZTP‹R*òçáˆ"}¢‚‘Å]DÐ 2ÈÿÜ™$$!A@ÜÏý@rç.çžûIòËÉ…B‡JêÞOÌì@2Ôi³¼F¬Š®|\ª`Ö£¿Y£ßŠší’rG¿ÁTÁÛfmx¸;ÊË|îö° BöMÀÜJÁußIÄå 03 P(‘ÛH½Pèok+WP—mü‘S×çE9qIîÿíßóÓìuJKÏ_Ô¯™õÊ{óeŽL·^ ‡µA{sù#º™b7$€Þ¸WÞ.®ƒn¥MMq_ÂŒ\ø·ÑŸy„GGLSþB#ßàuä…±«–d,9˜¹ÜSr¼\ì°ä–>œÙI)íÍWud¾€8@-L –ç`î–gÇÁR`MM8®U-æ‘çrošrAáû *Ì»RxO$i(*¹ž}­´î²æòýÅãvDÆS÷1&ßTuŒç]“ýÝ~(.t\~·° ˜~fbBo”@Ö¾²{¬²žx‡OW:mL¥ƒ·¯åÊ—üe‰DË—¶dÞ —ƒÂ™>ÁÁ±eröË2võœ¨:üÌç+JÓä¤+ò=©‘’;ëBŰíÚT¾ )ž3÷þ©x}á’Óá ßäì5Û%厙‹b.¥,7†,«¸f!6ãšÜOIˆ—ò¥—eý^QF·u;˱?þçNc—Ä(tlþ†ýMQ>1·/Ëᅢ«¤ X¾U#òõ,7ØGyo¶Ð‘Ùà˜X‰À»A€¯Y *ø9Ѩy^[]Sû¬–ÔÐâî¥ÌȽ±7E‹²¿rðUt6Ç âÆaÎ}\-W…„ÉØ4sñôórªZ©/£ÆûÊþY›Lú.â>ûnŸµ£‡Ó@ËpÕ㪷ˆ5H Ù´•¹ŠK²Býí”o!—Pý§mc©~¦ÐJ$·´·äOŸ™RèQ¡_ã7x¶Ã=Z'Ïž°t߸3¹¸äô¾¥mí}¹KÇ*´a7t¬†)\ê•Äþï/éòÍÊ2boóàѯ‡R¤X¾¹$¯ÓÓ^ñ`™ß„ÊdpQRH{5·OƒþÍv©^G`¿-çé3¹ê;Çɇ•eî ,Ë›­—¯·7[æÈ¬7 $ðîШ¡W‡xä/óœajjȰ÷Š! ÒÔÌãw%¤«–4À£¿zʶ¤¹g}Ϩk©YSºSlÒðkÜqQBþݲËÓæ»“´P?ïà3Щ·÷¥¸¸´Ï-6ÐÈZˆ+_Ͼ’›W¬øvÜÈÞØìƒ °xcHÈÆW/] Ïþc]uÛ ÂꮇÀQØrv³ä7àSQ8cÉ÷›%I¹wJвömôQJZB̘ ¨(:Iòº)fº|¾nû¡SÖIî ÚmÓ/\%_»Èaî®tîûíô]Ãì~ wÙ²|HcVð¬Ç-Q—.t`ç³14d®]w·Ùò#ÖË7Û%åŽpObû¶®¡IYebHÂ’;ùéGöÍu»/W²Àƒ×¶³BX;s]÷Oý7®žk§Û]ñ®mõ||U&_­Û¢`;yQw¾kHô颒2HwŠò3N Ý8׎Ïÿ4$C¡e37ø:(ì©)ã—Ÿ.*£Wf+c~ëò–#§,Ù•t§¬$ëô> 3Å{fff˯)‘ey³*òÊ{³eŽLa@ï¸72!pr\ ‚0­ªá†Éµ¾ŸC0‚NU´V’š"‚Ù.Š«ÿ8+âs»—O2ÑíLÿ¦çÒ7FQœ—¥“×ÞÇ„TåEM2y$~ý8Ú`VØINnæÆ­AÛXü]à$çQ‡²ë?¤áp¥‚-5<«¥±KÔÔÑ«Aq÷ÌRÙÀÔuÎ^o…š`_] ;W; 3_ůK~ù¦¿BSµ¼áþË”+3#ÌŽT4©Üˆn7Û%è®8B’Ümu!¶7ëéà>%89ö¡ìm:•/›¶h¹â"U¾º2ãAß$(} ɳ'íÞ¾-$³î=퇺,¢¶Œ:÷™‚¥ÌuC»·5lÛ¾ý°0úq Ós„â¬`_7³¶íC•îQM3}íÛk¸†Jƒï/²¬0ªŠf*la@ïÚZ®©}áàj¦æ9ÓUÕ5–FÔÊ×d¬¸BevïÔøù?¤¹oM/(>ÀýªÕ¶Ú°ø˜©¦‘”Å>ždlØ '´änEæŽáÓW縯9q1²åõ´ì”Ò†Ã]F»8ÁX„ ß¿”–ºÿ^%hz¦µùç'²î^N‹vLÝé»û -jôp̽øaÓ îkÒïV^ŽÛJ²·º¯Ž ˜@“¼W½]é?Ä´ñ½xÝÆ&(Þ`¢®¯ÀÃ¥n£%sÝÆ¬ÍÜ;G¥EÁ’بmŠñE…v“#T¼=2šd%±ê½åzåÚÆ,‰ælóºy^W¯ËýÂÂý ‘f»d0ÎÅCÑZ[¦_…©#ã}*笢ü£‘†ºTMT… êê››ãZ›~j»ÒÈ*Œ=Ë-|SQߨ"ÓQŠk0¤͹S yc—ÆJ‹”Ÿ=êΆôbõ\z‘ez9%† „›}¼À¬Òű¥îâ3@ïVÏ b·V£ª¦ùçTûÖ<§ †Ÿ·p$Xßd$pI˜¹a}Di;óªNŽŒ¸¶ø ïI£!<ï€7΃+çûYu¶0¥TùZuô¥Y};çÞùGýew -\-¬V4f¸ªG ùH·Oá"õíúÚÓ)ܸ+³ µ„Ï"¾ò"`% ‹·ßœ-{c3 ]ŽX6ÈTÕA¯ÔGá°¼Q?¦&nQÖ1~b\>”t;Ñ»^_®@É1Cå+q¢DÒ¹þuÐl'ÿøèzâ*?™„i,9xêúåµcHv’0 rø IDATš1¹bcϵI·/ÄÎqQ%L]üÂsª#fY4 CÝ8cÖ>¸pPæ´ÂeKlNè´áZOåT¶¡ÂÔØ–Ív :¢sñP5X-ðîÞFWê 14ëö©påo&2E éÙFÖŒfzÔuƒM>_~€AƒË»;(^\YéÄÁz;Zgˆ蓳[æÔƒ'qHàí·ä›á=$[à‹â!]Ï ÞzGŽéÂcb7(®„Hzñºyr=Aù;‹‹_ì…‡%%nP<œŸÈœ‚Ì ,+1$fôኩY‡â®©oV[>Ø£âØSt·xËh<×€KC0 „kª˜çUÕÏkžÑ ]\Mä/Ë^ï-¥™°ßÁÓR¯Tùõƒ7?ñ“ÐÖ®½¦ßogÁ¥C»vþ{eWhP`ԵŮm•ÌtîJKÅóàºÅPXQ*¿JL±Ÿôc£*/nE*!NŸöÐ'w¥M˜[Xô›LÜ—E~3†\Ý™Chà™KŽ‘[Ìã:Ë•HMáóHÀjrhíäЖž¸t5=gØÀuVhµï¿®Þ|ZMø­ÛtînảHS׈ÚÊ ù…÷?åó[·ëhÖÞDò™Ü°c¶Ójk§5ì¶±…ë²Pøƒ³ìå=ÊRäƒy‚;Ê«‰IÓþc~L³ª¤¨ðæ½êÖµ©~ü°šß±Kçn&Æ Ú@­IÏCµ•E¹y÷žVŸÖm:v·|¥˜Q;9¢®´ªÙ.ÑŽ‡`.wnß»÷¸š´æCj­khض­±Ž<v”!Ó’ª'äçäAKˆM¶îhnÕ›²Uhm­ÚEǶÁÚþµµêæ§cõâ]iÐmЬ}ûãö½ÇÜà82¤“06V‹/{äðLÆ, ­µ>?¯à!‹‹—¦ÜUý("‹Q¡—«ÿUtýféSP®mÚu¶0•® #*¿ÚPxëT´nÝÎ̬½Â±Õ°å†Ò‘ijòað³ðsAí4uû†‘x‹ ðHm,ÐР1`¸FiUUK—ëÔÈ@X–”ßîe*2:mº@iÂÞØ³ƒGvzà§Õ„|.è¡ÏÜ»˜œÇ¸Ñ¦6}kÞMø¦¯,‚«W;ôpø”¸+–L2š7 ì¨NGϦœë÷ôiÞ‰5´ÍÊï< ð"ÁUî@aàÄ1Ö†y?¥‚D~Ë„¹(qc†Óë*€uÆGço?7ò_†ç%Äzp_ÅÀŽj¯° 4Š€8ï¼°tqR¼5+µÁ30±²Uy™Ž©…UX4Æ!q~Ȫø~S=?±2eoŸ.ë#NßµXñzd®½Ú«}g00éfk«h²àž^öQ§›•­Äb³L5Û%S+“ÆaæXØöo–w¯¶BV*¡W0®Ž±…­±úÎ3éf%=4F×16µ2nó ,+XS·ÑìÃ@A,GHà%ð¼¦VN +"žƒü}§Êö…8–Ë-‡PûQ§bæ¼ ÎÅ>šæ1ot¶ÖfeÌ÷V:¤ªò/ßñÓ$íÝ—-ð°ãè¦Ü÷}ÉÏfT£Ò*=Á´¸â…³~˜÷èËõkf.Ú*é®ô=|4-²vŸ¾xÁˆÞ ïõz=œgô&Û¦ØÖûË@O›´è ˜ Ó§²¿G6j8£¿$î›ç6y¼íNÂqή­s+›H ñĹ»y%Î]í7äoVmù¥¾ó•×ÀĬb$¸ñ†[¦%sÿâìu³ ü¿%.ý?¶îÖQÿQQæŸÅf* á±Ý§ñK{zâ@H 7Mày«Vµ­4´à§»çº­¿Ü7ŽhÃ-”á‘Oj¥ÜlŠñjþiHŠp]y™˜!úF&Üúms¯[%ªDPÆÓÓç~ÐÕŸ´§rG¡÷Œ[%3¸¬Õ¿Þú‚Ë–Uwpýùâׯ¼'‰?xCQ;…å„zr½¸ðXñð.cdPZBÀ´½¾Í÷)Â"±ž>hkæëub=#}iÂpmãv–+DbÂÓÑ«÷¨l\Ì Æ¨®®ÊÌŒôõˆTÙxû‘ ‡¸ÊF¯²°²´Tj>9l]²4_ÿyÎú/ÞÆg}G± $€€ ô®>pI¸Qœ¦F­®f-(`úª·–fd©i"˜íÆÓ32Ñ“dxÚúúrÚZ¹Zy[|?ÒË=FZê½éÄ?Ì_¬nÄŒqºB;y†¹HÚƒì ‰×ƈ˰[J '³ Ô7‘@ T«]Sî½åÔ—Š·)n¢éhÎoýâ¨Ào{Ô&øy@H w•Oƒ´Ò Z÷9ÑÒâµâkjòˆ†&ÑMÌ'ÏaU„45CK»¾Ì³ŽMHIÙê‡B¸eOߤp‘l§Ÿ¾<æ˜èvèhÒ¨2›ÍNÖ3H 1 Ì]6øyï S¸Î­‹÷ª…A£^ÛªMõŽêXýóvŽuÚÙ”3‰iI‘J+ ÞK¾ô›úù·ÀOõ3À$€@  Aï2XS£•a`,æi-ö„ùë7ML6bäÆ7Ñió‘NÓNDƒgt„›Ö5/5}¸æƒ½>Xƶ C#àî=V ×±†åAõ/5ðæðè˜Z ò„¿i„D¸CZuu5½·.ºùßÞ $€ÞCp]½]\+,Ö€EÑÔ$pk ÂŒÜ2ð³ï=Üý8¥7K@GÇ@ç­_Q Ã¦7 GGH $Ðâjá–Éšš5° ˜ÀÊì†ã`SKNËe[Ü 4ˆ@H $€^#ZV° ¸„~éu!4ùšTþ¶âS) Ñ`v±°ÄÁ¯q·àPH $€@¯’@-=#þaY]¡¥© —‰h‹`¯’'ÉÉŠ` Ì $€@H ¼Ûøšµ ‚ŸÃ½âž×V×Ô>«%5´€€8†a¹«C ~·÷4z@H $ #7J†«C< ò—yÎ055 dØ{ņ?i’ K‹ð $€@H ¼‹à&É„ÀÉqlèW£U5Ü0¹®ØDƒÁÕ ÜE¹nN(‚ëX` $€@Hà&P[KƒÀ5®Õ¨fjžÓˆ0]Q ׋ eu“Ãåu,0‡@H $ðNhõœ0 vk5ªjZ1Nè²àçôÔðs¹HpSD0S¼óÛå¹bæzÜòï÷³·/~³ÄWÖ;ë®?r­ðÈÚÎÎ sÅÍô¦êáÍ‚›н™{ç„E\¼×\£ŠÖp $€@Hà5Ðx®—†`×T1Ï«ªŸ×<£Ë!èÊàjRռ㮜¿¢¤Ÿ9ÉúzúzVdïèl¢;k·D s›‘™å¯az’!˜êŒl’WV-®¸N²3á]ÍKWwì4ð㫊*¸êÁùyA~gá&͘@H $€ÞFžµâAX.¬ÙJ³\"X“ÀeÑà"Á°î—¡U7&D‚+Ÿ’÷W9±&$øxg£B^QR%³Ì”f_É;ñ¸Ù2R|e–‰nçq;ÔÚÔ·þj*9ZJÌ&¤§q#îÑUQ^RZ.b}d?,y,¢ÂÙÂë|Ì‘ó–Ú2×iF[×å@)Ôâ@H $€ÀÛF€ÿ„¸o ŸÓëBTUW×Ô´ª|V+®!Up81Ô¬45Aëêw'½;óy­M{“ÁíàþslÒ–d´ùu*²"ïI:99îܧO—‡²Ë‰øÊ÷κ‹ÙE¥gÿ=ÂdÀl*FÏm›$‹%K JŸr£6Ç@>u¦…I ,uPeóú™’'fØÜ<}1(j^wÅsürãÖŽ m2`ñw“œG¢Ã‰~óèjç±û1˜e}eÝÕsWdK.Z}à.»Fäú‘Í\¯ï¶ÇI!Ǿ¦t;;ž,`5´¸øÀšé´þ¾ŽP "Ëúa $€@HàõЬ„“ààÆÉ¤ê9©|NʪkEϘ§Õµâ*"Q%©`—C@¤|j‚î9aã­”UVY.N©ü~‚ 7¡£óç/þ6þæ­‘N±x«ãä42:*KX˜sb<¹輶ס!‘ÛS@/fœŸC®D'år#re\K¨Q‘º8Ž„3é=32q^•6m¾ß³ÊJ‡ôü|Õ×®=äMTdî>}uŽûš#ûW^OËN)…ë#bжÚT-óˆ!]µ¨‚gJ³sÎd?eHEvÄ0Ÿ §e çÂlHÄ èܬ; 6¥æ\ j»Ó{`È}Bî§í˜¼äšWó®Å|ÑOQ~Kúá@H $€Àë$Ðê!󬂩…ÁðPÍ?­Š«…O«žT’Ç•D$""¸‹2¯U+*€› ‚UÏÁ}`Ç!ð7P`+i *yKÜGÿ­#÷‘½“;l–‰Mœ¦&Ùq— .žÙC¦%¦]Ï<CF»õ5!â‹_rQUÉ㨋"¢×¥ÁÝl?ôÐSm“ÚQ™nœ=å+çûYu¶0E© »x˜¯GˆP®äðTý]¹r–­y¿Ìâ*+Š3B.!%!þD-ú£HDô?ê ¹£A«Œü³mO«º8m€ $€@HàuiÛZ¿æJQe ,~xþ¼–?‡U5ÏF\US]E×B<~P¡««ËçÓ0èË1GºMšÄF…™¼g‹7ì—›nÝR^®ðcGX¹ëç5Í‘8­‰™)ï5ÿk7B¦î³¦kym7fÝX[×™g¤+ªÙe°„ƒHU¦²Íºªstv¥%Š•ÚtÀ‡E°¨™*ÙzIÖPÃâæÊ'’V2'«ž=zõô5ÓÈB‡è f\;×sÏΟ֬œ¶cå¦È¬?‡u|Y’õÁ$€@H Æ€EÍ™ä”G|~¡ö=aøYõ3±†˜Gži’J -¦’'ºyµ£‘è`0úÒ‘`é‰qU °¹¤ßÙÑ B§¡/—f'D'À’‡®úDÛ|ð hMÝ\tv$dhàg¬xäµëØ©CÝŸ U½:­Mà±è¯¿n•0jlrÖìáð)®X±üÀþµ}FI0Ï ö›{$jV?O])™ úBÉî­;Ï]øc–Û|®V¯«5¸J=â·³è`Û± ½ñôýÌc—*-¿úׯ¡þ°,äÊ­GÍ>ûOÉÜDH $€hXçÐǾÿ~Õï ¥‡N–ž½^ëƒ25UÏWT>>-ò¸êA¶©©©¡!½þÁËŠ`=é‰qœ³lÈÖäËð´ùîW²´sžœæ´ î÷Yí š×uÄ"gxãÚ‹è÷ B™Œví߉ë¨â‘gáµæK’½ut¿¿g‰ÔØTÑé ¦Å…,°NÝ:oûõkfJ[ýÍòqó|¦õÙ:J%f R;‡o¶ùÛäDÏ?jm¯E_B ­7üKZôx²ÓÛ¹GŸ^=†Úô€!¼Ã^Î=º›˜ø‡^9gßè޸Ƅ@H $ðÆhjj:ºiõî"â=~F„ÕÎ÷ªdî?eV>+ZùH(ª¸~Áœ_jnnndd^jÜ*©|EÎV‰à d<=ýF\ºL½ŒXTFt$Fm³ä\ÒÕ¶[óž$þà=oÏ•mçÊÆšS#ŒHTÅÓÑÓQ»z¡JTÎðŒô”½f*Dî•›#®Ãü2¥~ZXÓgSâ'L˜ÐœžØ $€xß ¤¦¦Â/ž{yªö\e[bÂ#mø¤ èòºè´j_‘?@«x„•±••U»víâââÔjÁ—¥­¯/‰´¾„-žŽ¾¼‹µ)¾éå#×{Ó‰°  xú ¥MêžµõT¹ òW1Ü òW± Îæ@H $€^/81‚Á ;t©úÏùGgïónV<'¤#²|^6̤òow…dll¬¥Eo!¯0_¯§¯t4›’²Õ…b†áé›´{î}¥® q$€@H ×At0\ùÁÚJ¯§EµŸ’¨ºº”±žži›6m@þ¶nÝ6Ÿ?mü¾Š`ÊY§ÍG:m^p $€@HàÍ€ D€ÆÕÖÖÖÓÓƒóä`¹Ñ_È€‹ €kkk!óžF‚ßü^@@H $€Þ. ª—¾œA å5pKe6 n½ìÕ!ÞÀÌpH$€@H $Ð P½œðíË啚£V‚›H $€@ï?Áïÿ>Æ"$€@H (@¬7‘@H $€Þ(‚ßÿ}Œ3DH $€P"€"X n"$€@H ¼ÿP¿ÿûgˆ@H $ D eD0S~·° ø±XÉøÛ±)./½WRú°œy;ÜA/@H $€Þ8¦ˆ`ñÅY&ºëþFï?SÁÎ kG§–áWË_õ|*²wÈ9 ÛÙùß%CŠ|M} >}WÎÑ™Ý ;wédgÛÕκSwçéñÙ¯ÜC¹Ñ1‹@H $ð–hŠ–Láóи‘¿nß;eÓ¬á–ßÅC„µ·÷¥¸¸´Ï-Zd–W¾ž}%7¯¸J9ÏMQq'¢b¢6 ×cÛ0·RæEÓܦ_Npºòç6yzÍßJ<7È*>·Õ:{¿¿s§ø[f‘á@H $€>`MÁî.Ã=#$þ¼7€ ý>õs÷Òïë6lýï]!â“›&I‚µãçÑÈkU^Ô$“Q‘Gâ×£ÁÚYa'9u›·v+Xü]à$çQ‡²¡;¹·¼{¯Ü w´´p^˜¥*t;rèðÁƒ6ØÁ’»ïsÖ¡­„ŒïDH‚ßINæ><³iC !ŸŸøñ¬:šôt˜ñ[ܰïÿcœZm Õ˜Àk'p'ýph辌å¯gwÎFoÙ²+ãŽrùkwðÈÎæø²K©˜;é»BC§ßy…¾¾Ð4Srd_è®èô—Ì RÓ ¤(?¿è¥Qª1Þ@qYÖéô—–)ÉØ×ˆ}§îeÒ€co¶êNFRýõ›u GGH@‰@ÓE0©’|&ë[šcCÈ•ü"ñýKi©ûïUB ÓÚüóYw/§E;¦îôÝ}†U ÓHÊbO26l†‰ Zr·"sÇðé«sÜל¸Ù¿òzZvJ)Ã0÷â‡Mÿ¸¯I¿[y9n+ÉÞ꾚Fš•ÒÑSñ'O;~äØun¡/s-|eŠwÄ–u+7AË݇2à±âÎ¥4B¬MµÒ‘ôngã4²7JßÔG”Ä|z› ˆ³ü¹[+J]CèáÔ‰åfå 9³÷Òƒ¦œ¸!Ù”u/ýßsæøž(V.—5x2ìÜ}Oܬ|ɹTÞK÷ N¹ù’v^ª{åS|W§¿ìdy—²B}¤&ûìêr8KúYÞ½gÏîfç_ïñR–ÚV04å^ó']y3u Ýw÷ägJóŠÔ½L”{½5Û¥©síÛ{ž.ykBG¨G "Xfƒ×±³­tC_–±sîô×_v'”AÑÕBÙâ„Àˆk‹¿ðñž4šCßÞ8{ êWÎ÷³êl9>` ×½êÑ#ÈŒtûÔŒGÚõµg5ë]™® }Œúióæ>›¯”PA{ÿÏßc±1ªñL I[¹ç:-Ö†c‡GIâµæÖNH·ñ Ô'P}Ÿ-[~066öàÁƒ :Öo$+–€šÍÊÍoÚÝëº[ ¼BÏ” … `øÚf`°Mk]™Y.ÓûóÝ99EßüÍ6aYII4ÞɇË^Ñ79FXRR"³²ŠÍ—qy9ÏòD\–Ÿ )_A†©,”lmHç®#÷2åjò£ç‚Ê Íjô<ùôõnXÏPCÞJ}h±g>ŸN¦¶òŽT7€ÚJ‡GýÞÞö&Äܾa‰ 9r¶‡À~év‡L8›˜xÁÆ ~®„ƒHzÔæ·ÄO eé¾öÄïà¬þô(m^Òmm ¥Ñ ™%ê^&´}½cìµîw©ÇJï¶ßÄ,!±C‡o|£?OHÃg$€Th†ÖæV €Ž=4?!ζ]ë–3·þ°°îëŸ(vøÇ7'PÖ˜tîÚ¶™gJ^Pc¥R ÁÈ-UàqŒr%Ò®#7?ðÇ‘ã%GÆöñ-:þËj¨Y<º½ódˆþ²3:í®vûNÖ ˆãÒ¥gΑÇWS@+“ŽõÞliLH€#ÀJï‰Ó<ÇŒãéé9ª¿AôÒ±®®>ÑùA–µk®Oh aÒCý ÛƒšX÷l?vc+DHnôR;ˆÏíÛeŸM»ý]]]ýC%Ÿ‚âÜ¥®vsrw_ce®sokhø§T0>Èú¿Õcí@ùù¬>Ì•eïÿÂÚºÛÎLúu23|BûömùcÇšõ„ÛêÎÍeÇ+ËŠö¡4|–†¬žëã:vu®‚nFÏ•wž9½ÑÇÎØ^íãJ{jØùoŒæ‘03¼}ûö!™0"—rÃ"{Tç‰0+ÚU·mOkH= í–rn¨,$âüvè±s÷$Ò±”’8wßø‰ÁPà=hìÜh˜Jo•zÉ6‹Žl´Ópf=Pç­*ƒ%¡°·üaÏB*Û7w¬&0tõß•%³O3LÑ®¹x ;Wÿè,º$ɬ*-z5 Ö5äH>W¨j8 aeÚÂt•‡‡Ô:}vr?jŒ§ÿµé× Øé=8+¯‹Úuâ>dUº'Ìôh ÑìÕsíéQÛÓLªžÅé»–²‘ëÒ«ýǺ.Ý'™lî‘Pö„cdlÈ‘\y¸|zÄ’XBb—Ž…7UæNÒ\WÖŒ†ÆXÿPîå"Îkçºtבè4† Yé F:èØÿùqO}ËD ‡ú/•ǘºý.?P~R¨Ôá¹û$³S¹§ØõÒ¤ôÃþvvvvþ!§ïäaw¿ÝÜÐtö…¨êÝ€g1÷Ô’¹hg’ôN~xÌ#$ðhºNÈúo敬³|?®Ï6BW,X§IÕ#úq8qŒµaEF*dŸÐu¾lªb8‘ Ùìáð)äV¬X~`ÿÚ>£ƒ¸R½®å¿ýܽòÜ„ÃGa=Ãà¾m$=䞪ªeÌ­ã‹Èæ”’[%•ðW˜ ÚwÛ®øŠŽ#ƒ`µFvÐWkþ¸ý°üvvü²Qó¡×ú¯GÒ&$ÐÈÇ“N'%%©iÐϦCrräêì7,’ÿ«o0±í­“éF¼·>y°wŽ v‘ÛX!Y]z3âsS|ÂÖu·(MN ˆË¢²¶èXèºäÌ‘£&D\›.K^/¼=@·[>eb41M¹Üã(« øÚe>ra0»ao¸4"Á)9BRvz‚`bd&Y²ý Så¡åÁ‘ɱ×½8 ™¥•8ÿÓ¾óÔTÙ©ÀE‘çþe§ÿÞ}èòÈäU{c·Ïi¶h¢™/UÆ”†ILŽÍ›×‹­ªö„­LL&.±×åÀì2×­‰U¡²P¸ï«ž³Ã’~öº“uà}½Ä3´øÌ…–z¸zŽ܃§ÎÛz‰akRr¤»û¢Ì% Dz ¡T{«Ú q';ë§  XÊ.nŽÍŒ]~¶!⼟‚“[w4T­²41‰ÌML<¸$‡Môþ¥NæDÎv›íí HžíÞó0ª‡SCÛ`ÊÃC~ôªjÉÚ‹‘s=hÍÃÇ´äذ4z¨tOÌhÛ°åI®{ÃWQõŸùvÒá%¾ë2ÞÛ÷zÝ\´<,69û!=†ŠŽ,µvˆ%~{öú‘ØÙîÖsQuéNÊNØç[†t£±ŒÊ{yfSNÚ»Ê#6,à«° (¬®.ÍL^çë>q¯ÐÃEÙùûé¿sd9^?{ÝŸ†%×™”åÔp¨÷2QyŒI~]Q~½ÈŒCFœõ­[@d²`oâ©Øí«:i±ujöTui6xîæà‘'ðÈÌÌ ›=ÔÌÚý¶9 Ï Ø–#&B5ï&ܽ Y•_L0!$ðhº&[½Ü¸ž¼ãÑè•ç÷–Ÿ•^ç½É¶éì¿NìïiCRƒb.HNm“JOÉ =Á´¸Ö©[çm¿³~ÍL‰£¿$îIvŽ·í+†ç슜£`Ÿk¦§]÷ëiNb(é½ido‰Y^Ç¡s¦Ú„ÐÔ[̰ ã‘k¾L ž<ÈºÓ gÏìkNüS §Ùå]Ç<#°ÈÃm¨››ÛP”µp§Š&s]8¬¾gÄCˆr™×'yÇAsAkr/ï†ð)íYx“ÊH.ùm?[{ùrè4ç ‹ü ä§ý AËöx¿Øá¦¼î–C¡a7K‹n¦²ß%ü¶_¸|èPØ*jî°š†3%ÿ¸$¡páäißÀ+©ªfr"A>¸¬:µÖßÓÿ‡-¬’_D»ÚŽžr'yy$Ä$³@Œ×{îx«¬Xª;\6œ]6yŒÿáT’Gî¸TFÛ72)yÂ]ާ= Ÿ=,¸Cèr€Ì+…bU…Œ8ï@$Ô{GnY8ÙÿÇ ¯igYâ™Ñ‚Á IDATš:•ÎÑ}ú‚ižýsïíÍ”¥^î0±ÛkGQ]&MJÞª™>ïoã€Dæ© wJ.žá´ybFQYvj2ŒÔMjŒ}6èq9âŸCl­Ý=éÁ‘&·¢ÛûÔƒËI K ‚ħ©NÁžü†ÊÃC¾º<÷KßtïBê“§M„£ܾ)&ÿ G4Ùö“ÿdÿ_2·K l_ù-á›&š¼%’–©;Äa[x/ 0J~î3èï(bÞ +«AÃÜ¡ÒþeÉcCáåCÑ?}l¹ðk|ÃÙÅAehF%¥—‰Ê‘šQÚïÒbö¹úéú|[HŒ\ü—-ô´‚ õ{Š~U…/­I¿…³/³U …I‡¸¼ði5Qÿn@¿N¼Ò毘¦ý1!$ðªÈR¼h ~!%•!Š­*Þ­02(-¹Åí`¡¾Í÷)Â"±ž>¨Ræëub=#}™q«d×Ïê‹_o}Áe˪;¸þ|ñkcÞ“Äèí+#ãv–+DbÂÓÑÓQvO¯w)ΊíG¤¹Ïþ÷ü­ÿ•ä‡ùm+œú¯Ç""~p.b}ж á݃ˆµôÿýë3©(çZâ#'àrêÁ±!Æ>Mé!h<à?ˆ÷E&üùýí„ÙúrëÆ»¥M?3ÃÂ$µùu‡kÇÞ\©Å/–¼.îÈÐ+Ë Ÿû)4ª$Ul-û)éMú;ö‚lë6Ô¬ºÔ­}[…*vq‘a{=Z!k…:é†é`úƆý~dÜÝ€X¾ýuH;~i9·8©íÇð¹›üç_e}[K{A˜’×m+æ”<©,-9V&:ÀÏã4eÞ|TVúPEaá#ÚÂí;+ÿù†ª½®f=dCž:­úÞdÌU÷»"—D0Ǫ}]Í)y«Ö ýpYêØÇ•ÑÄ{‰wæºÈ”îù;‰Ë76JC ³V{–Ã7 iªû^îáÖׄ–vÿØ ón<$mèf}ÿÕÑ®VuxPªRÕ¶TáPyÚ{½9÷½ ö²Ä¦‹  ýêÂýÀ•±ï.ýÌéÒé>€# –kU÷X’¾ËËÁWI]•‡»;|‡Ê9Éî^  5.W\×…-ñËDå'SœÊû]Þ¼ÝÊ-~ɳÃÜ„¬ŠÍY6ÆJÝáN@ü{xþÃ&ÁÚðþlgò|7óH ¼Uš VðÿF̘>L¼àbdža.æìÇá± šñÚP¬&‰ïGz¹ë×Ãζï¼=W¼7ø‡¤;íê+`5†^PÌÓ1j÷‘‘YïOï9õâùðíû~^Œ øÐ>øj3#cáÑÄ¢Ðq›¾2‹†ö„Õ¼sæxÈ‘`Ib­4ù÷¯Ós¦•04qœA¿â»»Ï&ḋ•°ûEå’6ìS]ùRÅ|•åu©ºŠ† Ÿ< çŽ2·¯EÖÕÈç > XÛ‹Ü݃‰Ëw¾ƒØ:úùmÞшÍ3O¨’(ZÂþÒrþp"[«úAÉó~4ìIürª¥8"&wRUhÒ¡ mYð×#Úž)øë6}V“´ù¬2cÕ†Zoåúz¬Úá×Ì`ђŸ\¥’·œ|QaÐÄÂæ™ë|}ƒ3·Ìõ÷…oXÀ”å™ÞSe{œ3˜µo(à%sjkŸp¡A™œ$Oª8eYr“NÍAÐEípœ­ú´U\[i )Iß@U§G¿lÈ=Nèq.²æXœÉžÍ˜—ñ§l ®<Ÿ.1&̃ÜXxz"½4×È £½ ¹ aÌPÀ. …Õµ•h´Tî÷:øÙ‚k$}dØ^™±×”—<––+>«â ô2QyàÉ^‡õö»¼}!³B«]Ý2J—{,Π¯‰_u“ªTîªÞ XнÚÁ+»STô&.`'?gÌ#$ DàeE°íôÓ—³®¥gþìÃÆ;”ì«ßÔ± ))»šS|!ëÆåáú/«•Ëêm4µ¦Mg›Æõ”,hjolÿA`Ã;‘¿þ´kß.H’˾ÛF?*iòø§ ˆíx_™ëÜü7î;}:i×j8›ˆíÊ6’{ÐỊÛÜðígÜdzA—nlßÐ#éôŠÍMÖ£¨ØH^>t¬¿?¿çDÖŒLÔ5ìIÛÑé¡lÒzÔtØŒ½l_Fnú®U³AH ¦Ø›ò€ýiãÒ¹®C©Õ¬)åc›©tŒ0/ßÕ‡OŸ>²/Äi´Pe¡©4¥9wãÆ¹ö먈S‘Ø8dÔ¯»Ó³Šz©ó¶~·.ÎpY(ž8^v"cýVj§OLœ§p¨<œzw³àÀõuÒ«žʹôÎ_Iû‚}©<,ȼL £G@rÀ’]II!4P,noªv85´_xx¤îƒCsãRŸöÄ„E»«áW ŤÞ=®]µ$ŒYM ½è” àïï*˜"ý]ÊÙ)¾kÂ2ò³vnÜm<¼\Ç16Å…$ÿtž.ˆæŽãÒ¢œS»–Ì$± ÒSI¹!å{»Ð¯B³çÏ ]ÚÞm‘|,ÿB´¥ÊcLf¢Œ87duèŸ÷yvNôx$¤\Eíž’³ÃE§¹Y^Ý»AÙådx-ç¨C„îÝ»ww¿¬òMBÎ>f‘x^Vâ…v»šu4i–„Õió‘I‡ŽÚ©¿N8€69<ÛwŠ/¤ßŸØË¾ò,|ØÕ«‚%ö\ ×z HØ¢)C‡ºù._Ç­-àÊ/0që ¥‚UÞCX y“a«é‚ÑØw¿¿¤¿ÝÊwÑfWaHMÕEí”Úðºy&n§†Âή gýsq¢?v+%ƒþK@u“Eø×)¯Û˜Û§Â]Hì{kß`Ǫ 'æs½?¥ 3#×÷ gµ»šeCJž€™‘³ÅÏ%Në:Ô}Êì°Rࡪg±ôB8 ’¼hÑå϶,¡ L~¾œïÖŸú´äàAT¥o•fI7«ž“ÌpX‡9±çª"N˜Ñ dÝûŒ¥nú` ÷pwjÇ{l/b"J•š`Õ` î7.ZÃ¥^£¨X›íá¶áÖ:…L_¿è2îàqñ~ø£›½ÛlX ²!!ÆÕ„¨N-mU‡‡tdú¹n6š‹ÖE <üž- lËÕÊV4ä×”Ïï@3­ùÄÖ?WŸ_0Ôº{w{_º<>a¡üö£öH«{Q± $vØ<[¥úÝ $bÉlBæ|9Ü:šÃƒ îÅ,±OH ¼IpE…79>ŽMàlJü„ Ýüõ4„ ’ AVéÔé,Å‘KNol?tÑœØÂÇв,‰…°H’oÀ.…—61#ÎH:ßÚÊÊÌ€wûL„5]q±ýÉ!ÿºOlÎÜDWæþäÐ4Å*ÖeèŒøÆõä7Ê5°o(ººº:’•$´—ŠBF\&¬Ô56VV— ƒ(y¢Ò[…MÜxIƒâ²²jcºß…eeŠÄØ£B×XqߪNiŽu3`[7îð`Ä%Bž ùslÛ¡p1‡œÊPvÑMîÕBsÂü¤KO­¬:ð*þà=q]²ßÞœÐÉV\#F,¬„eê):¼´»Çºí™Oüm ØÆlS˜V%ͨ{Q°Æ9J/hÕHЬþÇMAý#õnñ¤¼£èÛàœÕZdg$}7ÈÝçc=%roΓÉVŠ/;µÝ± —%––¦¥¥¥­­ Cð 6ù|>,nÔÔÔd/^©QSS7gƒÕà{ÔË:ƒý‘À{O€g`¬ø±ÒŒ…_ ]¡Eÿ¿+(`h¥órú—Gï6η“&ÁÞÕ“ê}ÞŠ£g àGnˆ¹Ö«Ré‹f$Lå³J‹* y:/ÀÔº’'*̨ô¡Ñ…/i°n õŽ%Ï9T§²%m¯²µê©U^nßV²rÃeƒ·ô™ ¸§`FXxÂm(]V!I.«N’(`(á½ÈncÖæÄv»ÂF8ëôêmÒdÏjç.k™/iÛÈfò–ÕO®Yƨi…ñõ콂 X‘9n!·‹F‚ß®ýÞ4@à­Œ7à/[%¼“[ø„ß®ƒ…iƒZùEfÔÕ‹ËîäÜ,)¯ |#ÛýMTDV™;ùןTëv·ê¦¢R],—ˆó3.=(ã›YbË^³·iÎ3pÎÖ_ùw**ªõÌ,ì›c¡iãak$€À+"€‘àWÍ"f00µ²¥+_QÒ16µ5nØ>ÏÔªá¯È74ûºèXô—ïjnâ›Z 2} Íû!$€Þ,—>1îͺ£#$€@H ¦@ÜtfØ $€@Hà'€"øßè>@H $€@Ó  n:3ì@H $ðŽhÆ%Ò˜ûùBF·K¯®Ò«›‹ ónK/K¯kbÞµ X­(¹^ôH×´›™QsOIßy¡Xܦß?¾š0°޾ã»ÝGH $€xUš ~˜d?°ï0GËØmT¶hv!¡ë+×ónÜ(j¶ ìˆ@H $ðîhª.>4kÿøaN$'xO®4 ó70h£Í3êgד²Ðnèé]{ ôíy „¤Î´0ÑÌÕkwb½ò½ó€ïâv~«ÛyÜÐÖ…IÿžÄƘG|ýïBVÜ^ÿ}açq ã“"Øò;OÃPyñ“:™89æØÇÞ:챊ѩG˜@H $€ÞcMÁ™qÛˆï ï/ Ù(í® MqfJü¿JÆe¥°¬N1S|ëÒų¬Ûü!Σt%¤<ò›¾+ö˜F]¼µÂ|…—×™‡úCƒ{Ò{ATâySq½`±úfö•AÓ~#ËÖ{[Wdîpòšßq͉ çb£ç;m9 -ÑC’ºÕß+nLÈ&GreÅwqIñVGÏ4b³ùÈ»%.úè©]Ñ]ÜBH $€xï4I3iæb^tþ g!mÛÏ­ÖÕ#$gÏ|ÿ€ýž ÂSŠ?3W{2ml(‚?ìý³GH $€ÀIEð¹ÛqÒH $€ø°  þ°÷?Î $€@$·[3wïÞákÄãvDÆ«z­Þ‹â¿5⻨Š×:(†@H wŒ@SD°øâ,ÝÎ&ºë“¤ªôÞ±I´dz–èÕL[|ï—ù3ƒÿ¼ùj¬¿j«LƦ™‹§Ÿ¿êqí—]Mɹ*d q $€@H@ž@SD°´ß¶]'¸@cnòoi´Pú$ò¤¬fË@Ö 1ÖâKFfÊ ³¯äfßx,oæ]¹žwãþCê#*/}XÎIÀŠò’Òru¾IL6íI|…~ ·C]p·*/¾$L »ÂšÕ÷Œº–š5¥MÓÆhfk¦¼87ûZ©¨RË€Zà5Ó vCH $€ÀA 9"˜$ì½ôèÜMÞ¾Ÿ…¤Ï>ŠÎ„- ‹·•\‘ 5qî]td‹ªnÅÉÖ² â³}T><΋ŸåLí|¹hC !¬¨#yLêÔÉÉyÀpç>}º 8”]}+òâ'u2qr0̱½uØÌÙ÷O;ëldZô›GW;ÝPxý÷…Ç-<ðûæÔQÎ^Œß4‰º:us!«§+ Ž}?ŽŽØÙ9ðdÕÍUyQ“LFE‰_Ï–Ï ; Â77j3øCRgZ˜æŠÅ'9#Ðk\àñ<ðG»ÚêÓ‚tþ$ˆâ¼,¼ö²3Û¿œ]wÄÔ…gÔÝeI1ºÚaÒw;Žï_Îy{æÀãìˆî½,‡;÷µ3ï:/AŠLf3H $€@Šš&‚AÚÎX4“”¸?‹™[§Öd;úæ"ÁY»§{m]w55fMäJ­§ïêuu˜A³Y•æÖU‡Të9µ 8|‘säJÏÔ[j~±_Yæè“=:4ñÒtËÖRo‹·:NN#££²„…9'Æ“+Îk (ôL#6›Ü(¼[rá¢!|mCB̹8¨A7BÚjCž=$©[çÜø*d™5I™7Úqw•óJg’”øW9›5Ðc‡Á¦ÔœKAmwz ¹]ª…i$e±'6ÉÄ­Ï‘.Ž#­Á¡Þ3#çuÑaZ›~"ëîå´hÇÔ¾»Ï0D¿ÿD€C¬§nMtÕ&DKêÀ?ëë5 éçì¶z œ~±\õÒù²Ïªˆ•§¤…Îô=@6¯™I²wn9”ßF¿ñíz®¤0'ź Ìà@H $€€¦‰`W=]<ç÷&‘ÿ‰þ¿ß‰ÿÌ‘ýÚ³E—ã “–˜˜N$^¾Iô»÷v‡¬¹c¿vúlFÈçÏȧ‘lHJCp…Ü£*bD‹Ö-HÿcÕ¤éSGB̶Å÷ndœ)ÃÌõy úS8˜@H $€"Ð4L-ö5}4‰ ܲrò`còTÞ|¯Ý-l&DFÅ®iåÏêê˜ãß=¹ÊÊi´'Ó@Uêû寅¬º¿~l$é¡Í®fªAYÔQµWø¤^Hù Cåð£°0 .ª 1ë­DiIMµÔ×ßɪg^nþ±‘Qÿ¶Ð‘tëܵ-äÙ4X`­ô`nýaaÝ×?Qìð1nNЊ 9WJmJ (-È…Òg©XÓû¨S‡Žuz:DÏ”F[þºýø…3?û9…Fô;;‚ÐL=x¡¸4;!Ômo‡®ØÂÔù?ì?sÿ^qÖ…k @Ye›’ÿÇÏ_[nƒŽr š°bTµœr¤¶õºZ;ÂÓ£Güv¶l;¶! Ûʪd9ÚÖtBEýu«¤âÑÈNcmX‘‘ Ù'‚g@Ç+λz[á„<ý:Cô÷·ø‹å׎'ÀBj 3n!u½! ¿$©&&­•;÷M§)”¦Îüù÷c‡Öüs8#?뺘CH $€hš¦â taG÷„˜è¨Ä 3Ø"1×Ï/,|Åç‘Aö½:Ù°íü}ÐŒ·X¿;ÊrÏe2ØÖ°þ0ܺGbUw¹k¾‹Q}nÜGön§«]}G Ï,£ò”ÆmM¾ O›ï~eñ(K;çÉiN â~ŸÕNRHvÌnoké>ïh×®NtÁæ€Éÿíä.™$ˆhiŽë†IGj‘KÚp£Á¿¤E';½{ôéÕcø¨M¤"XÚNÚgáµæK’½ut¿¿ßèà<£7Ù6}€ý׉ý=mHjPÌ…rmó¡ë=mrB§ êEÏÒ£‰Õ£#BçŒÞàhÙ«ïšçÍGëÈÆm¹ÉÑvÒ!hžKFj‰I5.Ì… jwý:q;k? +˜1!$€@H 4L@ãVIeÃ-šTˈE°V€§£Op‰Wˆ‰¶¾@Ø¸Š§á^6££GËT'°SÁðÚèK×%H[U‰D`^O±œ+䆠 Ñc±Š¾Rêž™ \iAÙxýÖtŽÐL|£]ôôA¿2ËÅzFúÜ|À@ ]ovm}I³ú–ë—4žaÄEL£úbº¾ÕwµälJü„ ÞUïÑo$€@HàUHKKÓÒÒÒÖÖÖÕÕ…GH°Éçóy<ž¦¦¦›jjj6EEE©•¡Ís䯲EžŽžT˜ñ¤úO–Q7 ØQyy]PÒèl]WåBž~éˆu^œùÛ¨nrs”uáÉ«OðGåhrUÖ«(”’eT4âŠx:m¤ ªÕ¶Á $€@H –@Ó–C 4$€@H $ð@üìDœ@H $€@Ó n/l@H $ðhI\õðfaÁMz ²æ¦ûâ#vÅߦÛg‰8wŽf1!$€@H %Ð’"øêî~|õ%Tðƒ !K„ܧW(c.¯ó›·é<\¯@H $€hYMÁÌã‡%p½3¦¼87óÊ}ö.¥·®åæsñZ ¯ó1GÎ[Ö¿|C£]ækÁ%p ¸;«iu#¤mÝ•Öm"$€@H hŠe|eÝÕrä(÷^–ÃÝØ›OÿyÓt»~}‡;ZþcÓ§äâ ÕîÖ@V|n÷òI&ºéßô\6œ[uëLð×£ØÝYû¯@£Š‚cßcÛ8ž,`5µ*o«nÅ)1¥»x[<{ Qüw£&}·ãøþåÔ sà™[⪼(qñsÛ&øö\M¡Š(–!$€@HàC'ÐÌãw\Ù)_9>î¼M¦MBZ‚7!9g.6eJ³sÎd?…Å ÷NŸÿCšûÖô‚âqÆÐKtqA¿á›¢K×Ǥ8’0þcC":7k ÇƒM©9—‚Úîôr_ݾ¨ÖsþjAqø"çÈ•ž©·èj‰²â”´Ð™¾Èæ5ôör[åh›÷íAHäüס¾üdÐʸÏ&:½DTZ7XŽ@H $ðÎhІØ-!ŽkÒ&ÙÛ˜w6…©¯_üm/‡þôîÄuëèb}“‘ð˜0sÃúˆÒvætHe˜.Ö IDATEñ…BF® óÒÏÊ~Ø0û®Å™Gi›”„øE!©‰k›;XòóömÙš˜Y íî=¢í´h—鬚4}*ŒeÛ?%0Ê·[ˆH $€@H@‰@“E0'7•¬(m2÷.¿X="pãϿ΄ª¼›OôÚ[;r4hÝ¡ÌâÒ{7róJôºÒòè¿í@ÛŽmUÔ*’¨ø*!½Œr¶}Z õÏ+º •ÄPÅëì¼tr6,8^àãÚI…1,BH $€@„4MëA$˜[f«Õè°”®LàâÃÄCZSù—ïø–&ºÃ¦o%îËxØÿœ¸k$‰ t³´³í33ù1üKZôx²ÓÛ¹GŸ^=†Úô€Š`‰ÎkÖh°7¬úýa¸uĪîÖèý.†=7N6(©óŠè»}³ úÎøuš™Ä>!$€@H e·J*•ËZf›©‰ÂÓÓ—_åÀTˆÄ„§£§#‹ß²%ÊÍ”=`D¢*ž¾ža3òÝ•ZŠ7Ä7tÐÉ»ÛzÊFPj‚›ï,³)ñ&LxgÝGÇ‘@H WH --MKKK[[[WW!Á&ŸÏçñxšššlª©©aØõê¤"O[_¿ÞÅ@ë+ξ~‰b=»ÅÓ×ç•eT4"¤ôìfßÐ+ã·G¢VÉ ‘@H $€8¯N¿ÂmúκV0 Ä÷‡DH $€xw¼W"˜§# ¿;üÑS$€@H 7@ i'ƽqH$€@H $ÐÒP·4Q´‡@H $ðÖ@üÖï"t $€@H ¥  ni¢h $€@Hà­'€"ø­ßEè @H $€@K@ÜÒDÑ@H $€À[OEð[¿‹ÐA$€@H –&€"¸¥‰¢=$€@H ·ž@Óo–!.É:±¸¼B‹¯×ÆÄÔ¢M;ÞÝc‘ñÕ¶Ÿ}fßé­Ÿ/:ˆ@H $€HÓDðý³;¼GÏÌ‘ãxäîb«û¿,˜Y¾\€"X f‘@H $€Þ^MYQ~n&UÀ6ëã®Ý*©¼U"¼šuÕÇB„´!FÚZ->KFT^úPDs;ïZ©˜iqûh $€@HàÃ$Ð\xzO!#WüÛÛ¡+ ‹×¦c3#¥X²èÜþå#Lt;›èŽ˜ºðLHXBÄÅÖL‡ú÷uD[tn÷òI\‰Éô\1ÝÁSÙ&º“¾Ý|í—³ïŸvÖ&³¾þdcßð#Ð~ñî‹ìÐäܶI#¾ý£ŠÛÀG$€ÞF,M-û õUÙ}ˆpH$€x{ 4A‹=€y¸¸ön`6Y»§Ÿõƒõš„ôs ö [½N¿XNî§í˜¼äšWó®Å|Ѫæ{§ÆÏÿ!Í}kzAñ‰¸c(aH¯‰ òJNF,KÛ™Z e|mSxŒ¹7.&ñüçNƒz9çuø¼-?´2NÚP ¼bÂ’;¹YééY4åæÝ)){¿L”>}ø0}HÊmYÝÙ „Y¡žºÒôS†°TwgÔÙý4´åìª K‘@Hàƒ%Ð\ÍÆ]«*%¾ÙÙ=ÍÆl%üD—ãýÕÔafæÃf„|NH\F~¹þG4r|4hõ‘¶íiE•«¾ÉHxL˜¹a}Di;ó:„èôp°â ‰<~ j²‹Ká‘0î¾t ÀÆì£Þ^kF²óøå’ÜØõ9d™ƒ ÛÀ+" ÎJÚåãªaØÞÌZ`ïà`o/ Éºgw³ömuùvv>‡óáWŒ×•„­ð˜8ÑÃ>Ì=ö¨CX%K-©ÉëìÊìc $€@ h‚noÝ_±ã(·Gè³QñáÇWtRO0ãÚ¹„ Ã+§ ³þää=†è÷ÛYpiÛŠ™9¡A^Ž]×'ß>²ÐÎqx²¸ËßÇŽv$t‘±4êJ\Øþý (\3ïïÃç§Fù¶“¶Àg$ÐâÄwÒçºê Ü|#“ÕÚÎÌŒ,|\©¶ºå+øuš°Ý‡ñ+È“–‡ˆ‘@H pš ‚;|⢧ù¬‰¸~¯äæ=º:B1é<Т¿¿Å_¬(¿v±øÄÓkBÿn2¡Ìe]8Ÿœ!ë›Ô»üY±<¤›AõÐI˜‘t¾œv~FŒ¬‡öï&}õÊ•ëY»êÆ”äß“’_Ùº5ikå2õ‹1Ýä<7ºøNVLô¡óÚ¶Õ%ml>óßß´2ýHz…–˜7 °5•¹Íõhø|ar“ì‰;Ͼ´uñ™:¦·ú}JrOÇNøó.±hKòo‘O>óœ0¦ãFRžfY~zlü±Ë•º¤R×jðäÉž3Tß+,AH €\ñ÷]™véÙµv£Wß~)d‚å»â3úÙ‚ΦÄO˜0¡ ª2%Ü5ÖÐ7VV³¤°v­ )'«—Ë”¤ïòrðUXCÁÖ.9˜¹ÖÓ–Í Cì gË)lYï g-Äk°Ö˜Ó] $ö[]žE/«I¾Üc{Îêv^…H6!ÞgE ’´¦=r¯¶öXNsrÉE@’¥¾ 6œ½¼°žÄ—k Ù¬PA@$W~!G?Âkb°´?[ê±åì¡YrF˜;ûxOQ\eB –dž\k+sOœá£k/±ë²ýI’¿DÙ*LsK¤{îSÖq£K{3ON®3$-Æg$€ø0¤¥¥iiiikkõ‹àlòù|§©©©Á¦šš†MÿÏÞ™€5quÿò˜‚-¨€¸– P uA¶B­†º¾ XQ h-‹+¢_¥JµV}-P-TEj°\‹P JP@5¸ ¢$˜øõ»3Ù&! XwÏ}trç.çžû»3äÌÉ™™””¹/éu Ó{Dà¥ê@ì`~”_O’;—•0 >°°«pÞf—PsŽœÉbäÞY3®Ó‡™¨ÝLª&HZK§+£€,)1ÁÔr^€ E¹®óz/ñ6wéÙ^—©ÁÆ-0Î[êt®\°üÓ×ÑFžU~ò‚üÒgM5• ó±YPûKܜɚÐçNÉŠNá'&ʧÏBˆä¡aš|/Öô÷²Ç)ìi¥.@  N 7Æ©w}áû4=]yˆÅ |;´Þ-£LÔz˜ e¯ã¬¤j#ÅN*ÿóOMn´¢Cøiä͘¾'EÂå¬à¤JAMeeÍb6Ü:¯Ut"3Mª»ê{¬°èè`åý{•\–?R­ö{Š˜V$h·ÞÉMV—Ñý}–wXô&?J?~ÍuÙ°U©ß+-`<èÖZk¢½åmù¡i¥råe~*ÜÍ,ï褄0ÙíÒæ9?ìUF›t(*€@ ô:Á°^@๠÷¶ìþµìß)Šßïç:`ç§ù¸ÀŒ`ì´$/å|#‘a›ÚS:—-­í¬LÍ­¬Ì™¤·´óZ©¤.lý î”l ÜÆËUÚ‡9ÙÕ¤‘ÙXÈSªŠØY'6:˜2i:Æãæo+ؤlÞ…QÔ›ø%•ìݸ"Ž*'»°šh'©Ú1S9lRÚzc¤c¸‰'„R2¨WêÂ5ìû%Ü)Ù8wþÆC÷Æ4ö:K’ÖЊ€@P €L¥y ðð.…6]CT@mq^f6‘23ójI˲é&iêÉ; êj«ªðkåj)O6É9W-³ÍTžѦ²‡¨ì·«•ÐÉ';Cð?'i`]·ý}bÕ…ÙÊÎ~K\(!½z·o®lÛy޽>+n¾ƒ´9’*€bBµ †G ±9™ÒËEA§VXMÜ|¹îÓC”Nw”sZjîwÚ*@ i¸€@€$ FÔ_åÛÄØ(U{°‚ç뢸¹¼¡YO}dvüL ÙÐ^Rμ1²\Í£Óõû**8ÞÕù?Ûs”BlûŒäö ªìŲhßéwç‘¥¹!EsÈXìÄæÉJ¨ HiY €ªÀ¬ÊöÞrŒÞ¶Å¥Êž,«O ˜ ïk½¥bãµïA”<Åk54 ê¼´‰xc'©—^/J­Šß™RÞíl›¸ýËm”BZ›n*âx•¥j¹jüXÅ.§&Õ–t:Õ‰ýÌf¥:ì €ÀFàYy‚Þ0,0·•ÍÄœâTŒ÷Š[1k›ÕΦm•›y~ß·Š©b±X¿/¾õM=5ujw^«.«kû”>Ùê;÷©Þ‘OZú,òÌ!£pÔ.W.*‰/øÈH5ð¢ëk$ïÒù§äö%…p„úö¢¢ï¼'Ô €À[Là _ïo1˜úÛI€9% ,€§xmÔ‘SŽ­q}ÒyBù þÊUºÁ Ó®t9÷•A±íqw^Û¾}×J”>S~xJé×®vd¸‡¨*=,üyÁX1 tã>ÝØNÐÛ5¥Õ[ékS ÝÚ?+°,ÔX”u@  $áJ˜€©»ÿz ˆœp7Gÿ¸ªFÅoõ J¥,k7%@ñ””:;"µ^Ñœh"ª--­£š ee²Ûå%ÔLçµÔ–]ÎÛ¸cG·"ų>Y•]\šÁÌÉQ?óŒ+0LI(Ôå‹ÔÒzê ¢ÆÚÒŠ:jÉò¼mñyµ²6…ÿõRFasfRšùOÕ@ ðV#ø­^~˜¼&æÁåIÔr~|À`CºOÈæÄÄĸ˜È=ò;°”mLÝw¬W>•7'|¦ Ý>$bóæÍ!þžöZ ‹+7wéH[Ù‘0Á3dsĪÄ<™ Øy­²ãÓæh擨fpN¤›#ËÍ7œ%³Qå¦*EǧŠÚæ²M.—óf²Lì1P hUˆ§«=ÃЂ5;µ³ëª0"Ïr±põßœœãièL‰…`NsPo û@ 4xÒϼšú<¹Lró÷ˆØnòdÇwŸÜZWŒÓznS¥áòÁJ#i ¥[ê[“’to¢—ò½Áü(ÕèÅ+Øtì8±l ÷»òyQ|boš1œ)Úy-Õ›Lõ5k.W}Ò…üv1æü„‚3†ÎÔ©áqù|¶7§Ë“ED¸Ž¢>ÃnìSÕ‘w3v=Y”4ÁÑKrÁç*aŒä-Uc'¨ÓT¶ s9ñ¡9ªÓXŸñ“ë¿‹³Pv@à &ÐO°è\ 1£¿ü_à–ß:Óvû§¯¿ŠÊ¿ÞQ=”WœÓÊ=‚ÑT·©ªÎ,6'ø=#Et„ñÜm%•¹IÞJ°²9n9TÙÒÀŸW¬"X¿·¢q'µtåãÍô)¯MF”3zQžcA¹]ÌÀ)®µ&i½ŸÜ5ËòŽæß;ößYòB—NŒO™ªtmåƒ&´éÊËé^Lå°}ßQ¶1p˜[ÒT‰ÇULU™a±ý<ß“£ì`:ÊÖ±Ãx6QÕEˆ“T$XãnEmy €кQßÚIµJ•èÜ£¯ùoÿï$£ã[çî:V¾¶ØY“ã¥íü‚þ 7œ9à7BEÂKÙ]0*mìöªß=ãßx_ÊtÞâA N™>}ú  ©¯­¼z­®QŒ tu!zŸÞ½Œ MŒ ”vŸªNÂúº; MˆN§Ñh½ôõ™LMMEõ‚Û ¸C_ƒ´ÎkUìæžD"B´v*ÕEØ›)œ×äó»vs_7'š‹„u‚;Mb’£ˆÙ…{ÙDÅ> G™3žÛší¯#!ä´J°[ßÌÊ´ "žBW耯 üüüž={jkk3 ¼Å ïÒɯã=zh‘éñãÇ2¥¤¤tÇLB8dܘqŸ…,ûïÕÖ“¿{6_ÚýxÔîì«ê¨Ú×J®FÍ“y”gýßÖJòµZ‚‚½ãe…ûËÈ¢ö)¢Û®¤Ì2vçfùî3¢W`üIòù¨Íí ÿˆôU4oÅŸÕ„œŠ”­iøãôWVÆK+D¨¥úØÉ.ýÇ/=I6@¢kû7,y¸ïm¡ŒY €ÍØÜÚiœ«»««““Ó8';k+ÓŽ-`L ¿ýØÊÚÚ ¿ ÙÜÜØ@³Œ›éK›i”Öyí¿Y!'ƒ®µ*&9¯´ª¾Q( kK³#<•0BÞã‡>7 ˜˜9ÓÔJNO¾+p» Ñ4&ñÎi+Œ,àv€  žD ÛFðµçÏü¹õ{„ÆO5¡ûÜ%#Öî1M9w5e­åÚÙ³ÿ¤¾vVc­ ™™Qt¥þäÞ5ù{VsO_CèæÞ)~ie —Þ,Ì:Á2Ä~³ÎÅ"‰X˜N­ô™<ãEi«¿Ã–sé/ ¦~o³!£ð¯ ÇŒí³?Xpî>0z’ ¦`û7kÙÉ_pv1·œ.?¿Úp·÷1·º¿kYÔ¾IN\¼r)íó‘š|vO¢õ@à5"@'~‰ òra 61Ôg0ô-Xná”»ý¼V;=Oø5Bª €ÀL {F°.BåQó§L™Ë=–þuL?j¾œ“ùìËû#íluBøµ”'ðk¬ÕälM?Îá?{–]áŌþcqv÷ŠuÏ>xgp?'ˆ•/ÈÒ½—V~îã=k þ=«R’u¡)_Ì›`f9aQÌ„WÝ×0œ0‚Íí>d B×øGq>ãTÆ‘µ„ßj›‘Þ;Ø”GGWGlãž1l !Ho.‘Ê[žÕç›ûÓ|kõÒWa_,(ÔhèÎëå½ €@€B {~O*0iËù¸Ievs·lúyÎoËú"éCëÇ<Ä`à2îäeýÍõ(ò5Ô 2W8ùlŸïï9 lÏaò¡ž}¼»9ôàÏq1«—NÛ¾4˜W$ 5îH¬l„þ qNòˆ2 ’)¤,’ˆÉò[Sz·ÏXëÁƒ† öç¹ÕÇJé²]úkðžÝ;7¬›¿kÝné™ Ø¸‡ÞPÆ®_ Ê?Î/(,.¹XVr_¹644Y:»{NžÎùĪÃPç—ƒ1(86Ú“{¡wœäwѽl­`| €xm tÛÚ¶=¤õûìð†)SV¯þj‹ÃþåÃGEGO7‘é$çþu—EÔûÊõú·¯½w ?%é½iœ‰úU ù~ô@"¹yúÄU›I1–žÌ-¿t»ModûŽ8Ps›„z»ÞÐÆ£ŒÃ¿9÷µ[¯ãûð(VfzH§aP×^¾|£Þn Íh„òïÝ£Ù´C7«®c·ËŽUÒì¾øöçˆíwáÆ=êGµãÕÆ„] ðºÐ1µvšÿ½^ó Oõ|½Tm@àU&Ðíp&.0rÁwKmQþ& нgWÏ@kg>äݱãÇÿ}‡0L±Éì‰?Û×ëkƒ.øôÕqÑ4,dÝw¥š2}&:Z2‡a M‰[9EWSÇöå¡ 2›õƒ¥{ã‚§ì =lȈ ã·f¦>]šÕì QÙö)#?)¥ù)?uÚí=~Ðð!ƒ&ºoÁÊ ¯¤Ï?ÈÂØ[À“‚“§Ø‚Üž4” €@à"ÐG¤u:ñ¶æflüjëé©{kÉ^êµQ‹éêé Is‹ˆFdj5c¿¬šõŽê ­”ˆšq胚¢Ñtu¤Q’´4‹°_Y:.Ñ‹ÐG‚¥ÛîÁQ]š¼ /éi/hv0 @ ðot÷iMÖ§Qr¿¬†îêµØÜ”ú[iz² 6 u4HPï¨A¶zMGƒ!®ZˆÍ_Uw¯Bua°ÿvˆùQõdo×ìa¶@ ž#ÀÅšÞ—ô|‚ègf?a¨¯Wíü|˜Ž@ ^KÝ‹ ~-§J €@U`«ò€= €@·€ÁoÁ"Ã@ T €¬Êö€@ Þ`¿‹ S@ €P%F°*Ø@ €x €ü,2L €@@•Áª<` €@à- Fð[°È0E €@UÏÆ–Ü¿YS}íHUöóØk«¯¹RÕÐ&y²;•)*ÍÜ»ÿð_m6‚J €@ׂ@wŒ`ѹ@cFå?÷¨}¶³,Ý5hìÃ.ÞÞsn¹°kìè÷ö^>ïÚÉ—”Dú-ÛröØù톆 €@gL ;F°lè9q‡OpÞ>ÍöÔ–À‰Ã¾9‚½²¶ÞçΟ3¬Ï3Ñû•+Ë.T\¹ÖÞíªmå~øÔL+fGUî[ŠÍôÝe«’æû w›’®\juãÜÓ!CmZGC9@ €ÀëC ûF°{¢ó˜ SÅ9ëç÷ßÓ·$7όܴýï›Ø¸Ü2Kæ-þléñ+„o¸íJÊ,cwnæ‘ï>#Éñ'¥ÖmÅá~åQ+¿Y:k¼û¡2ÜU·2hÂøQG³¿¢TÕ¹ü¸þï+6Ÿ­'lÜʃ+ú¶âHöÞY¤Ýy×è\Làn\µv¼ÁÊ}p¦&ûd-ã£Åÿ«!Ä£òäÿØÛ.þÐiôˆ½›5Á ß8²Pîð^¹ãÈ¢%‰®íß°@6ÇÅ{¥¾pJ5d@ ^uÝ7‚‘< WÏÚ=ø=„.TÝiÝ>Ÿzß­VìX•ô²œs¢ôfI~êèÓ»}ù“( óÑ©•>3gü¢±(mõwØÜmá ¢ÜcÉs\‡ÖÊü²S ‰äÖ‘ ¾G o¶–ގʶ{DžfE’ˆŽ•ihãIó]tz»ÿìÃSc¶ŒFÖ~søÎIþX%ä½…ð‘Åþ®±³—÷Ûp¢è/žAêò±Ñ'q]ÛoÓn}––uv¦•ž!¸Z¬;-íìÅêk ¡ã¹ëfœ¾AUÝÎßµ,jߤ '.^¹”öùHð c`€@ ðzx #X1AZ¿þvò=EÆ~¼mÕÑŸú%£]¬Q8J—î½´òsïYSÒdžãÕ‚c¸~Ýr?ëþæxI»·Ý»‡3“Ü>6£!£Ž“ðÎÕ› Ò6”-ví¾—pn¿÷ÿÒX½aà •ÞåbñŽÞÍsù8Ÿvúèñã½¢ŠIŸ.î5>-aÕ¬÷Ìú`EÚ AÚ–ÎÃèW’£·gñp¿[÷H2!‚Hzï ÄÛ£«#¶q϶Ö& a€@ ðx #X{õÐò}Ø ´¨ –ÜøÍÊf„–ÈùÓ©nc1EcÔ !Þ—Ûm”Ç”¹»îMY·÷lòÒ1Ô)è¿ÈíX0Êqq–ÃŒ÷ÐéÕiE²[Ûäa²À ]ÖüÃ1_ۜ޾,¶î» _É„ôù৬äIh÷4»wqÄðèàDn°Š|i³ž²ÖŠ rŸIl->œ3 ¡]ã‡'÷vüòäÞ hÏò‰vï·>%:4ÃU{!Õ]BHŸ1Þ_¡²ï'Ú Êj³°AhÃ7i²{ãÈ!„WÒgdalìwaRpò[U ¤.°@ €x• hݨoý7úµÜ½)éü5cö¦S;þjô´ÔÁ!-Í"]=lJÜéöÑS &PVÿWöEáà hMYß{/ÛsAÞ· $ šŽ®N]•B4æˆî4=Y(†DÔ‚…ÖMi’ææ6šž®¾ýgÚiòT25ê …]'PpêÈôéÓ»ÞZ €oüüüž={jkk3 ¼Å ïÒétÖ£G-2=~ü?ˆ§”””§³2•<¯¦MõX}ØŸÏ&,`œh¤Ldz÷éØK*ºÍí‘FvÀï-'>•u§JWwïS¡Ù ›°kÑ‘`šžÌvWdTZ>•L °€@ ðòü[#ØnA^ÉÔ;"ÄèÛϸ{²tÞ‹©oŒ¸+I$4=c£ŽüÅ/ Œ €@ ð¦xŠ˜`U4£~ͺkËdèô~Ǹo¿wÁVe {@àÔ'ƥשÜJˆ­+HMÌ$îøÔœ$ÂÆzœÛõÓܼóÒºâôØÄö:ˆ SÓ‹åÏ„‘‹Ð¨XÑ´ô™(#Gý³#PêípœÖâÄØöÓißJ€@à5 ð¯à×`Ž "è2Q©–VL1ñki*óÔrSy>ˆ¼Jãgq4K‹«x(ŠÆ6/¦°õúi߀5×ÛÅüß*\ïë‘®œ!Eaiœ]ßÐ'Cº–^½ÒøÌ^e¯å“*}Ѝ"VÅÉ)åEØÛo.¦ˆQfoøf±ï7×Ô ".Œð圸ªlGæ(Š5Gki­/ t¼E4Íé:5™]ÙíTû¾¢y¾‹ÛO‡ÒPTÌÑÒŠ-}ÖŸ¢d@@0‚5Q²·—€X >÷&Ô ^ÔɾåäøÜÄOº…®)©Â&¦Ï3p~ÒñYŒèÒÇm+Åã—&!;ývÅD ¦Å´Êš;âþßã£øµûøŠ~VήˆË«!ÍYAñ)\žq¶š¬­ÍçÏøp€¢%5Ãòþ?Ì[W=RŠ®o„X:ê*PÓ™|&wÖ0âi,D!Kù¸qªðŽó¢T-Ÿä޽Ýj=;¥ÖŠØ%[ÊŸN£¡5á÷®‹Åšë  ^%`¿J«º¼"è …"t¤/ÍKêòVyÚKï- ‰ËÆÖ`E²¿½²ÜI)Lô±I­j8Ÿ¾%õ+ÉuÐô):Ÿ_|[> i a)†’ZAîÕ§Jjy¦–ª;µKƒfr×ËFKË¿˜€Û˜¾ÙŸd å‘Ú>>„¨#[ÎD I,–‚R‡#UC¶%7;{3 WFO*H¥ì €À«KŒàWwm@³—BÛ¼s~ÏÎÎÄ oOó¤öš¤é6r(¯ä&øE|["Dfvüx¯?I«JR›ãËå³G™·Þ=“þ{µ4áÑm^€‹óžþ¡¹Ñ9ñ)%„›ùµ™W$:PTYïQÏË)iP±Mu,Äú!Ä ÙV°t 6ÆÝæyx4,9›0™‰Md3çp´/`yØD䑵› øwdÞG±°$'»FÁóâ¤ÌË*àE{Gù:o%+©Š*‚,\J¼2¾— hpX¦\“ú¸%Ž<Öú„…vÊÆ¦¬0„Ô T{<žµ)6 ñ² þä!ö<[&j,Ž±á„†TÖ%e8ï$ƒ%¬çn‹›ï@‘TY¸Å;'” *,¸Ø¼Ñpl­‘Z.héëh!“ç=üsPÏ%+ŪÝß;lGfðyÀÀ} Fk排÷Âíež@µˆK"TXgÆÿIa¬$/¯R«ÑTݦn1™:Æz£P·Á Ç8xUEˆSJQ õ0¤ÓͽX›2¶Ì°Âãa/b¡(G3 Î Ï„õlÜIaÃ^IqÃ-ÜBý îgœ¤3ºØí¬ÌðŽl¨¯ohÆ :AÓ¢ê0ŒëšÂf‘éx/,ÜÏÁŒ˜ ™Ãx¼õò°Ã[œ œVð¬ôrÔg0 ÍlÖŸ¸%-—niæS‹‚¹¡f&ƒ7!¯0BGLC-ÉS™5Q(F:s÷ 6qø_WˆhS¿$7qX& †¾ËñÄ ù}€2yÌñkpäÇþq¡9wgù&ËHÜ–nhnVtÐŸêø–k ‹!¡'d^#¢µ¬%ù A>ËD_ßÌ9Š]óµ+Q)ºñ%Çãhµês-ˆ H@ ðÊкQ¯öýñÊ© )‚SG¦OŸþ2iˆ„B1ƒÉ¤!‰P(a0u¦f7”Â2t˜Rc´1ÎÓ0 ïqÜŒö‚DBü2rF ô@tUð›Þ„ÈÀ@Åɉ=¡4 ÅtfÇÚ’=XÚ³ø_"j$iÔ\‚oUW²ìT›’¹ªä«WÊõ"Ã44í¬¨#8Â{}Äm ´·ÇÞ™<¨@çF ??¿gÏžÚÚÚ oq»t:F£õèÑCú¬ÌÇKÈ”’’ÒþË÷¹©‚ÀëN[¯R#ŠFXÂO—Ê~ëÊçx{Ws¹|ÄΨùT£$ÎÌ5…hLƒvNlã¤Ã4èÔôÓÔ“"¸{YšŽAǣў¤J·ÆÒDA)E½ è¼±²›z®C8">ºÿ°Ñ ÚcW—û@ ðJÐøýûJj J7‚kñ þøŠúÆ–G~!Ž£Œ;µO߈¿‘“`xW–#ª™ýFN&€x“ €ü&¯.Ìí$@cÛ9»…ô: ™ZY¿Îúƒî@ €àÆ88€@ Þ:Ok‹î×\¹Tsãþ[ & €@ ðúè8BróPlB ÒQyBž°HÔfŽTѰg¯÷ðK»OÊHª­ÞrZ¥Õò´«ÁãÀVa;@ €Ï@Çá:ïÅÔ·â§ã'¶ÌÁCŽÞpJº{ã·Eº2°)Ü\Qpò¯¢ dOü×c}°ðÜê¡r7°äþµÒ‚?ÿ*ø«´ìª¼Šþ=‰¬§®n½qóêÖyØ€Fùå·ð¶åîµÒ¢¿þ*ø³ôÊMêÛ°ÀsX ÿj‹DtûÆUÁ-EH†DPö×_y'qµ½Ê`°€@ ð»O»‰Ú½á)#&ð3¿£R?îØ-%¿}i„šSg[[öÞáê³#õPCÑÿìÝ—+†Xžy3رb—š!hJ{×f˜%Bpy ÿÃp¸…"ÍK¾ôÃgØòn)Kñ?¿\QŽ3Ò ÉµÝ †­ÍWÌK¼øÃlÕ8 y| €@¼õ:öw Í…£Ì ÜŸ7mOŸºÖL|2ÍñÆ’4®›³¢ CvQìÙõ¢SùžVrÿ0Ñššn]½ú×Á­ËVÆ¥¶h†#âRÎ^ºÙZS~b.Úw™~ó§Å„<:”wñúµ„Ð)„2$ãÜÏ˱<:8õRýÍ8ÿñhÏüÃe¤6D H@ €@@…À¿3‚m¿.ܳlŸ嶄Ðv^e=³aDxî€åßÅšÚYôi×D¦Ì)ßñç¬Æî´µ¼0÷ÚýÇLrèu>#å÷S寄p}¢gó­Ò2ü1%,àãÞ:Æ.Òâ’û3ë¡{ þºrñÎ圾B–À €@¨èÈ*Uo§yß| ÜÀ0ÅÞ_Âô¬)“F ÑhJÔ0ɨ•6ò•:HµºõGJcÓÁeÄínûrN†Z»™äŽf\X:Ú Ùå+}Ïz-[³òtDZà¨^ ñ7Š3*-þ v°œ.| €@P tì«M 0 ŸÌ$·2yÔ›Þ¤yš.£tÇò¹SÆò]½ýúðÖ9d<UižÚ—èýj þஞ¿Œo½.˜ˆýÝàsäÒ›qÝ<©œoøu‚ô†<Ô†íç¾ãVLÙ2wYçç={ÆÊM»EíŸe»Ao2Qajb^þäŤGwk¯ß­o~üLÆ«+NML¯S¹~&‚A@ ´pü€†âgW$Áo˜‰$4ÞzD°o7’¨ùõîCØÇîÞ§éééêÐZªÏ]– z×D‡&ÌýÁÇ7ê”?/ãÛåmуû"D£éê´îÆÈÐôÕ$PpêÈôéÓ_Mݺ­•¨Ø“áÈk×½©({…C»â.c´ôÜ[ãdÐÅŠf¢êÃÏÏ*v‘¾­àw7©”ú3Yæ¡eaßz¯qQŠ­È:õŸuüËòëÖÎúÚ­¯|ï ŸÅÑ,ÇÝK„üµkßâÍ,ÇPtFÈwV«x‚<¨/ˆ@si4“µÑ„†Ý'ŸŸß³gOmmmƒ·8á]:N£Ñzôè¡E¦ÇKÈ”’’Ò Op÷•!zÐtttûôé¶Œ{êèI-`œíýNlãÌÕ#~SFni`5` ¶€ñu«—ºÊ-`¢Oob,°€1 H¯6ÖO‚ššÁAù&Ba<œÃûÜ/È'­tY÷ªd-Ïd¥ï—…´‰ðùn§šâ*„ þâ]¹ß»-'Çç&~Bº¢T-Ÿä i–÷·øéŠºO£~'#ª ÑI»W¦êµSø•!÷|¡žbz–Ÿåf%ë¦?çùèRxž»ü t¤ˆ°™Ÿ~8-uë–íë6lÙúó‰¢ë™ú=ãïLÊhÏÍØÔÜÜÜÔØÔ¬·b÷ësľNErˆkHLâfO--×”ŸC´<ãêeZˆRC\ýK: K{Å#žCË>®”¸9”ˆOº_–èo/w]ýãjeÖq}ê*, 'ÏÔÒFEwJæQñÉ{Èy؇–¦ý ̼cúŽì{>{롃f&óÌÐÑRaÂ’ÓŸòZ×mú|ÍT &>ùhúsWLtFèn“˜"°³lÃùô-©ç±´ÒÄ ™\Äõ²ÑÒò/¢Ê“9~ k툑%Å©ÄpòI$ïzU(ªÍöw%*]C"B<]W¥VH««²ãÈb¢"»–è§6UJ]ž¼±–gb!ÁXT•êj’™‡-s"…$KC3„U™Òá°6XÏÒD×U™d•(}•§kH*IF’·ÙSº:雥ʇÄJ%P×´PØÙìÚ+Ü~RÔYÈtÎN–.pL^m]^ ©¾k\^ÙR”ãO–hÙûl–®¿¦™ÖÅxÚ+.a¡–kºü’Ž(©+Œð‘ö‘‡é›eÂ}"R¥¡,OTé‰ ðpÄXžRŠ®1™²õ%1&f&¯"§ã“Z¡á`VÀ_ããBœ¢ŠUö®‰ä ‚$UÊaH‹Žþ×#Þ,¡æNMA–_?:2h”™T‰)‰®ˆäåDñ®àõ‘TƇò-°6œÐ‚Êš¢¤ìçÅ„¡F]ÓAZÍNMa“¢ÎB¦³Û&Ϭܤ0v‹…™KöÜÜX¥©¤‘(nFóø55|ž7ôç¼ZB 359Åûî#ªª:¼ƒ‹œß7§ü…U|iæÎ’Á¯¬,Êõe‘‡–!'ôö¢?…Ï4û2Sy¢JOl€ÍVb,´/`yØDäW)$F_¯ÖŒ‚¬õlîÌmYòC•T!aq†?ã@AMe#;ˆ›SMâ‡üœ&1Ù¶õ"¯i¥Ô×Zí“´V§Ÿ^ï|¬Bñá͈íaE±KtÌ,Ëz‚“ƒ¹ñ“H[boÊÍ^3wœ»o, eV#?&qb=úÑéVc=Š?UNXvÔ$º~mBG¹Çú~ò³ù´_.K=›·Ã¿âO_<}J?][C$¸Qƒ‹›ë” ysÞSFcËãêÕ£ø}6ôr™’Úâ²æÂ²cñ%”G»ÛYY9Œsu0•Z~¢g8˜›Ú¹Çä®GñQE¸7™:U‰hÑIr,VÁ^¼Ä¦3Â’8(ü‡#¤`¼ .oswr9ƒ êä£IÇ”œM ÀÇÀ×3œÌ­œÖüŠ|!•{¤•WT+¥¶ÖHý#~ké‰ÿ“§UGsW‹ÍðNŽgBCH@¼$`¿$ð0,è@b™0eµ¦3“¼QxJ•°65 Ç/‚Cµ>q1ù5¯Dhk@ž#d]dŸX/ÀÅÌÄÄÂÑ—(R´–Õ#2 ؤð%³—4e/ ´%ììŸ3ã°Ñ[~þûü7év}=” áµZlâù={ˆ›ìEŠl=›¿ö‡â‰ôÃÚµ©7:¼ùV܆;´µSHÇa'o}NøL }ºOL6i’ËuÅŸtlˆÉC‡}…µ%M"»D#ì©&®PC TKÆNÐéú¡‘áˆÃ²%·*#i;³üø‘.ƒ µ<#*°ÙeðÞBÊ*äŸ=±›“{Àeð‹2v£°iæHx«Ág™™™˜±°`a5áDYÓÎg§¢pG“’ÊTl9ƒÌˆy‹I2ÒC‡ÞÛR^µÇñtÆØ©A9ÈRGaªÏ”fåÍB©ç«Ž‡#ÖÿyXË%Ÿ„pŽ£… °´ Ûvà ¥yFœ‘Kï\%ܰÓäDä¢hTÝD^Iá‹™•/o[¯ 4C~ (ŠU3øÀ “Æ•j·ÖíN1…°Næ®~=aÅ"!€À‹&V0ŸW IDATFð‹&ãn°þÈ—…â¿Xâ‹ý¹þ›?±¯Hú³¯¢ ò;Pó<ù;È lY2 ØÞÊF¯¢õÀwÐâbÑå6·ÉßÛc¥«ÏÔ5[Mç«Dt†.®¥Z­’ëçpÈÄôÅ£(š1glÜ›}èÐ^"ÊÎÞh§6 B·Ž3ÖS×ü#¾—›Ì rûU ¢hLšµ2U$¸œ#­`™!TpMf13 Š=r€¢“zFTìë0$©SIKà E}Sû‹S׸ÄÄó¼ðÙ ÅØ f/áp½–»„ò½?þpôG8œb¹_(?z¾ü`¾;Û*§½×ßA!Z‘élvŠFD¦‹“Ò 3av“©>o'TUÓúOIIáËyjßË`òš`¹4ð /äñ¡úõ¾`á]’ÇÃBÈ5¨ȼ±bêºàÑ•Wòå*‘û6 EÉ jÉ…b2’zµe¥b•m|œÉÖÙª’šÈnmm‘мRíÖZ)\%×͹wyÅU ž70‚Ÿ7aÿÖÛ?²Ï;ãÑ¡Þ(‡›Ã tPqÑ‚ñ×>¿âJ½"ŽWe4Â`²‚ƒQüÌ ôÒz‘HX[Z\¥ ¹›#>@úפÝ¿_tqܶù™ÿùxÿÏÇŽqÆVÕÃG:L§#´ò»ìÒû‘DTuæÏ÷½N#çQ1s:67U4j·Ó€rnÝh”¨Lˆj33‹ë%Ì÷Gµë€˜CÆrPŽ3'$95Γaƒ½­¤oOg´oÊñýµ°V"æíÞÌC¬1ÖÆDwCˆ¥6šXX_ºÛ—‡ÃxOUʸ¢ÂôÌŠúVÛ‘8òBê^2`ë;l”)ÍtÔG8ÏG~³°±O·`Ê XŸ\,‰ë*Š«ˆ`V•Ôé숖J…;ž”ŠD•5ãóaã=’Pkmaò¦dô€ŒhUé¡Ü±šôâssP´ÿ8Êñ@4`Ú²½š´µ¸®Ï«°´¯Ä"oºY’ÆŠ(ß Äž=3h—ÔTjW¯n03-Ø(gyL&>0êŠ÷GÄ#¿%5 V“ÄtöôF¼m¿æUÕUdúºðqnÂèmÐéüóuµ…!D!yÿ¨æ•Ò°ÖHã)Öå¹*jZñŠÔU,ö*µë;µùÀ.Ï›ÁÏ›0È]  ò&}ì÷¢ôÑñXº ï†ÌM)”em>ä (Gý­…ÄMPÔnx×’K›ú½ !¸‰Ã2a0ô-XŽ'T£p@ðA„>²SúýªÒE"³â ÊÃÚh43ü†šÒ{ˆfºsׇ΂*§©;{¹þdZ|ÙÞA°ÙYÙ¹½ŠJð¥æƒahf³þÄ-B*¥\ÓNg§ªp“"E*72É}:a÷á˜Y¡ù¸ÿø!ž›…¡…ß)¯0NN¸›ôP‘ÏŽ:SLË1O …qÚ-©ŽÝÎr‡êhfˆç–ƒçÅœ»³|“e$>²è†6áFaEýåÝ:SIª'¹•nÔuFN)EI(ÔÃN7sôbmÊØ2ÃJÖK‰#¥È ³ÖÞßF{ó}]›ÙxôOŠÅ-„ýM³úO¬7GY8?\¿¯„ƒýùVJÃZ«brnOž;åÒ°ââ»KO^Ä!F€x‰žûË2^âÜ`è7ŒÀõ²Œî¬Miœ'+`ôVŽÍv=%"a+b0É'i·«Tˆ„Bl0˜ÄcÍþm’ˆêî?bHìßz4¤üÒý½Ùßû {:ɨO‹5ë+ ‘lõÙZ&nÑü¦@yÈ…´ɤÎ DÂFÄ0Àà0œÎ v¢f˜Q£PŒiw°*O§¦°´µÚ¤4«¹TÔØ(fK/l2Ȍ憨~³½Iþþ!»`ø­t:C‡21òÐúÚu0ö Ç,ý‰‡¶zac£„a`@+u¥E6e;‘>d¼Öb|Ô´?üÛ­”†µQ[Ê€]ž»©1@àÙèîË2À~6ÜAÊ ð–Á¢bW†£Ùʽ2gØ Ý!ê/_Ú—Z3r{\?â¦ù’7k†"¶7qy9øÉwùk¾+û:a„¹õÀ×&Ç÷.8¿ÃåÚÞœµÙ Ãtî­ÂÖªàly.jM+º‹øøO5Cmû*Ö6Ðæ§ëÖø8"·ôa%#ÔðCÀ‰âQ.çÓœ\5põÆ´ãu8Vøqus³tpIk[q9,·å–_оe~r×g¶ºD¯ÿØžÜ;ÿü®™ýéèìÆ²¯wÌ¿²wÒý'ö“&8)6@ॕúhiÅ7>­♾'¯·ªvoŽÖÒZ_ðÔ2 a»¿ðÈ´e¯ÝÖ"=U‡x‘{ÔéÔÿhátýÝñZ·]?쪥µ¹ 芣YZ¬ØæŽU~“¥NªcÍTkJc\ú†&&f&† ×dêÇ`í’} µª°'ïÝ*ŒðåäȢӞܜڢ1Âe»ë/5Ô¢Žó¢Ãή¼ôè™üœXÿK/—í>û”H’ëçF¸lïõUA×&òDeš¬+ÞS¡vÆi˜œèrÖä`ª»µÓv—]nÒ ç¹µ^?í°FýïÇS ùoõo\E0×ñÈWŽæ­äÞ¡wå÷é§Tó JnVùpËŸþz %fÆ>Ÿ?ÑGcû÷3êÕõŸ3tyNºa#m“à}Òü­¦Žu¨ôV [¥ýOou±0ìceɰÔî$ ™hY€“…n]ÓaÁÓ¯~g„ BU—´üy´qº33÷ص––Ú=ÍLÎHê;-u&,ö>ñ¾õ¹KÓ%î¿Ø"©»¶ ÑVΦ‹z˜½ÿÁZ=t¸øŽ 屆հØ4ÒÌP·Ç5Ü E-|ßL—®kØÇH·G͹ZÜ+ëÀ‰M»Š3ªküW{*ÃÃø—Ääï#ÿB i«Ç éL>“;kõÌê®|É…ÓrÏ*eR*¦^a1#Ap¯õŸþänʉòâU(ýM¶>ÜššÁAÆz6b­çãÞÏð1P—ÑÙ¾ª†ˆ®m„XÚŒÎztPwëz$B³Gôë Zµ»á›P»¿jéÓíµœÎ! ÉæGŠ¿ð¢Ý+N_FhúèO>PpÏ'*s÷ÆA„æMxòÔjJ«2ñnϮ̤ñJ BúìaÏäB óE©>Z>ɲFtÑhDWÿÒ¹ µëßxæh¯Oÿ¨×ÐOQĘñ­ÛÎɦø§ŽüÌÖ¡³¬Œ5g4*¹îã²=¹Û¤»7ðÁ¹è£jÕ‚sx½ÌÞ·ìÒz©õ%v¯—®lB¿ÿ4uúÔ1Ó-”†‰†¦Ý)zât:Öæô|+‹»c€tì&¹^I˜èêÓø Dž®ô Fî1zü!mÌ€y~=–öÓ“¤Ì?XÓÿ+'—ÛWö¤ü]=Òv0>USßá#cÒþ³Ö­>RóX‚e:uL6ÒE-âÿGæäCI(nzÚÒ?!Òÿ§ÊaˆË ÜÝYŸLtH‹ødÎàð·FuV°ºA 1}³¿Ô­ç‘ªøe°*;Næîs É®UwlÕçÅÙky¦×bÃHt>%¾ø6ΠŠä×ÄÌäU¤4ŸÔ ™gPT›íOÊr ‰ñt]•*ÿR$•¬HôÉEü o--ûä b MC “ý}b23WÙãVªGQmbˆ§TÿDlµ"QUª«kHzºLÿÄBùy[ŸºJÚÒ3µT¦›¤®0ÂG6Q¢»|:¢ŠG.B6Žö8¹~²&†{î¶Ô'ט"s„ú$ª¡i8Ÿ¾%õ<Á«a’™‡Í"…$c5žb²7¥r²“¥ªÇäÕÖåÅ"]ãdA¢ìÙ Úûl&f&ªør°B\oG-{ÿd¡bR$ððzÆå&úc¾Z®þqxa™¦æ¦Äß.º˜øùKb»è˜š››››š™à œ#ö ¤äSS õ6¤ÿâªå™I!DªËÞlt«kˆ›è#tçX»ƒ§"}3¡§XGR¢|Sw±÷e…U}œŸþ}feaúQ×9±Ÿ­Èª’9ä—ff}öil¯9i‰IçŽ"Æ<¦ÔxpG vܺ~u´‚lY›•°âh©¬WcâÆ”ï³:Eh¾™# Ä<¸Û$=À겎…%nކD…¤1ó—t×OcG|úKL–Â[¬I™æë+þ(¼K~™ˆê¾_‘–Iútë¯Ô\F†Ž‰UV_ZõÕ®^.±!¿\’ÏÄ dzT|òr¶2Ç_C¢Û1áéÏT&nLrýtת}5²Æø×óˆÉ~¶1kïoUhÈ` ò{©ØG™;ÒBä¿°‹®—…|•žwKú-G Eœ/žÒqÉ”È䉓¸¡®…”ó¡41ŸÚ\/--ÿbY¹þ|•3ËÕæ…"í}bªdÇ 9-êF³þK³ðÊnïõé/É%Ä ^Á.£¦*¿¯Ò_!ISæ/øÌÙ5âÓ]!¿”IUh,»ÊoëûN$º•)@^Žïã´;ÈBÍЈ*œî׬ò?‚¯R6ûë÷éuÇÂ+HØ— æÄŽ˜“$U¨üÓwÐK3BŠúˆ2J^¯ü>ü—ŸÆº.LÏ“ÿéóßó¸É·A)ËÈHMJûª3! ñ|cG,üƒ¼n}\‘û'9>?ü]/;4)jÓÑtÈ5–ý½ê‡‚â’sx×9IÒÑÕ™q)„Ÿþr/¤vºa7\½VyG/uoýž/¡Ú4“)6(2ùá&n¤¤µz¸Zê"]—Ï þ^ÓøÑ`³Þý'Y´ný]6ÍŠj©JîÝψús^-Ò±XK@ ÙV°t v¯*Ö¨c¼¼ç=ýCs3¢sâRJ Ù³ÝÂ9±3+ó IJ~æÌC YÓ?t¶G¼Ð”²OcjH(e£t·Óÿ FüpŽêÁƒµµá„†TÖ%e8ïÔŽò˜_X‹Ì,†`׈äîaníÚìãhÑÔG ÊÒ*ð÷Æãì~rÚxÅ=dâÑ9:KvãÆ–Ö}ðÒ_ø˜ësÇü×]nCK.ÿ'±ëinÿnAÁå dœ%.ä.)}Çk|_R ›ÆŠª£Èlç,ý‚œzºj®ùr]íŠükhˆÅTÿwVßÏ1&O,\;$n÷1®šm!¹›Q‚怿j„W+Vž¬õ Í(yÇÂÓEýx¢cŠêB>Þçó7sëvª^Y€¦O$|ÕšÄö2PÇÍJÃ7³Ü¿ô‰WÖÝÑ#Çõ“ù˜dç ZÈŠ°ƒž(²!CpÈÝŸa!¾6ù÷”950£ ‘'í®¸…¦šÛÇ ®°F;9¶«bR’ÂŽñ²7åf¯‡í¨XVPJaõ '¼`uáfn(:÷?1Ù.¦•H-fŸXNTÀ¯U+œ¬ª²‚ø(c†#E‚Žª†¸¦ýÁ#É#´]ï8€Ñ ÙMFh÷éê@¥!MJkÌÍDΠͱI'¹y=˧oœjŠ ¸Í?VëÓEÕg?剷Å~áo‹A ܶ¯êÇ÷ûãã¢pÏÑ=Hÿè’zÍ#‡ ÂæDèÛ8ï³lÒÖ=W¬ÊsÝðOæ¥ê‚j4ÁÉÆˆàUÈÞ|ø(gìïÌ¢=Cl°ÙZ囕þ>8@†÷œ´û`›ø±¨ú¼Feò°±kfGØñxÍ «‘þ÷°™ŽšNòÄ“c?ðÝõËÊý¨€ ¦:õQY}“Ò5‹Û‰®^;ˆÐ^âC5gk°ë1-iŽû€žUkVž4 ‡ŠãÿˆÃÊìû„PÆ EefŒµÇ înÓ$Öjª[pü¾E«’v îõ^è±wÎÜIš„eø|aì ´Ã¸g„%q½~8¹vë‡V¨ábšÛÛ!öX|âS›X`œÔÎR&J˜hC§ÓYîl”tYˆÜÕÖ¸xýqô´LqðÚ‰£Ü=ñZ°CÞÊŒè:sšóËÄ`}œ÷n&>«îËdLœ ˜*š´xžA)ÁЏ""Ký`Ð8(î¯L}ŒÍÍ3Ûi®»Y¨i¬ý­C9nÿŸ->B*ÕÄýØx«™4^ÇS†hœ‚1yJ“‰Êùø·ÿ†wY¡·"]¹+BV¶ØèÌ'3?œâBþ A6ÅÑå³Us6º¿ƒwÞÇ%v™Šƒð:Né¤ÌÚÆ¥ƒ™šÎ¤2»«\ÚrM™­ÈÙ¡vócô¥ È_À©Ì›k–” gλC‡pªZá{¡E„uÀ%‹½Év5ð¾¶éð˜4kj/3g—+û?Äïà È!;¼bšòf(UŠÑ‡¸€¤#am B“ñW9™°³¡LÂ*¢m‰Â9Ødç.uÕt&7!¶µY!ÆF+S"ÄaËÙHWÖZY$•,Û’?·ck–HÝÖ€\G‘õ |˜º,M .ðò`!vBw¾“ô‹Ø¨L{š¶2Ò!þzà¯=n€ /@ÞHèÆq”þ0,/V~JÄxHŒll“yyóû]üûÎaÙßÊ­Êy?Ýd9ƒÌˆùˆI˜&x&X÷ÞØD—&ÐÈ Åר,FOb²béˆx+ã mÙ^O2yF²OIÝß‘Øèñ'ÛïÒ‡LUÜÖaÊÀ9Qþ #q&˜ª2í4lðoâãÎ2 —Žì—K-ݪ‹Bh,³ôÇ06Þ‹.]F&΃zž>ÐÐi„L8DñÏßÓßÅ?êÿÊÅËÚ:iÖORyþ©Œ' Cܳ{JL }‚¯ ;N-§3Åó–úÎÔtëÏÜSÓNêþa•óÉiÂl•Ô%p['-E85 ±_•ÐÙ4MÊ ¦lì.”†‹Îæ´u7'2 8ØÑXTV„çˆJΚ|–†ߨ±²€àx 8ȵiè,l#ô¨ÇH¸4•Üþž¢L}éåËHô ŽÅ¾ÃqgDí¿wã–ýù`rDùFÔ+Û£9`·òNi(HbIJyKÙ'y´·)~|º©ŸtÂ’óu´õðž§r”àRÉí½šô/ÙC85£Öí'àà4ÄÁ„†êJp¡‰Ã© Ê;˜ýUtÕei籃±h9U9+gcIÝÆöCƒJ%ɶÍ7RÈÓ _NàÔñXSˆaqzÐ Dú6øRG]…‚Yz”Äk˜ٖ؈._ÂSKñ’-àz>éñMp¢êj|±—6TÅ©‡Û—œ,ÇWåþ¤,Rrì‚òàG¢²¿ÅˆÝZµdD²Ú™‚š+Ó•C«rw/%5¡‹Fn¾¦h¬Â\oÀ7³ô?ÝÚŒW¸sûÜùö*fºT+تáÁFdoYðmç ‘¶®Nû¿OèC£÷îMÚÖ*íz(,iE1®Èwi׋F×¥µÞAo(/Œõ^hòë©V D„o[NmÄ1þ?{ß×ıý?^‰&HP*‚(ˆ‚—  ‚VQÀ«Px}V•j…Úú 냶XµõU«¢½¬ŠV°õ·P-èO@Ñ*TE ¡@*‚  IDATD íÿÌî&Ù$›V½Vw>9=;{vס,üBl÷lƾƒ±Û×\†¶¦¤< ôYrc“F€†µV¢i’¥DUqBS´j0wõ²†J„\Á¬Jç¬çìLŸY´ï=—PïãþüˆtM!jƒNH¡ä¨ bN”ÇNWû6ÒÐ7é—…ަl_"˺}ùQÞ¶áVìÛë<Ú¯,+ì¢Cª½ôEÐꪴr™Ÿÿ¨_§­T)†Ý”zH‚* ÛÏ‘¬Îë½uµU»±!Û0Dµö BáË—‰2ò6dNІAWBmãöé$cdéaÚmINðà &ã,G‚åBÂ1îÃ툋rï`WÊO‘þ ¼÷ðíïzð®·ìyk™»&áº_f,¢Mâ!mý$9ÝŸ†ßJÐG-…2 P?õÃú°uÁnè÷XŠöì Á¦àxÍòìMµ+M»¡½¾ý;_ù€M˜º‚h5WVTBTñï>W˳7½|n>¹¨¯+ <œ ¦‚\ñ¥,Üò†‰3ú â(«† ±p/ZŽCýXÈ–¦&û‡+T\.µ[r4)™’cYiTŠÛ9IÈ"°cÖæAQÅW—¢ÌúÜQØñgK„ŒMþƸd¸74®‰\%U6kýñ"îwÊë,MNMœNó³%"}×ûá‹0ªˆ(§‚Y¡¡œ©’¹Ud!ÓíŽØÕÏ _‰‘ÕkâŽÃº>¬@·^ÀÁ`¨I,*¨YÔü ã×ÄvèS÷W¡1£]ø¨"|h;‘*F…nÑx+C†úYÐ6‡ ³á±¿àþ”ñ£ºb0­õpHG$kÄT‡Õ6j¯RêXq)è.ØŒuoÍc`/œõ{w~MPÉæ·S–|p-è´¿¾^¥¥~)7\ŒÈKÙíœÒOx„Ÿ™ °‚ ó{ewª+*JÉTË{uQ0Ú¼ú‹üZB!.Ú Ë©³œ…ü¡kQFè·Ù …ôÒmIHôÚ<—‚c…lÆlªÏôÍÛì4=¶Ö'å!a¿‘A(Ã;(âèÉØ)—ÍØ53ô²Öצ:;9=¿™Ù† ;uJúâ@ºX¡¨Hÿ2<-ñ퇄¢+оË“AUBZ‘ŸS*V]}ƒáæéò9ÕbquQv~µš€¾œPôæ ”±<ôÐ¥R©´6çR¶êQB}-ô—wXYŠ釫©6‰ëIPeÙG·f ‹GøQ¡•3ø÷篔ÌÇyQ{9Òî¨Qwg‘­±šUGsÂIá`HñyhñŒáô¹XEB„ªã1õæV”¾áhŽ”  ƒrJµ,N# Xg ë FbÚ[>jm¢¬Œüü{âœÔz/-@6ýp@°Qgð•×$Þª&Zˆ‡âü‚:@ Õýòï©çÐÂIM禌G’¥p°Q’ÔÉ÷¨òY9(¡ÃJó ¸0Ä‹£x]oƒ¿™8 É€`Ò1¼|õ7©¢¥âúnÑ÷Ç¿íãÆgFZõ{1â E™i¦s/CWz À~•* ák?IÚÕR¢E\Y_ î9#Ì€`e+H^‰c$|\a´aånÞ(«¾W}4jÏø$9ÌJ¶"-ÙmSÅ‘ÃaU[a!ðhn#ƒ:xù¢Œ•»SadUç߸-^2VȬ¡›€2îÝ…úºG¨r æù¬‰-K¥âêü|ÝGãXåï6Ø—‡’®_ªlTDEq5ùÈQœƒœûËð3îgöÝGÞýÝ̈ô})°®iÓ‡›¨P•þªÄŠÕôÆP£,Ö÷ÍxŠý¼`>!îü*Q’Ĩÿ~Ì7üÛ–̪‚š©%˜–üþoð%‚Æô}ÇÀ…=öÖ@#zß^ç¼[?7ºSx*WL4ˆs®WJÏÆ'5´u•\D¦Î †›2^ª‘‚ê[“SAÍÊpÐŽƒ3FTóôÔ‚Š‡-<¡±.mðª³ôd„ß”ÈdM“Uëøræ8'øåìwNëç¬lò´±·w"S\îŸsönuØ,ê%à™»DY¬½‘×îÖ~Q™1‹C½íy^(÷‡µj6²µWϺ¬¯ØóÖ4‡.fǯ·A»oñ¨“™×± hu Œ,Ϲ¢­)Û§S̯®LF´fsÞ8å[#tFŒÁ’”à}áN榦æ6¢åçµ®ñôÉ?|~À ÓúñsšŽûÊeQF%v•yÎ#ÅÇÓzû]¢n^“ÍQÖ5»×¯Ã÷²6ï]pH…*ž¦°Ò5¨­4¦n¶Yà596±’ÏÆ«ñ&^šE³6w8$§WÆ©7ðÿ« •M5³AÃözóBÂûœ˜Ì?µÿÍI桨˄þ‘`NÚÉgñØyH¶hi¼ùëñ#¿ü ¡.–úO“”z¼¾×|êw…'ÇCÇ3@ê‘‚ê´²™œ:p|!hÇ{²#9ؘõq›Ò\&ØJLô¾ÓD|P–‘T@ˆA[â—u¿ÓÝZCsêË §÷óˆ@ÖÅ3Ó¦M{%{Ò2R©–£„*ï 3€'­ ˜U»´Ã¬R) I'¨6½S/ÿè< ùd!Bc kA 92òI&ÒüXSQJžì;¹X†¥×ð¿HM‘€ˆ’$”ñx¾fMCòÁyãñ„| Ä 7Ñw´cʲS!Äb¹Ð £,Kd*R±©õ$8²Ë¡Uª¨8ɳŸ‘T.Ÿ¬'àDŸ„t„X*‡.ëHÿ¨ (aUÌÌ߯ÕH@¶ L w»x['sâj}”7yÆ×h߯X¥ žSúŒŠì€$Ä?X$d4$àá˜Î ­†53*ÎJ6">_H¾€‚Yó±ÈR³… ý \‚+Àn‘ª1ÑRKªGþV)„­ðaª;WÚ@ðø<>ùÖT´6éœ „‚o°£ÙŒASµT¸‹a‚$QÕå¥P´u†:R…ÎeQA͆s¬¢þC¨k½ÌJê|‹ôáX}uGã"*¬B]U7ÇT޶ß6˜· r¹‰.‹²äÊ•+]ºtéÚµ«@ €_H° zA÷wîL½¶©µµUA¦cÇŽ=Þ~!¡ã”âx^àkù¿¤\F¬¥Yú¥©ùjä„â“2à ³ÉøcÃd:ÆÚNoŒs§üDÀKÛŒÀ+Ôaæ“‘P¨[Q§¥fÍíÞ똲ìdùfä;}á SiðzX«? ެ„µ ß}8^3â«Ç†Úú$Ô d¤ÖN£¼};F&ÝØX ¡Q’–¿8îóŽ{À@¬Rת؅IðeC‰Μ¡ãmöÀ!ºé±ÈvÌö±±é2Ö.ÁÊÞKTE=òwÖ-š¨qâ+µ6jóâÍt‰kIÍìb]^àA}¨cH1Ä¢“ Sf¹ž|¡¶Ië–èiªc±í· †ù&Õ —ÕK}€s‚_êîç”ù0{»ªdti…¸±eñƸáxí1¡º†N³ilj÷1pÍÚÀˆ KLíÿ¾]Áwš~$¶ÝÚr988ÚB€s‚ÛBˆ;Î!ðb! ´vô²¦bŸ‰büžÈÇøž 3މŒ¬8ÌâààxÙàŒ{ÙzœÓ—C€C€C€C€C€C€C€CqN0g/œüÒu9§0‡‡‡‡‡‡‡‡çs6À!À!À!À!À!À!À!À!ðÒ!À9Á/]—s sppppppp´÷íðX…¼¥¶¦º´øç{¿ßmjjúÇ?þ¯æäø+€]YXöêûŠƒ­Cw3‹Î8£ú+xrm988888Ú‰@ÛN0¸)üÑzÿ÷»w~Éïôg«¹¹ù+¶Ãà#Ô·7ÚɆ«Æ!ÀŠ|´¥¹¹Y*•þòó?Ñ?lúÚÙ:8ƒ+ÌZ™+äààààààxR´ám€ÜÒLܾyµ™hìçèp·nÝàtð:nÅîIõÁËLßaP(ZZZ˜Ù€þË*~-óû»jÕ^¹kFú Ì{A2ðvçˆÛÛ®õd•—CÃ?ª”ªZtà­ÀðT‡¡î]›å†*²ˉuÅ4°¡‹¥Ç|æ>8Ü£’C?iSª6)>6…{ÙCƒ2¤m2xþÈÞžsá®våìûR0ñ‚yœ*JøïÔ•î½ùÍÍÚ(ȪJ—È®$”û±%l4+Mõ£äó‹H¯ ” Ùšé"ì#Ø{éÒnRb¿©âÚœ8Ô©SÈÆdˆ¢wœæ"ìÙÉ=ì(UI¥Ÿ#°È>†éú…ÅVè¬Vª(°ê¥Ö¡üCËÀø¹. bVÈ¡ûçŽF’Z†œ,¢×.‰ŠK”î!»KuØU_½èç³Çÿ>t]BÒ'Ž®JØ–9qñÄ4 ¢¸W²qé~²Îžo*¡\ß Gw­ŠB¿U)-äÿ¼ý4,¿JbÆlL«#I!ôð—Ÿ„Kuˆ¨ü%úì´4ƒ¨;u˜"N’¥›(7¥™JÙfŸJ'×u‹¾ù6$ÇŸ1ö‰9Z¬VFZð£[ô}tçš¹OLlUΫúéz©ZÄ7åJÛ“$n¢8N,`Ye,J=;7‰‰<˜_è 8Åý²}Ée佄–ô}Ç(-=›OŽž¢ÄS~Q?¦&&“å ‰Å4Y¢² |6Ö×/ꇈ…û#“«Iµ¿ÿ‚¦òùuÊÈ•êjl‰â¬A“‹HUˆâë~Oåã|kNò¤„{Œ—þH1BºJiö Aœ‰2L<53ëß$V»¯ÖU_M#uÙ{•2!­‰ÚÊíÿÉ­QÂJ‰®4ØÇ^-Ѳ¤¥ðŸ˜±ê°_Ôu¥ º“;ò[I×sî“kýZòÕïο†P}È”=ƒVeé§Ðž!ÏäKÊœYðÙkj+El]¦% Æoþ –™hìs,Gãn zL®WZÝžÈ}i!³OåCs¢:râþC”%+jÔyFåˆÃ%üÒ²<ÊÒŒ}€µÎX` ɦ mWu‹–˜ÜîÓBÀü°þ¾…¹9,ÎÁ¶•¢"øu'ÜÀ…íàÁƒ©rˆì|Zrt_&ÀP­75jLf#H7Hý£OrëÁAÁÍp1ˆM§=&¤Hì5c³ëªª´h4C´¦O´ò40-¯¼Xr"3nPo©I ÷ñ¹64)íÄÖŒ¨@ó^ž("--nE|ÔG71@:8ðíߌÁJDìÌŠ{÷5X9TI¥Ÿ#°ðþºïêÌ”èŒ}áÇr•Ày2©(°ê¥¬…·ö¾o®!“uã]¼j)DyQAse)Yi|ãgìLÃ]G-·÷É›RU•7·j¹ÓÚT\ÈH’ZŬu“JŽOÛë-YòùMª‹ZÔ¯Y±~Æð³ŸþS>Ç̔͹ÂS13ó÷Œ uÅK½]{£u¦|Ý{ÐÙu®YYyÇocÏOV_{îj½ ™ºº¢Í;iÅŠR²‘å“êsÏåŒ.9>en]Û¦<£ö§Ÿ–\Ÿ: dçºwg…³âÜ4·óÜ߇e³­š8û6#‡ÌCÈyŒ[Æž€1ô5®,|µÿ^o0:›S;¬)ë“ÌúðêÐÈqÇfšÇ~y>åÖôM‡CRÍ.>ŒBÂO“¶›SIš{ÑcSñ´•…‡Ç ²K‹aM’< —5&^ \Û?‘åé˜Ù…1#Ís‹faG_Þ Ëº35Zqj‡ÿZ›úý…$ì•oÍMûÚÒ5ûøì‰Ø;²¬{0œuœ8²gvIÌh”tÕ)ò¦VwТYEs±äþ#ò°\ñ(KRßy¢zãöR··'U$L9=çRok°hW¸¿y§°ìZ"òvoFA1V<žãÈ)í»X~‘pò²e~n6½íݧø¢ô¢{*}N”ü° Ào€° fsžïÖ¬¦{Ù9ºùù¹©Îq7ê—Mõú䑪&ªŒÐnèp_dáàéåáaÍÃ|Ÿˆžîagí°;sÚ·ë†Òi¦¹ôÔ½½M݆Å$µñ­GxÃää;fÔ;aö‘åH³yÁ(kë ¢oø¢¤óØûl–€²7bæòpêx7.ïȲÉ~SÆú"´âDÉÎ~~o¼é‹ò®—A}]øî£= êC4ÂËÃMõèH¥0ÀÑwkfúGsF„ƈPjv™ FF¿^ŒJB;ww ä;ó6ÃØ^+ å;¼üfÌ BYÕ°/-8·¡yc]x< Qt^±TšÐ€Éþaþö½,Í­z¨I77¡ñ 'ÅÌ2ʽ·ì—¯Ú»ÿß®½Ýûû¹ãÀ3¨à=s\úÿóåÿÚNS”’S«lÜ<³¡S!IAz%œÂÅ_)™·rŸ$2o”5ÏÈÄ .rjA 9HVükƒ{ÿQ®àA0Skvb2mžÝßÚÊzÁ†IÞH’VÔ(´uð¶Aæ}_ñr·×…á[z S‹1CìízÐq{÷¼¹, ฾4]¢rO*èÕßʨ³£—¬š_d¬%ƒ‡zíLp|²“ƒÓGÿŽr:æ˜ò…1þ¤Åþ~®f½_±bƒ2JÈ¥`¬…MNúÔ€!®3&›¢‚Gö_ŠïìF7+K¿ù÷Ú"Ì[9a𻥵«h÷VG”uãF"êjò ª‹Š©¿Ê¢21P¤’’3î]Êå}„PUu]“™µßp[<Êô(ÅìÁ? áL3:røÍ>ý§Np>§ŽÏŸ6¼ÿÐþÀ:õ²jA&ãh Ê 6H,BTÆ^@óVLsïí8Ä{ïBS0X¬X[IÇNº¸·ÙDÜ<\-õP04™CžÉ¼¹…EÎŽ™?¬:Ä»PRÑ€mF·ËtDBBÛWÜ…È{È«^î¶ä`TfEOu”Åêð1¦Vê|ëe<(=ûv1îmó:B³ñ¸¨Qكߤ/ŸþøÂm,`šzÌ‚®5X¨Rî÷™ `È †a€§K½ Özmlð\‘ÀÔÂ0üBJ œs‚ŸIg½L`LÎØØ®³^|…ÍÜVÉ-ÏlŸ÷¬pþ†QX«´éÕËÞ3«T€ž`ääåȯ<5£ WmTî.œ´Ã4Á¹bŸIF{˜#É›ñ} îÄ{ô7§Ž zÀJòn´&ª‚Î/ #Ò…‘¿ÒŠ\„&ô£e•ã¸Êûl~€üFôSQûžöxWë8ôÇbP’mYp %m qœ8ˆ$ Î3½Õ¿aÑ‹Q™Pýx˜ù°!O™rpçQWœåaç2ÔÓ¾W/›ÀÕHdª>¥’„*ÈS¿¯Ö¤ª 7K‘ïPð3È„CkM=_Ñpx Â?;º‚Æ=.ã;¸®Gè?é5DYÁ.$õëx¿%K¿±›?õ¸ lˆZµŒ`ÍúïÌ}öº®µ"NTÜAhDOºËŠIWûÒfÈ2š=½‘“†ÄèSQÿnpL¦ò(‚Eì³Î9M=ì²47cÔ†;ùC®äHSÕÚÀñcŸ½æoœ\S…ºPXÊ‘ { P$G2(¹µú.%¸°ƒðR:$Aw,Œ¥;gÎ{…'z,¢þ¾óø$Oë1NÕxC|û½‘ŽYIW]^ß²û`UŠÙƒq&EA¦}pÿÊI±{‘ò„ªÙUkª¡Þ_V !Õ‡žÄI{ªHϯ®ürªO=«ÓÔÐdyfC0-ë>tïðLÀôêëšk—銄i™Íº–i½öX6~2Õw ø¥Ôkf¼ÝÌïv!ä†Ã’ºLýÔž¤büüƒÆ ("o^ꌺ=«.ä1–ÁB·á6OCN°ÀOà”P¿NNN°à[·nÁk"à—zH¢„©:O_ZŽÃKeN]ºÒ§à^g»QaÇâ‚PFQª¬È–ÃU%•Â<„µ—¾Z]•V.û377Á1–.%ô©Œ<¡eݾ§”²‚Îí’BE8á8ÉIïNyšlÃu6Quv*|Ó.;AŸQ1_Hª]ð"áž4YFÿ°ã€E5U9ìÊúà¨l§œË× IDATº5¬—N“:%rÐC”Y¯ìÎ# 4\V¢<ôÃ<çåÓš2—&¾WæT©™º ûIq­öÙ]]AÕF1ô¶yÖŒ ;rИažàWÈ ð÷Î&/FøoÏkX #³9ÕŸš¶Å]¶ä½«ÕêæãYZB ¥šáÄÇ뎾næäN;ÈÕ:f]¶íy+gÓ2d. s×à]*Pr$šë™mÉ|íÕ‹³ŽËN'„5ßoà ÜèF¤åÐLÔcH¤5UüN»¸re·ùsU"áÌÑê>"Ýèú:¸ëÒ€€×›Òß<û¶Mb|Ú·Å-@SŸRê2„3EU+\L‹¯Wkª©þ_µÊ:àÌ•P1f­UU’ö>l¨+?†Ž§±\ªd¡Ü>æìÊS:$-`zÖ¶ØËDº]fÐt•"Û6Ñc·:ÒTºRÏžÍÊ)—o “–¨žD™KÌ·&|+טÌ%%{†{ß)}ãh9É–íGù‘UY €WöPÚi¾±¾bó7¿ÄÕÕU$•••}ûí·ëÖ­ƒ_ÈáÂÂBÙ3{›œ\Ù †˜\e ŒéU¿vJ—‡Þê“¿"õСô|±” ÄEÉß%!_w›¢+оË“ók BZ‘ŸS*V4‰Á€EYEöÑ­Èâ‘V( ¬‹Þ\2–‡ºT*•Öæ\Ê6ðÄ»0Â~‹‚ÑæÕ_[…¸hWèrä;ËYí °7jO)y&ç]‹2B¿Í®P(¤—lKB¢×ôlOsfV„Vΰt~þJ)¡ O2tƒör|Àdðù(ãÞ]±k *BWß`”ç³&¶T,•Š«óó5£¶Jë*| î2QÏT‚¤$ìï< ¡ÏçÜkß«Î&ÃH4xÀŠ™Ö>øjÿìŒêwå¢o8ƒ#G‘ßt±ô!!}(Î/¨£úúÍô‚:ÔÃrpÕ¢£ŠP—á3ìPUη×ë âRBæYÄ{­¡þÔ…‡$îÔ:(›˜ØFŒA_o?ó}„ ˆŠø.Ó³ç{5Gwò¿½ZS]œ>ù\1Ò~µIÓ#ìʃwXq=k[2—â0]Ö$ttd¾o:š|ñßãaÑ/æ™X-rG»v^ʯkQ<¬ÞõA²éçlhŽ‘ýRWzõ¢Ó‡¥4¢.5­¼VÁÿ§»òm(…ÛÄ™&ÌÜÐί²¨ýZ+[°l±…𭃽Qìö“Ÿ%f}¶jïÔT„ણIW~ao¼’´ŸjîÁ¢“‘"ßHê!B%½ö@e}¼…H÷5Ÿgä×Ò{%±0‚ 䆽ËtEÂí¥(«N,&E»dj ==VǸ#tùZEueI6EòQTÔyäLgT•·!±\J´À`Ì)ƒ1Û’šWT'ïÕßÖ!ú2‘u,èÑE)©ÖVz2ÂoJd2X<—ž6ô#V6caCC|%nOCêÙ³ç¨Q£à“¥¥¥ÕÕÕÖÖÖ° pmm-¼3ø­·Þ2114£°²à 9´Ïbo›d]a1êEN²{i¡¡¡´†¢Å™)o‘ÑäϪâPpˆŠ@1y’°Qo,FÞþöæH´xëÚ ÕQþ;ÆÕ¿O`*§Z•Ç4Mõq"Éßx‘,]‡_—¦ª¬†´«ºL8goáÝQ¯Íø°ïÚ‰afd”+kC’„)²P­äécdjL® YûEeÆ<ðñ¶'ÅÅd¦ø‘>0ˆÅœå»dr­ ¨wåÙ±á°ÊË3&…û;­EKr—aiI©ÚÉÑ¡+½Â§EIÖ‘ÜèP8ú£µhFùfß,Iº1nP òd†ï¶·$9:í Çû¾1’tGjȤÏ;c!Ñß}ÂfÚ9/v 1©ùƨQÛ½ûG6,ºgþwü{ß,Á¼[gù‘%ß¡ã¿L9õ«õ;Þ Çuh`y8<Êwž¼%Î ?LØó–£2€JÌ¿åÊ7KV‡üÚå"ïèrÚTz…vÞ¢y(eâ܃ȴ×úÓuIi;GÛq¡ê,y’¶‰ýׇý£>¹²h{ý–uþ#ö§U¿ç&þœÍÓª–'zMÅ•lì.9Œœ5 ®·É[´ô°¨- mÖàH%H²„õßO%sÞÜq ›RØgRõ aœIbL#äᘀ )2±jMZkB9ˆÔÀÈÒeÚ¦àæm?l‹¾æ6sø)§Ÿ§&³^½i“e‘ßÊ~§ûň¯3u­9í/¯û9ÿ‚DëÒ¼Ò‘þ…àZã{^S¿Â»ý\ ßq…-k—Õ°˜.ôb;´ý²MêŒy)=VôÞ‚oqS‰ÝêŒz¿±ÐÜ÷À¹Äh^£sR)Õ›fCÆg¯lõÚþý®hÜzüÂ)ÿuèRxæâ’Mñ¾©MÆTX+F̱ðþÎÊb7?Ò°t zP–‘„æí«§ ̃KONwkµ" Ô<x‡ÓýŠúC€&¬ƒw"‡¥ÍͰ< Ÿº¥>^ò‰'îß¿oeeµhÑ"ÎVÃÇå 0³¦¦¦òÊ{Ý-¬µÂl².ž™6mÚcQ}N)©T‹˜Ff=5ç€b˜þðt -8!Ëá£r°+KdFW%ÜŠÇòÚ$ùò„Âǧ +•ª”…èä¿FBJ _÷‹{O‚£J|ö f¥Ë[£ºz   °DC#âwDàÊ.× €Z¥ 2Êã“‘ š‡Ú¿×*},ÀB°÷†“¢…PüàK5ìL‘‚ ¨4Yä¦(0-¸LèX]æfÔĶmÂÎSú°QaÄ73¡Ÿ®ƒ†ù‡{è[uÚŸtX[ÄÿöÀmA™aWæ.$¤ˆÔOMÛóÖ2êz\F,À?„&J”mt¶.ž îFj% GW0¬T›8+ÉèÛ¶Sk}Íér’cm!5Æ.<a1\²mˆ†rtE › -ˆßƒs?µSï„Bù‘:´:2‰Ý¿BÛ–9ÿ!n@f=4,Ž¥ËØDÂæ ]£=FÚF[¿›™Q¥ŸßÙÍJ¦>åÉ0EE‹¸á0`•aPÃDäõ]tðæ þ ðA·.]ºP/o€_H°Ëƒ«K##x’ œ H­­­àÄB:v옎Ù2˜óºð!®H,ª1E¨[·nà©!¨ þñÌ™3?Î1$Î fàÇe;ŒØXg½øaWcSÊÀ:LâoÕÞlÆg ;àkû¡|33ú¬®°>uZ髨·ü¯SÐKbPŸuvøz¼ö'ÁÑ€BøfÑF\K¨ÿsB|z]Jé °’ëÌr2f­h¨°³°‡z W4"ýMÀ=n‡vÊöF]„Ê8eËÔÔpp4«0%ÌÙwxd²IdÎA}”K¶]ÌzÐ ÀÖlÊÜ#b^?¸ ¦õC‰wd¨Ÿh¶Ò†J†`PÑ ëÌ7é¬Ë¸ šmáÌ`Êšm§Ö¬mÕ…‡<.ïn^–[_Œ§>:ý«Û±Û _yQt>sí‰t=` СO“Š›äȨ›ª‹U"°ÀË©sm=Úêš³¬EɦnGãƒFj‚T]¾úÇ‹.JŽÜö‚€¡•`Hüà^ã£Z'ÇW{ôèº~ x-°0 à»@€øÚºuþ'ŠqLÿv€-A \tý~_ÜÃÒìMK…o%XKAn—C€C@…¼¼ìZn¼{ïCz³»#ªª:齚‚²â&E·>ÖÃõ¾ÉK§Ù ] hý^û¨¹ÅØÔs°½á7q¡LE0]a– üê÷ ËÈ‘{qƒ¸pá#Ô7Êäæ½úòºÀs\âààààààxŠ´áƒ§ ‰yO¡¸ÂõwJxFÉtÕ½[ýÅäH¿ € ¡äMèF&Ý-{öéñòÝ/¨ºœZÏ m8Á”˜àïòMàïy‘š“ãBV}M;üÒØHNÿÚÏý/dàxrppppppppÅ=xZ<.øYô`ÛÀ=©ŠÚÔqg‹~70õý°Qq¬=åÞi§Î5#)ªO¸2tþt; :DJQzéøø‹,<"7„Ù=ýaÞN8žójNÏy=yñÖ¬Yóä‰>Š[¶ly TŸC’Dr„WÐ.ïíSå¯×R FXá…¿¼cûgy¢ {R½—æ•>ËÑU§%»¬¯˜<ºbÎ@3£VñCqþ­«6À=NU‰×…‡L»ò:ÚìRŸo*·à’•8"H ,<2gHDA‡EUõik Bk×M ØùÆÙ§H³úê2W~»ú”×øwé0kC ¥GyN)yò#Ïòc°+n_NEç-›ã¦%¥Ã„}™£ðõZ‡$|ÜÞÑbþ—wñŒÔA"c äËҦݓ›B.EÈ÷Ýe ´¡d!Ê©0L¯šx,óviÁí[e êVê\QêóªwŸiNÑŒR$ú8þ/Ó'Ó_-7j©¸Ý‚Ï‹,IZq»A/V¸ô÷B ().C¼8mÞ–*¦EWäœÜè_k„r&6$Ítïq²H£é»Ã¨î!Ûò•„ujFNÁÜC"¦øEÅd‰¢Hw¿Cù$E©:jOR•;M9IÓÒIšÈiî>”4WÐÉ=6_JÜ»µ}ãÉÚ6ÅÉÛhaB6ž¬& ‰Ò“~î©—N†RFÊѲc&…¢£~‡RF’uCNiè£ÅôÀ_Ù~Xp( cæ[APzëjA•ã_â^Iìácc¯£ºÄoί‘ȯžº˜x½!ÉÑM‡}öÏNø4Y¢\MiÉ;“•”ÿ*îý¹0WðÙq¸€bU”xÊ/êÇÔÄd²¿NáCÕgû5²yÅÌÚÙiî„^ õ#২ùl}r·XÔÓ¤³¿KO«Þ~"`ÆÔ}§(.ÆKTZ¯ê§ë!”ðß”“]Ð’¾fÐÒ³ÔdN”]÷›x*õªVMâèªÃ±WK­Âêû­º¨Ä©ÔŒ8\¢Õ­lQezŒÄ/âäÉÝÐÛr4;½45Ì4‡N!9´2ºýË2 °áiÒ,M?4…]hãG¦w¯èµÌüCËgÄ£ø¹.:…‘¬MºNÇ8‰ŠK$Y÷Ý¥´²kfÔÝÒz-`®‡3T‘·¶»OÕ÷J6Òv¸wZ5}@!¦­wbBĪÃ~Q×I¨Zs’ ìa d ¢è§¹Å{vr#çÄÒ/j®IY:%o£ˆÍV€nï¨É¨{Ñ¡PÀ6oy0LLG‹”FJV|p+yûÉ[„Ž„¬¨I#èŠo©ÉÐ=D9}µSBéѰ)±—²uf5ùêK±´všr(»–< =7ªk#T{)Ö½Ó”dr¨°Zˆ:÷Ƚß=ÀÂk'˜Üšïþ¸ž¼Õ¦¥l؉œ(:êåŽP†ÌôP>P)MWŠê‘^Aa †ìNM…3H'÷Ý0ÀXEÒ–àEß7èñÌÐè%¼·ðÝ÷V¼;ËÆˆÈO=“_vûÌQ»öÞ£‚ÿF…ÌyoûŽÿ»ñ;Õx÷ÇŸ®ÚuøÜrÔä»pãæ™/6ýÓV<ü)ñ?[>:øS3 nUÖ±-®ŠO½M žªglÚòÅ‘ü{x"QÜ»y&ý§›ßïø2õWØ}PpîËO£¶|úŸŸà(¬k¸6ßøï–O7ý_@•´Ódµ¸Y¢þ§„@XȼÛ?~³ããO÷—Šòôý[>Ýñãì×+þòݾM@ü ©Š8djòÎìM÷+'ÏjZB*k6ÜL=²ëÓ¨/Ÿ«ÑœÉú7‹.Ùòᦠe eçv}uüÒ/ZÄ ZøæÄíD.€ çªHšPùÿò¨¡¨dKüöÝQoß_T§œŽ”GÚ¹ý½øúù””ó™W‹+—+'¢,fCL™&¬ÿî…Ô¹ZõkPНCãoܺeíV”žVAvQ¸aF”(îÆýò¼´Åžê X\¨Ý6R´Ù":r:^”b$y˜–W^ž—d¿úॠÆ!œMß8vîfaJ^yáNÿÜ}I¹RÌIÞ”•—!‘“Le”yEzd¯›]oTU¥E£¢5Ep\G$a?_pÂZ‘’ÐW •%_¸úS‚ææA«kNÜ(¯ÊKAQ3lÞI†byÓƒŒ¼]>3†&e&m Þº2O㔇\Z—±+4p®,%+mƒoüŒi¤ˆXHZ¬¡¤«ZíïýußÕ™)ÑûÂåÂôΦÙœþ‘·vEŠËI’ñAö’›¥¨Ÿ3Ü=”£ôÏ.J5:3;g™}U¬SÕÿ¨¾"ùá^ ì($Räå•“|öí^±®ä’3€¼A–u!gj´âÔÿµ6õ!û A`ñõ4MžËÇ•$L²Ê/N¬’6ab­é›Î:NÙ3»$f4Jºêy“©Åù+'Àe/O8q™öu€•1B– K‰s\ ®ü¶¦n:25¾jíÊÀÂÃSNÏxEiE’Y^9îØLóØ/ÏçaáÿhD–§cfÆŒ4Ï->˜—H.kÌ’TM]­Uµ¹sSªªòæV-wZ›j O»c8Àñ•¤'d#dcÎk_Ÿâft"ªß™²õË>|y¥õšõ‰¯ÂzPkê†øE©èÈž™ù;æfI²î7ˆêÛKÝÞžT‘0åô•%”øöoÆ,†;);³âÞ}M gð*¹ÂV·#@ê´:"«¤üFBz¸÷^|õÂÚ;j2ªÁn㻳_‘u#nŒ ³Ç‘¬îjòé2™¶„,¨éB®+ôÎæÐtÇ4˜:âgˆ–å°¥&)ÜGk&Ñ /©iž•ScaÜâ¤Ðµ§ð¦37R ø<ªHîåî°q2„8°Yˆ4' ›~"«¼dŸ = n*Ç©š)LnQA¥I™)qñ´iébη³3n4‹NÉŒðíKÚy¸{\&µß.{úÒ±¥&~y`àƒ%'2ã&ÙDR3~ir`ŒÂÅÁÍú1ÿ.ø…ŠÜÍÓ‡ ý­Ï@"azä‰_Œݬz¥GÏî#Ž3ý¯°˜7°ö÷ÏAKñÍÁ#Îvq´¨§ëò”÷¦înž2s¢U7ÜÝ5髼&Ý?zÝæ¡Ÿ¤ƒ#ÛPpõÇq3=QBàª$ð’›ë¯„Í=é½"xµÃ}tP³ÈÏo¸5Ï1]QÁ“¢ËÜ^}êÿAûb ¦Ãk1iôØ–…F¤þC¿o±±­i+\•Žt?7kÄÁGHqví ÿ´ ™>iéw;:žþ{ìýgB‰#VÁr SHe-P¥<ç6ýï‰è» È3¿¨Ëi¥FŒý®yÀ+ÕÁÃzöï¼ý`þ{Sƒa¡H—¸âÞ¹þƒÇ6{ŽÐåNÅ¥ÝÓ€ŒÈß•·øÄ'nvüì Bð%¤ÆŒ«š}‰¼Ý SL ç8r Bû.ÂT¯#ßÎÛÉŒñò°3b°`A^¡‘ÍŸˆžîagí°;sÚ·ë†Òß»Q¿lò¨×'ÔÞQRÀ»Ð`E¡|g€—ߌyA(«ZI€¬ªÍ5KïÖÌôæŒ ¡Ôì2Ä®Í 6|Ûþ æ™ Öü¿×& 4 ›ï¿`öèiƒe{’äóVŽpµ0üµ½ M‘j ‘9ÅÜyȦŃzvûçHg5=69éS†¸Î˜lŠ IQëåäd*Ú0­¿µ­ý²Ï&yƒ‹ ‰¨Ü“Šæ­œ0ÍÝÒÚU´{«#ʺqƒ^!V“cäd¾“÷˜Ïü~Ý»ìoýqˆ-9›öê®5-1Z@–¨ŒM•{Ï üh²“ƒ­Ÿ-_y|ïž7—ô×WYÀŸ´ØßÏÕ¬÷+¶SlPF‰z¼ëÔDÍMÈ{æ¸ôÿç=Êÿµ¦(%.¿[/'‚šŽž}»÷¶y¡ƒôò˜’<ëÖ ‘œ(ùaA€ß€ž¤žÊæ-`yÅ¿IL½üÈØoöþÕ; ”4Ñ¥#ËÚ¿i›£‡_€›’‹ËÚ¹»Ãê‘#¼<ܰ¥³§´àÜ>„æuáñ,D0‹5,V©µ… ™5KûžxàþÎ=ó§ÙviWŸ2ˆH)üñ2¢ýݬÌ<&ßßmÞ·c*c/€iLsïí8Ä[¯”"Ü kÏUÕuMfÖ~ÃÕ–@Òã»ö€hVÎÎÈ`¿Püµ;)0¤¢ ž¶c+· ¸ÜöèSMB»¡Ã}‘…ƒ§—‡[L6\ökJˆŽ \ Û,E¢­õß­òóò[}¹3 jÛ/!ËL¢I~Àôea½zÙXY¨è̤zÊÎ…ÙùnHûéÁf!Šk'Ñ(æýé^vŽ^}{ÃItoæ6—¡Iå±a“G,ˆ†©{×Ù æ|ëÞ°2ä;fÔ;a6î”˜Í FY[X ”“ÎÀÅ ž*ƒbnĆMåá(ëˆÑª´}ñ2®zpiv%ýt-"zúõqë ÷ãл§~{{TÏ’†¸·<êæà3Ì5¿>c˜+¿&=âQºÉáu€ØÛ>'võÅÝ‹‡1Éòx–¨ «èÁ”‰¯!Eaz†KX˜\ÒÔÕíÏ©üØoØ¿Þ]VSVZbá„*êÀ­%åûôçÏß뎈ãó>pùôÊŠIƒ)‚Àà£Ü¯ß³Pܱl¥Œt ©C ÁŒ.Õbá uV¦þþ¶gÈÜoF.«/n™?¬¹ n]“åÑOf.GOÜ‚C]ŒQaÚõú Kþå€k*‘¶õƒñ1?Oñ~yüàƒž)¹‘óðò%¤²lMþ¹p¥}ù;¯¢ß~‡YH+AýEÝ7~€6ØædÔðûî[rÄB|fÓexè݀׌ç–ÝŸQsk—‘Êû&]F»0|Ž¢/Ð?·DÒi IDAT˜É%¸>«hØÐfÜö§†Ÿ?Ût)2¥dÕpKh´»®RÌWµW44| ‹Q(…‚ÏWaiN®IB+äÉVz'ÂÁ¸näV,zÏkßcoÒ— öQ(8:í«e~JXáÈØ¼<-N85@o8 71—­ŽG"ÊCAST.-‚„§éÀþ”¾ì±$¥Iá€øpŸ¤pe˜˜ÙD¢èàƒÊŠÔ–ÉKÐOJi‚D®Ø‹“éÎôš &ù°!FÓ6Ò†ÖbÝüM DÓPžœX´Ps‘Šú>I,;+‘y/L¨¿#)Fß”»ÛnÞØj€mórÊmU·Â9E]IÔÒ”]UÈÙ”WŒðÈ'“ÙXз€zILTßAhDOƒLÍI'& A÷nPªÄGYCc+8uxRý—Çe)èp^r¢+ú­¹j¯Ñ v¼EJ,ÔGLEý1GÆl ±ßÍ:^Ly€úø.ªñ­[;Sü”aë´b¤š’R¯™¥“iøZ¦ídÀH^µÑÕ‹?uoÚb'¸>ÛPxä£<6+Õ; ‚”4¥¿ç‚ŸÐKÙ)*9 [&>•¡f•Õ²'žPO{šbð<Žt c—<<¥ñº×v¸cCF»û”&C…wÓ;=|LÑ üžÒ´ºSÅ*qß~o¤£Ç¦«.IW§ûµXÃnÈ~ð=jëNGIHó¢D6QT`Ò Ž>ZnrCbË6ÐT•4%Ô@U‘Ê€ô³KF6ýƒpYîôöIÈ:“0T¤Ç†ú‡gàÇÀß!°Íäò-0÷Í|×¶ ‘ÝÉBhz?]sgrÛëÓל*á {#”['cÇœJ‚ùÒ Py‚’²‡YÀÒÀ*¯~  ßˆ~4}‘˜œ_–|+ÁR4úý7¬ùdÛB¿WèîÝñ¼/óLÝxì¶(ðìý’"4’ßXu·Åaeì1_ª_]øÚÓ»MÀ¦óGF4Ðþßÿ©AÄÝŸo› š«Ë+ûŠg‹ˆ_ÖôF½ôßx¤<`ØÒ§@Xú0Ó:_¸vÇŒXbaU‚é° µÐZ'…T(šG tÆöªà ±¢Fÿúü·¸À‡S‡õ™ùÅäÇðá–zäfO¥‘®¨b¥ôp¹s¬oÏžß^/UÌà1íD*EÈ…#]ú£¤ &ÉB¼¶ð'—a¤`š(ŠZt›ïßËúfñݪ†_LÒ|ÎT³=ûž9m,h'€oiÛ‡tzërOLêaÙ·o_Ë“N<ÄM•Ñs_ëaiieeÕcÒ¶br)«øDä¤VLêaÕ×ÿzªËM"[YYöèq‚¬aŠ.ÅoZÑYöØ–TÌ.ÂËS*¾úÑ.´xkÜÌáîîî 1kaÙõDf-0`òGÊë3ãVÄ/÷ÿ–ºÇˆï†˜ Aûæ:)ÕHÕ^ú"huUZ¹ìÏÜÜ_ļ5€+á^E÷2î•ຜ~¤LÖH·’£*„Ÿ(ÿS™Â<°ÏÀ"ICû‡äUQE]¬!9yŽ#Ë ¢ÄàÉN“ÒÍݶö*¨CUMÊãüQÁ>oö?qhô"«bd~:füG‹Ù“#ñþ#röQVÕܶįNÙeéQ‘¹ôÖéɰ¸«~ÎŒÖXUg ’ùµT±ô×ßà|‡9•Tüoã$'ÅVâC•iÿöêÓ{Nä8oTå±é&îBoXgøâFµvEÆ>É%«œ"­$§P•Ö^½8ë¸ìtBXÓéðý6LËÑ®I5i†VÄ·¶…)CTŸ¹´‰ü;2ß^ã8ëNÇ„oíû§¼êÆ ß¤¨Yq9`HºVª¨ OЧBeó9%Ÿª«¸:…ºÆ‰/3E™õÊ1sd3zôJ÷>–n“ö»£ˆ¥ßåÀäÙž>eR£¬v¯Zþ‚×ñœàÿ•s1j­ªRE´£¯7¥¿yöm›Äø´o‹5ÍPSú¼j¨_höÚ„Rß™Jõ0ÖÞaŠß±¸hƸ/ÚíÕ#ÐE¡hÂÌÙ³¦Lò³€ÅöºÛçRÔõ5dPí˜ØO€Þfµ8r[BÒùb¼P]¦Óè·¦ž/|øðaáù©ox‡|H0&"în]ÝÇwOMö^î–†ŠK‡ÎŽÿ¼äîݳƒh5Ô7WîÖÝ+ÏÿÉÝœž°óùËëêò“×oš¿ž~ªHÅýEÉ(OôVŸZEIûò`IhÕ‚9 Í™ö~´/ŠÚ}FJT¤¦æÔ*„ÿôÊh+AlçômB0 L¥¢‡•‡›ÄõøL†dÙG·f ‹Gdt®ò(ÚˆPÔ»;s*ªó“7Š`!Ã<&èîŽÐå+·ª+²#Ì}òÈ»xH(Z±í›±<9¿– ¤ù9¥b<@Á"LáyEwjÉðb5¯~‹‚ÑæÕ_@k…¸hWèrä; ‡Û>ÙÄÊZÉŸKXµPV€Û<ŽÎ¶½šQØD77x«‚»«Ÿ«­‡{o¾‰y )Úüé…œJq~ê^dV^4Ò€å ’ô}—²ìÚ/Œ¹A£fŸލ*oÉç?ÝwŠ|Óy*3±ZäŽví¼”_×¢xX½ëƒdÓÏYu»Eƒ‚r†Vþq‘vèÂå iuY¾»ÎIŠ–¦ÁƒªËJvoúAùÔÙÊÄöÍ1(+>õÐÕiƒ$çj‰¾Çïšð£vpŽ”W\ÏÚV…Ì¥MÔL¤ämh 6 ™#g:ƒšË¥D‹ø^uN¸ƒêD”$uò=ª!ëî ‘ÙÉ©Eµ²^®ƒaõ ¯o³õo£ ÅõæV”·zÙîôZ)Øvv~5í¨%fÍ=@÷îŠÕ'AíJBWß`”ç³&¶T,•Š«óó ?‡¯~Àçl„k›ú‘²ˆöô)ƒ§ÐÎÎÉVîÏ+Z«s¯mÌBófò­ƒ½Qìö“Ÿ%f}¶jïÔTeD;Q—šV^«àÿÓÝšAƒÎ ­œÜ+¿R ÷ôÚÑ/:Œ0¤áŽæH B\]”SZËÚ;º¬ÛY¢!!Ò@‹Œ)Ê8v*»‚PÔ& w×VL™=¶„Ú^)¹Ö '­Í? ö£z-ls#^³³©>Ó7o³ÓôXXØ`³¡÷”`”´óÛK¥ÕE©ax†Û1Ú •—´®¦¥ÕÙ±ÀtÃkÖ¬˜+Û‘N D(xà¡ßfCè„ôÒmIHôÚ€žÊ*ô–M$DØ"êRJ«Å‹¹Û†l…nOí'ìÛGhßgÌcàÚRáKÊ®2ym÷Âí}–}s»›(ìûíÆcm}{ ú¾yÎ P‡éŸQøUžyÇ*8Œ±âä@äöfÜŽž úCIOAØÁ›Ý^Œ>€ÝÈ3M.+×~s·r¥=jûiŸnqýÀ« o³o©µGå!ÎQ ¦Åjª´€ðõFÚ ‡í)¤kš¸Í˜´ftOûY_»NÇ·!'Ü´1üeêž÷FôĽÐsNaj¾ñͱ¿(׫ɺ~,Cîý”rrø+èâ¶éܬ¢3ÿýÖhP›Ÿ“z½¡3§o?DF&‚¦kÎÿ÷¤Iaq×~F¿×cõàÎuäö@gK“Ú[0oYèjbÄïaëìl‰Q’ ë–Œíadd;â_£¤ç[hü¢¥ÚäÐøà¸ÙŒó’YЊµ0'^«•$zöðÌEs}מ¢£Láä/Gü9Gª¶åÚ¿Ï ‚·õÆb”äoon¿øâܵAQþ;²™W^=ß>•”·ÙÓÞFT¼6÷NFŽoÄC䃽wÓ† "ò& ”Nþ¬*n…$HÔK 0µyž¿ Ë–,"¹Œ[jž½L•¼À ‡$œ³·p«ÃfhÍ3w‰²X{#1ÌŒ<@ºé8ÇÃ/¥¢*Ó”U!(K 8‚×JZ¬UU©jøF«L2Ùh’G·¢ÿ+Ÿ÷/zx…ï9^R1rn¼×&ñZo—W#ñÞvFYל^?üÉÝ+úÁJÞ7x%†62±YÈ€àO¢ƒóB}œl\û&ÄÀžŽÙà¹Z„®ˆÀ^m¼wE—¿ï´Ù4¢d45&E¶ö‹ÊŒYêmÏã™ú„çÅd¦ø‘>°†‚l")dõxÀ6±BƒðÂm:Ý­…3Ü_J8ÂÓˆO½N £nt<(;Y¨ßŒë¨Î¨âFøÝè(QEc‚£ ¢¡ÕÈD;ÎÓ˜QWš; ª”)˜& C­˜Çš 8¿™tÕ8»ÐÇI1øºâ1›ãkè é¸Xãúvt‰764tÕŒÇ:k–0¨ º~ã­e)ë2×RŽ|1®ÝËPœ´œŽNæJw›]wòâ;=š`dðŒ{9:›ývÄjÄù“W¶ yµ§ôò6·u½îþ^3iIó'?.‡åET™²Âí÷»?†ª¹ˆÜIV®»ûý(bær3³ð± ­/Æe]<3mÚ4f7¯ ¤:+ª]«6u%Äb¹Ð 7Š¥2£ÑFAˆ¥2¡™YÉ¡).;%¹aÔå!Ë‘P—!•ÂDÈ€M$\uX¼Éæ<¡mðhˆõ¸;úY3)êhÁ<¨'¯h7È=`àªRKìlò𔾨Á 9M™t†Ž3|u¼¯ª™i%)hJSO¹m’圛«Šç†¸y9ú‡°_zÓ¤ÉÜk©½×(7ê,àw3aØæbô!_ÓïÑ®Ù"~ø‡°–Túí*mîcÐþ˜èÆú‹·u2'®ÖGyë¸ú$¶±ö ›ýQ˜VÚÖ( ”Ëy¬†«GÓö™›†]†íè!¨§¸í>e4l‘6ü¯~VY ãaŒÆØ…#,†K¶ !O´­D\ˆFËh¯ÊR Ô}g¸_X;Æ‚X*‡é‚9<ÎèSɤ™aJÈ.UîYs Ã(4c ó¤$„  0eÐN9÷’HS ‘ŠÅ #jæÖ¬KîÑ WpªÍÔ+uø æL”Xm 0‘˜Dþvù+W®téÒ¥k×®~!Á.þF;w¦ÞÚÔÚڊÊcÇŽ©=ÑÇV>Ú©nË7Q/a¨K5rP_‹+¸kŒ ðq}#>ÃMfèÊdÇ(×Í2Ód¡[—½¤«ú±0í í<{RÕ®¯ ´IÊ‹ŽŽÝLÔÎ$U4Òm¨,áSÂ.„’Ç,ÒYJSVÔÚe ßä 4úECñ•½hàúž¶ƒF!4»R¾~ìð>ñPöóo<¾‘‡õïïlÛCQùmÜd¾S‹RŸAãÑϳ㯎]4Ü–€ìŒzj=–¬UŸÛÕDÀˆßaÿ‘ofFD˜P5©‘{Ft…&IÊSÈðáTÁRéÀ&.ck 7ž;,?;½¥úY3›<ŽF]Ìz(½F¢ÜoÜ÷Ȇ—U…vŽ´¢)óù´Ò ƒÖ\Æà­¨¼i>÷ªs?s‡šú³4où”  áiQÆ£Y²ð†`¥œzZµ èK·WX¥¶Š1h,uˆ’´üÅqŸ³yÀP»C½ÃfºÚ”ŒÐƒ„¿}æ¾ ‹¯Ï‚‹Þ¢¶û”Ñ´‹Pó$PpèÐÈãòñîæe¹õðÔæ©EJóìÌ7él kY]T™áÔÌ6¶•Ó ³*kEf…ö癲 @ÑÂ0$#3ÝŽxB„I±í¨ öVØ QenY,İÍÐ ±NÓli0k—X,"1‰¼ðyåyá}Yìj5h˜òÜÝ6F¨êÔüw"”g®ÿi¡;2qÏOÙé6ÖEY¼äʽM®Žï æf¹ªN˜@×gÞ:2ꘟ¼Å-Ðm ypËÅ»áý•d¹íÿQHráã¿x®þŸjð ™ómã÷æU6õrvôèàeœ‘­¨p¿åo÷$°Z»aà«nV~Æ3ÔáÉŠï4ýHìÿR€—Š·hÁœlïßk5·Ì1õlßóe´¸—ªÃ9eŸO â HÁ‘xV´+"QP顱€M<|HÀò<#¬CÑð°iÕÒRDA<įK{œ;¬/w8„Žÿ¿½{‹¢\ÿþ¢»°¨K¢¢(ÞPY 3ì(*P¦yò– %jB–(å5£ÒÊ¿f%tÊÀËÔŽØ1¬¼ ™šK %ˆ˜ ‚‚²(Ëî‚ÿgfö ËEÓmOþ¦>0;óÎó>ó´‡—wfð€ fþ†éÍd„ÝÿsTêšù­¨¤}ý¢víÍýÔø|©’®”ñn¬C€ ¿G ™§C˜$UóK¤Ó¬¼–>gÀäÐ[üP¶}ùhîùÏlnT¾Åà ͯœ>t¼Ðø6yÃ.¬A€ ܳ·R3v[â±Všó›z,«>ÿù´fo³3så®þº}ׯÂö ùö¿–šiƒM€ @÷°@37ÆÕ\þ5í«g®Ñ+g‚蜪Îýøí·ÇÎ\ê6èÉÉ£¤;\+<´uÛ÷e¬Ëã!³ì*©÷Qw}WæìJÙyðœÓƒ?=q(¸—ä?䪮I·ùXwí®9iÿ9ÌnìùróÃe?î0r½Gó’|§œ=ü˜Ì‰;„¹µ9½;£ÐnlH»‰2/cËö#§%÷õŸðËG‹^\Ç.ÄÍŸðäXGϱ‰;s (/ü¸9éÐi6pÜÓܹLö°>nçv~}ÚÖwÚ¬±]Œ$ÌtQÿ”¹Ã5ÎEiÿ9ëðÜŒGS?ÎR¸N ™Ö³=ªúiÛ†ïN\:ý¹ÇúñOç3"øÛWi®íßž€ @¯€Qé×0‘ˇÆy>úÀk›^ l{Ùèiç×/ËWõ ïø¯v?Uw/Yõð£]7ËÎòo:cúÑ÷§ýžÚóä7oËù¿}o*x÷ÉŠï…,Ú÷Ô[Éóì ™ˆÛÒLÓóÒvŽö"å¡ï *EO/Ý?)L¹ï¼ÌI8äñ×’ýkÖŽYlWðEèI ûF÷„oµ-+£—·uâÞ?ÐÑ‘ÞÉÀJöŒ™ªÚwþåîŸ<Þ#sü¦W§Ø® ìŸõùoÿ7¾óÉU“–œb¯Ä'+ã&-“þ²~šáá »ÐÔ?epøŸ'_œ5¦Ï"6gmr—=3G²>ç_ôÙ»Ü)„%ïžâ<ÄâÅHz%•Õ,õž¼k5y!@€ `9={÷7UŸåÿ›ÛoíöŸÔÎI¨)RkÛëÉçï¿wæwz ÒzÈ6=$±ÃÇÿž3Ñ­÷Qw>Ê_Þøõߎ<Ü]ôðÇû¾êþ©7žÑ ãè}qsÖ5â¾÷}ÔÿñavAãGÙ±«û†éÞ'c;ÂSxݲp÷ú‡jN+–ü«Rɇ}cOæX™v ¹“ÿ zÉ\Ðè¡4D]j7Ü“ÙÖœÞõÖ©i÷=éÎXÜž·ú¦/-{–:zñ›sÏû9åW%=å×±~©×½“½Á)SÛE».ÌÔ>ï­¤c_ŸØçú€‚ÌLÚ\’•@5q»ÊkÜ‹¤~)®Ùµ¹»Çôýb€ @àî ŽÞìœ`3ïDËßöb·î ~.ºDõ/ÿ¬ö–ç}üBÒ°^ÒO².0Vï£î<47αÎŽ|Ù-1<¦ÔSbüxY¾1½J©œQpavëÑ[¬<ïkC»jÔÜ=zÚ*Þ¨˜×P‹S5ü˜´6ÿf‡ƒQéesÂÛaéàûî³§Õ\}xî†]48eFq/g¥Æ*Owze%ÅàŸÊXuñ8÷¡¼ä¼ê…øM4“  @€€• 4U»ÏNmý™{ë<½ÊX_”VeÅ­_ôíç!ã‡Ó§ŠªPMÕ5QßÙïîú6š½uðÏúõ'Ü®÷Sì×oœ¡ W~þá0ó5ÿ¢*m{®2å–òo;W¥¹¸7æ•}Žfߎ$é9~ û*ãgîeWüjhÕ¤në<Г½r°;…“ÉlRwÝývÆ¥2×[#KƒS6m§Ë•ßڮ߄~¬ÜöÁài¡ÁŸôì$aš²Cßî̿ھLCã @€À]hª¶ë>íÛµÎS½»9IÃ6åò½KŬÝC‘³×Žwê6bÁÕIÞ \’wýôâ^Rz¢ÙøÕ#‚ú1éGCÒígH+›ÕŸZzÿòÃ}oº‹¸Xó¥m¯¥¥×äñKF8¹Oý¢ß$&¼£ÐäšÁ$ãÞÛíùÆz¤šë¬SJֶǨöJ§Y9U\üö©ýÐäÍo…?L'bÿÔÿôUOÒÀ1m¶åÇ‘ùñ\¾7Ý—]48e¥áp:HÈ•Vø Û=½m_›ÈÁÜ#Þœì7œªb5ůϚôã9….<¾CÀ*J²·&ïȱªÎ4eÇ“v”XUNVq­n- Íå³ÉNü½ŒÖí©¡5 pï 4ÿÆ8RYËDv£ 4ØZUUÛ®SÑÉíÒÔT)[·k§kT«¦F©i-1 g¼¿ÁzMU•Q仵ø°"‰ðâp.ªSëu¢QÒø°Ý-¾2^ß_ƒSÖï1»ÂÓK'ÌÌ&1Û[ µoçĉ[Ðð¤‰2'Ü^–¨MV¶4þý¥áú·Ñ[àŽÇyZ0»üf¤å_¡\•+•­?¢ÑÎäמ®âxœÃ õY•'}ƒ0AcL´"êå…3ýøæŠo‡ˆY7ûZB/V6hý<…<Âô ,гЅ2nø§×Þ›õêCº_kõ¬8¹§ËüÓ™ßEøþMÉQ.Öƒ V!{BàVß×ÔH°&’HêW“4—«€iñ0·bg¨€~äšêª§ë§º=|7ÜH#®L×WÀÔ¦~ÕÎ&¢¹ýº N¹±L„í¢¶D¤û™ é¦Ø{¯ ¨/1¶"=·´8?=>`UD`RÎÝøurk¨M覼†Èb»ŽLfÇÍ‹·øÒ®û“û÷$÷áÿ8l · Þ¤n%¦¿W:ŠþvÆ¡€&/%µ|yzT¿˜°áá[y8éè¤ýY{ÚÞ͵îc÷'?aÉ"SS˜Õfxªnè^üÄ{£&÷lä/41ýÕ#jJQ'S°ms›ÙYú¹nºÍÌ´/ýæ[Yiq·m!ÜIæ‹à;ÙbAF•twfg'gѳCe´]-Ì(Ûº,؆[‚·æï;Tl NÈÈXÀmõ+Е- ü6›€¨Œ"¡†¦Æ¡q»v-ó¦¦q‡’LNa)3h3nOSe$nº8ÿûœ«Úà öz’ðñ“uÑšÍÎÛöM@Ìžä7´þY6÷L,€,$€"ØBÐèæÞàk,×&NœþŸ†nÌXŸ g̹# Ëj2–už¼ªß±ââ=±l²lI_ª.¥ELMÛŸžÔ1eAÏ¥»hsÅñ¸žÞIû‹‹s“z­ tÊ\Õ¥”cÆ\™·eÒØþþ³R}ŸuìÅîõF}í¤L¾*,ÃcOÖžÝS&Ë"©ÞU«ryÖ5¾xQ«K2å'opëš]ÿv™±Šm9–ŸŸ8ædbZæÉ+”@Ùá/ÂÖU¦ççÛ2¨«ñ™J]<:²u™§©ŒÓù|\ž¸û®;º1"³·‡}uᎽGèfQi/ÿ¤¹”ßÂô¬¤ÑÝ„üÒ‚'NÛŸ¶:d]Ø"¹¾¦3ŽÎx~‹Û¨PÆþ()§Ÿ!.ìLÛYrƒ6k*/±€•¹g‹÷'Í]ñæI>ˆZq9s]ؘÕét¾þ)“ßßÃfÇyE¤î/>{¬ëÑè”ÌBîxeÞ .CbØlyqñ±-þ Æx®< ”‘†$ª/ÙñßÂjêõÆ•Lùº1ÃϹ‘h7*³äÚ*–©'33Îj£e®›¡æ.ß¼7z´³þ8ºÏ¢~_ª+åKÞØW>ù‘ïß eu×Y§ÿÆOËÖáäŸg]& îµüøµùd§N9øæˆAµÑšÍŽUWUgí=5ïD×ÿ®~´G#CÛw¬A¸s(‚ïœ%"Aà¨ÆY0¨ƒ¸s`Dbü±ÒIn¦”Ç­bAñcºŠÅÂKÜ—ËUp5…laÚÙ„ð ~£gÆÆ±ußi4Ù0Yüª™~ÎÎ}gÆógi»Oqc‡5•áXBø$?önÞÞ™ÿ°ùúx Ï'4äX£`²ÕåÛø,ÝÂXJ&85ÐDܤ'n])_Çænyw’‡‡ïô)+Ü]¥jFe[槯¸øøùy™¾QÚï™ ¶~w! 6ïä'>ïÚKO†)JZÇ⃠w“r{‘¸ ñéÎd}Gúú¸éòK:V9Áï‰ ÃhKúYâÏsW¸–én‘ôôv䄞]: ð’JlÝB’ sÕïö ˜LÉe•(˜æÀWœáŠé~În>‘Ÿ’! 4Óé‰L–µ1ÒËÙÙgÒÒÔ óîN¾ÖEÒ~“È}h"çÆ£ ÉêcæOmÉÿnæè€¾Nƪl½¡3D²‡{úôëdØ¡ü3a—zÈ”1¯NèéÖÝ5`¸«®ŒKûÎç“ò÷?ïJÒµ·bƒºÙ¶éâòcŸg—Q±;¤¿=sè8ò!w·ö­õyÐ=Ãõúª¹ÁŸ=>þÙ‡ü¼éÝš’ñsú9vyÀ5Ø…eæÓP0œy¤,êåÚÅg¸Ì«“­9p½Ò#ùëxÄÝäŒÂ* »!€"øn¨"&Z$@uÍ –oYÊ·Ö6T§E wéÜÙ}P·”¥ÇðÝß­ƒT,íBÏú»\­(:ÉØØ^Ú¢GͨÜ•ME'«¹ÂþÕKhLÇsð«á£è6é¾s3 „^E.}‚t[õßu¥0·šúô¡‘HnÑÇrþbêB(•ÙÛ$g—{u_¥~SBä©órv'ÊbíY‘“—“™Âæ>êi4ÀÉEãêN}LÆ‚dý¸[õª6ébšû^}Îy°ÌÝxŸ¦,{Y€ØÞ~ä„h9#,•Ì¿¯ ÂjúAQÑ©¸ÀêÒ±05Y{”ÈgL+¬4 >ëÂ}o2çEÓ'IQƒz˜{¾¸v²Œ¹<†ÈêÕÓt’•ób ë7Ý»-Ÿ§²ä4m+ð’â6eû:Ƽø»:Ô<|Céz}ÑKþƒõ#ý׿ý0µÍð;<½uI1ënK}ñÁ{µÕ1 0-Í»øõŽ5¢Å* »&€"ø®Ñ"0šàŠPw¯I1©!,bP$7™AÍŠ¹ž½©[Â}´¥…D¿˜êcþ®RûŽ.ŒeÓÎå´ç 8ÿ]…>•Ú*¦¹ :ê}‹ Ó¸¶|…Hßùj°¼¬”é*HªÑò~/çÃiŠ‹Ò´#®"çéïgT—æÆ†d† Y_¯ vÄä æ…DÍö÷ZÃ/•ÆqÃÝÜî¦+í’½ñ]9“ p5žê¡LynÈ*—¤Ò›7OžÜLƒ»z9À6]ÃÓO‹âô1î´ð?8èh4¿§ó5 Ó ML¿6™s#ÑÈX^s£,ÌÓ‘rŸ‰Æ]S±þiàk⬼kÚ†­Ÿ-£GHžz&ñw~›Ä™þÓp‘•ÿwã³î¦‡˜~jÐWš¦^pKÙ‘}S¿®þojøÿF|æÂ¸Ÿº˜˜ ~IiZŸÓ§¿–  »(€"ø.â"ô½) +_µß›APÓŒÉô¸ýþ,eТMJ©l!w£×‚9eJ¥¢(çxAWZØug ^Ë)S(J²ÂÒØŠ¡ÎLò¯°¥,3ì«lš¡8°~M“ ík:'Aèû ˼x¾BcZ¢p»Xææo²‹”š²_Ðàà±2¡àÎÌ;UTp Á%0FÀ$ýBæ²u“'¬Ù´iM¸xÌ*mm\’½##§ˆ9º?èEórë/"·Á4Ä)gÁ£z1iß2n}ö¤ë·³s`ò¼ÓeІùÕoɦrübáé’’¢¢¢œM+ƒ‡,H ‰O 0ù=:?ÎÛÆV­(ˈ{?“eÕMóhP2"lËŒ˜·2yS\”ƒŒ†Þ¨6•v÷õg™‹âvZÉñ¯W&²¹ó5æl©ñ EãÆ_c¾9^R´cåAÄï`4ÓÙ\4iº¸•{~¢bS[r­Ú¹ÎɲRv%¹¤¨ª<~$_÷x`µ×£¹ËܾOù!býxÒzؔެX¾bÛY…RUq±äx!7ÏlŬòÊéËõêWf¾/îvãýØEHꢟ³Ö³Šf˯ü#2ñTY•²èT~ÎEß¶e9ðMõ_ò¶.“ùkoÍÔoÄ  »!€"øn¨"&Z" ¦‘\íâè—”¶”%ÎxgWé„wŠ“VÉ:ÛÛ;¸Ëí>OU278ÈØaYg—!ë‚bÏþ;€>;ÄìŸ6Ä],v!ߟÀ×Àü/º¹ƒøE:âÕ¥lUPñ¨laÀS·ƒ{÷·Ìá³!îöâÎA1lKî £•zŽ^íÏf rï9<=6~¡®­dÒGÅ©Ke©3fäxlI¥éÜK+ vÊèpûáÑ™«Ó§;ëZë¾»YAÅñR?îI^N#fÓ„‹¹£ø©|íÏQ‘4ÇyPg‡÷²¹ ÍÚúšê,n¶ ¿]ø"¦¹ «‚¹¸¸»»Ëfl•&íÏßîcÔ€V¥£—¯&L‡Îoz, ¢Qö‰ü-ƒ4 «kIëܪSÀRù–ÕŠÌ/Vgا¥ÇÒ9qµ©£ïæc©,zL±ØeÐ Ùêôµ“fÚûCؼ读<±aXt6÷ŠOn«•Ìmô„ƒÏwþ"v[ÜÏ•Ž=ž½Èc]ì·]F%¸LÙ¶r?7xìé?øqV<ì©OßÿY“æ¥/¦}éÕhÛÙ3¬rÜŒÏ=_/š1Ú!+mëøÐ£¸mKÙãöħžé‡Ëëø@-Ê+©¥†¡}õåßröþF•5@w[ ù—eÜí -ø§½,£ÉÓV*TÙK…ê@çíÀRª#=Õ æèh2(©Q*hú¬X*ÕWd sm(X½'tk4½^FSQ¡°—:íÔ(*b“-Œò‘H…~+‚;DtÙ¢N˜ÄU.ô6š‰êÇn˜CS[Ìç×Ôæö)ì7ˈäkbN÷Ó(šçn8^£ÔÐ[v¸Ï;¢z]Î­ÞØWKÉ_qÇ¢´`Í\4Nºþm:”²JÅ$¶FKÛ\Y¥T‹ZI%ºÚ¸±(UEU};£§µkT %³oÇÍí­·4ÖcªŠ«uÒö\Š«J{~…;V©RhêÄ£àõ" æ`¶6B¸E[}YFÿ÷n±C4‡î‚UœÆE­Rήިf"GGÇú‰ê5­¿Ÿû̵i¸«€¹ ‚Ф º9õɰAÑò Â”9óO?;Nûw½MGdœiÃnZ°Å|~-8Ph¢<`?ˆùË23Y|l/íaz‘ö' ³á4EÛíÝ'Ë‚Bº¦¤ÉÙÜT¹®¦æúf½Õ梙‘n&¬¤ù2WBum3‡ò»E¶ŽíMÛ‰l¥¼ó£±¾hZ„JaC8‰­™ÿÌ »uk sÐíÁw@–@lImôÛ°ÉÏe[T`Ü^Í%{~·|D^YÅuÕܨAƒ}œŒ*Ÿf½ë $²”Ü,ùÙŠµIô µ[S¹;›{ì\IéuUØJÙ`/ç[;ü®Ÿ:€ »&€"ø®Ñ"0ÈÙ£ï v[DR'/_swÝÝV´;}ȹ¯¯óm IÜúú¸Ýæ±wú<€,(€ã,ˆ® @€¬CE°u\d@€ `AÁÄFW€ @Ö!€"Ø:®²€ @° Š` b£+@€ ë@l×Y@€ XPE°±Ñ @€€u ¶Žë€, @€,(€"Ø‚Øè € @À:P[Çu@€ @@lAlt@€ `(‚­ã: @€   ¶ 6º‚ @°ÁÖq @€€P[]A€ X‡Š`ë¸È€ @À‚(‚-ˆ® @€¬CE°u\d@€ `AÁÄFW€ @Ö!€"Ø:®²€ @° Š` b£+@€ ë@l×Y@€ XPE°±Ñ @€€u ¶Žë€, @€,(€"Ø‚Øè € @À:P[Çu@€ @@lAlt@€ `(‚­ã: @€   ¶ 6º‚ @°ÁÖq @€€P[]A€ X‡Š`ë¸È€ @À‚(‚-ˆ® @€¬CE°u\d@€ `AÁÄFW€ @Ö!€"Ø:®²€ @° Š` b£+@€ ë@l×Y@€ XPE°±Ñ @€€u ¶Žë€, @€,(€"Ø‚Øè € @À:P[Çu@€ @@lAlt@€ `(‚­ã: @€   ¶ 6º‚ @°ÁÖq @€€P[]A€ X‡Š`ë¸È€ @À‚(‚-ˆ® @€¬CE°u\d@€ `AÁÄFW€ @Ö!€"Ø:®²€ @° Š` b£+@€ ë@l×Y@€ XPE°±Ñ @€€u ¶Žë€, @€,(€"Ø‚Øè € @À:P[Çu@€ @@lAlt@€ `(‚­ã: @€   ¶ 6º‚ @°ÁÖq @€€P[]A€ X‡Š`ë¸È€ @À‚(‚-ˆ® @€¬CE°u\d@€ `AÁÄFW€ @Ö!€"Ø:®²€ @° Š` b£+@€ ë@l×Y@€ XPE°±Ñ @€€u ¶Žë€, @€,(€"Ø‚Øè € @À:P[Çu@€ @Y°/t@€ »(p“_êêêè;}Vhºv _é#F‚ïâe@h@€ K èk\}á+ÔÁ”­™»0lÉ낾þQöœ¸dkk«R±OôuÄŸ¦ÔõÅÉ@€Àÿœ€qáK%ommmëÖ­i£¾ü¥a¡SÃÿ¶ÿç®/¾Ëʼ(_Ï &k¬¹œ¥æœÞWZ¸óµÉ 2…f«³Êûú:6v¶C€ `*p©]¡Ë}§:؆_„úXØ…‘` \ tñ?( ¾Q(gÜ?/—ohh§ØÎEßD"Ö¯b€ ¿A€êÝV­Zé+`á£PS6´‹Öi£†_¸-CŽèÖ, fÒæÒ³s¿BKÛÐW™Œ3và·4wÜ­îWHXàmc•£¼ÕÛnWƒ7Ý5öB€î¼ïR+Œþ _é#-BÕ«V«U*}êÓ!îü5@Ä€ÿþòü™†ùÕ/"ÿç¦ïô„›Óô[ïÆJÁæ˜Dí„‹F§gÜv¿w5ømg…!@·'@½BL+¸¯°…6 }¤ ˜jb!>ŠàÛsÆQ÷ˆ€C[¾àªÞzç¬(:~(÷ª­-c*ææ;ÜCwcœ~;Ý0ç94À;"û»´´¬?ìÛ»MŽ ï+Â(rdfîÍ*,g:°êjû®n½ûy õóÒŽC+в=rEßgJúîvP±öž~>nú­­(Jr2ÈÌ:YHÑí««Yû®=z{ ê寇oapeÙv¦gždîgç ˜Ç#“¦Nô":VÏ8z•û¨bm=|Ý* ²Óvþp²°ÚžUÛ÷:}ú$CëͤgŽ5@€@Kè8¥’ûµ)»ÂH0­ÐGª€i<˜¶Ð:Á …¢sçδŽ"˜°@àvN§-ctcÜbÝq&ÛÓÒ®¾´J;ÁØÔóáLÂy;B=ƒÒÌôéŸU™á+”©§Ó†.0n=9û(‹-?Ùä-xŠ+CƒbÌ„—­Î:¹Ø—b(Z¼,;yê0í0´6ÄUÑaK·Èßžä¥ÝÀÅ:µ(0PÛ,(6}ÊÅ13Vö²u1²TùÞé^ú”›OÏèp¬B€Z*@¿¨¥"˜z©ö¥‘`ª}…RXx@}¤é7nܰ³³“J¹ÿ×¢n©,ÚÝ“RÖøoÝg¼=:(ÈÈÍ[×äŘ¯€þ…Õ‚­‹ÌVÀ²c‹oß+;°¦óðh³Y¬š,³ß_úªŸ“v¯X¬½=æk¤-c¦ö–ÏMt-Ï Y%´Ü‘ôÌ&†€ p PÉKC¼ÅÅÅ4ÜkÏ/TÓBå¯0¸¦¦† âîÝ» #ĸ1îÿ§ß´€<ïTAIQQ~)*3™ÜôÑú½²… çÊd]Úˆ™B¾oaûŠüòjú“Y]YšlOüêgºÚk÷IeaÅùÇVfËRåŸÍÏÏOÓ©êí(v§$ê?®HÏ碫«K‹ó÷¤Æ>3 £°«™àš‚·*à…©ÇÔ7ožÝ«óî7 ýýŠþq²ØÔ¤¥ÆÅ?Ë|wãq¾a‹ÒÓ‡Ä  @ åTìÞwß}îîî4Ü[ZZZVVvåÊ•K—.Ñ:}¥â˜xzzv iˆü‚‘à–Û¢å=( Ÿ1¨§éif,˜noôSHüþOÃý´3iú€ñÐrG;‘TBŽER'Ÿ£ "©³G?×îL÷¬6Yß~nú(F MWÅ»Sá¬-HílE\t&rrö˜ihÙdð¢ï>4”és·¼3݇B¸ùE¦/\?f9mó/áÂÈ®!¦°67©4a&7J<=¨wh‡°íþ´íG+"}YËÒ«Ÿ!@Í 7ÃÑ@oÛ¶miðŠæþVVVÒ nß¾}Ÿ>}z÷îMë4?Xˆ…‘àæMÑ·-´zÿF£ ˜â×À,3Ú]ì·5§¨Â\j£ füÉh‡éªºŠžr¬[¢ݽƒ£¶fäT˜y¼šq8“à• u¸ïÅ%Ü@xQIQ•akæ‰Bs Ë–ž*`®¥ãÄ(Ãà1Ë,-B¿Kž¶nr ìÊV¤&þ{ºoóCÉLSVª?š±ÄÉî†éFÛÍ®vwë`´]Úk͉Ш0⯧gÔV!@F4ÓW˜ìKup§NhRÄõë×i¿°Ñ¨¡vEpCl€^ $ö£·½þŸ’uÃ)ÄŽ3·—Ú.›:c•é£Òb†¤Å¬ÞS¼8ÀYßým¬H}ÂKI§ša]3cHÌg±gˆtkætª/ž7 6›ƒÒxYߢR¿Æ¯ˆÅÆÏFŽøËé™vO€ s45‚ѦM›Š í¯.i¸^5Œéæä° ZÅê»aá4ýíŒòü¬øsëE|#ÏÌÔ®•Ù²³ÞáÂG'Ÿéêò¬´ø¹þ¦û3,ÿ:Ït“ö“Qp©—áv<6wKqyéYº›Àh9{öìsÞŽfãoÔ\ú=Åð™»)PXn#=C¬A€îŠà;‰0ÿP]åvçOÏÑÃ7üÕ„›ÕÅi«CŒ¢_ºfTm/T5S6Ú]Uäè;!#vtr£ÙUF‹›››£ÙyvÆ\E‡~4ôåïãn|È­¥gƒ5@€À@|§$-ÐTÈ.0ŒöJœ',^lT¦š©1|’›¿ÍÐ@XÓdÈ+3„wöšðz”q‘m8 ±à^ã# ùdFO]¹Õô±pÊ¢œœ£:Ù1íýÄEÚÙ¯Ï0Ì&š:˜Ÿq éÂb € p‹ß}÷ݬY³æÌ™9oÞ¼ˆˆˆ­[·ÒŒã0ÍL4nŠu@௠Tî>„Í]:é‘Þ];¨ŽþçcÃX—ûŒFSïb]0hdáêö5×Îl|^oõιÃÈ™,hG¼{wU]<ú±þAeŒI;µÑŸB£ÁG¸ÂxŒvRqfÌäÎ1²…+fÜoWs¡àXFbe»:«\ÿ†<}@z4Û‚áîÛ箞3BòõŒº[âh¿äS>|³[HÏ(,V!@-З¹ûöí£G ‡Ñüà±cÇÖ›Œ"¸E¦htO ršŸ›ð—8„âSž¸Jn)ÕŒÝÿf_ôiPL,½†M·S¾.šêOÿ …3ÝŒï8Óí¾Ûuä¾ËÓé_Ó=thì{Óûê66ÜïÕÍ©åΞ ÌÇ[cT¨3ÖÄ»ç2£3M{^‘þi€îs-NO—&¾C€Z&@5®¾Ì•H$'NLHH¥uzBp½{ã0¢e®hu ˆ»NÖp;—a›nMlg4ª*6ü<ÙØvá8û®½æú¦è‚1YÈŠ=ùå‘ú×ó;}"ó÷ÄӃƌ£‘b£ÍÚUû~Á ÍDgþ+’ö”gDêjQ®u“Á¦¿2jH½[ëø^¨ ïÝÑ܃âü—¦mYmÚ{Pê±âWG{h³c·žî|‡ ´H€žL‹¾©¯¯/½ ƒ>Òë3zè!¡>ÖÓv›óewåîw}XÀÈÚ·“~’»SÑþæ8eEEyåj w»›È¡s'©a¸Anʲ¢â+ÕLloß¡KgG‰¡ànÐR &* †IDAT»A©¨(WTVWóÑíº8;5½™àв’Ò+•L,¦Ç.¶qpJMûWµ”"të_.Ñ(JŠK«54†îàâál¶ß[I¯±SÄv@€€‰À‘#GèñÀ...ô?,~PØæÜ¹sK–,‰ŽŽîÙ³' Óvzt½1®ººzóæÍÍÿßÔ$<>@wD@$qtrnþ1cÚ¾$Nnƃ¸Í¦ ‘::K[¾™àR'gú·Ù…TùJèÌML×àÛÝJz-ìÍ @õèqFÏ=÷œ»»;ÕÄ4HLÃÀÂ"´Ãtˆú^ø @€ ð ’·ÿþôU_ÓIéë`Áÿ€KŒS€Àß' Vë;¿RsKÏ2Ö‡@€À_0®t…hƸÖ¯ S‡1⯛#îaû ãcƒ¹g+Y'_s·ËÝÃ88u@° Õ¸úÞ„áÞ7n+4˜šL ¨F¬‡Â  p»"§ á‘·{0Žƒ Ü1*s…WÍ/T+•J*|…›ä„"X ¦uê#ÁwŒ @€þ.*m‹ŠŠ®]»Fµ/M„ Ú×ÎÎNÌ?݈¾ +­[·¦f55Üo0mú2}éß•8ú… @€€EFŒ³Ù}ø‹ô…N @€ `…¿ݬ3L"¶Š¤ @€î²€H¸?î.÷‚ð€ @°"Q-F‚­èr @€ KPÌ=$âv©©RÔÚKÛ´nônœÍ=çØ»ï}·hôPì€ @ø‡ P\×è©©~ÿ‰™û´»{NZ¸hÊ8o[vãû¹W£~˜ê)môÀ;¶£FþŸøÏ?úêìÀ蔵ÁíLÃÖ^9¹fjD6mìñì‡Ft³5Ý-|ª.˜ÿœ·¿=ÒÏŠâ_°9äeöêö©}̶A€ ÜyQ­¦ñ‘`Míæñzê§ýÚÔ\ü=#rIDi« Fy y}³Jj×Ôw,Ϻv®~s–‹—§*™†®±!²*ó툛/¥nå–›úì‹_>¼m†·a§~­•øaæcCÇþ¯s-J‹|Iõ¶Éfª[Uá–iϳ/wM¦Ò½ëÈ·ã[;YÄSï‚@€ pO ˆèåÔÒëçÄv"f+êê5þý¨“Qïýøt Kþ7([>Ò½ÍÅì ‘+ÖÓáƒCÞY0Í×Vu&ñµM®Ü—”°…ÉfǽñlWÛÚ½G¿³…1j6ï£è(åŸ{?ˆˆ9JŸý#?ŽœÔI?‚[%gɾé±ó]Z³ÚÒ½o&TF¿:¡›——êìï¬ðf]½yª3™'|æuWÊß}ÈXöÂñЧ½ g¢8øidÜö~ð‰tl-+ÎÞÅgë¾.|‚u«üóЧKP#Ù¢/V=šµv½Ë ó{Ù³âÝk¿Q?5LâÝl*ìÔùÌ';åì¹5ŸÙ^E1Ïú𥉲ÖìêÁO_‹Û~‚Éž{cZW[:êƒMÅ÷wË‹ûœM‰ùr‚sîKŸglöÄ3K¿Xøë†¯ùúu²âË ^š”çci}ÚèÜÕ[—Ûþ²u'›0w¤«>³uÅ̯å´gBLRä€Î¶õbNòu¡}X @€þ¢@ÓE0wÓW}òƒÅN}flç•*õ•_ªG¨©úuò]·9´‹ê§i¡ŸŽܳµêªü‡Ýö/}°ñ‹Ý¡ÏÈßö`ô;ùË×§÷¶-L w]¥®UMŒˆéõææ—ú·ÉN?/©[Êœ‡µóuíÝzn9|ê™§úIóLVx-󅯺–{ˆug2dÍßЧRÕÕ¶f­ÛvcìË U¡mus*~ŠûåѶ&²üíó—TÕÖ)ϧG­8N™ôµ¿:}Vêý›Ÿñ®IŒXÊæÅ%=ÖKu­¦U­úúå Ô’N¶ºêÏ"µŠzTÕ\8º}Ë‹q[W—|½xΘ—?þøÜ¼yiçž :°&îjpÊŽµ¿~¸ö»WïÍ5þz‹ìÍï^Ûòòн£vL\>½Ç›ê9 “¢é8xþg!=jO}¾dïÈÓÆ¾9kçröîÆÉ]lëÎ]=ý‡ZQ[«<ôÎÌ,Ÿ÷’Þô.=üItXÒ;žksZÛ¿xÁq8 @€½6YÓÄDZ*?oÒLaÆ„š›=Ì}¤Ò¸®Ž6j¤®ÝþÌÉø.—Æ;»2jÆj¯³¯¿ôD{[UÖl¥)=û1¾g± sïE[ê4UEÙÙ¸µý;ÒôÙc ÙüÓUa>ºÂÎÞ'êÑEé¿LèÓ#cÓ™©É=„Ü4ü¬eZ7™Ñ`’› c×ôyRÁ|ú§o‡>ùEûÖ7YO™';@»ÎŸ8 dr“=02b`ôï¥Oµ/8È®ÑÞ-ºO|³VQGÃÍüÉRM«Ô£ª¦Êõ™O|]Û«ëº0öÂSÃzHTµž¬¬Zu£<÷ »Üþ?_ž¹¸ƒ›V£o<²gGu5&©Vmì\EŽml[ ómOÜùGî^6`ÂÍZ¸W°;´£~5|w6šê‚#Ù,xvQíMç‡÷d«®T…µæ0ŠiŠ€ÿ‚!@€nK ™‘`¾êÕŽWdÌ»£mÝinx˜ªáòï^žrÄkÑÌ¡\¿LçÆP_%s£³jßF}½œÙÒän—ªH8ІuÛ Ï¤ ‘VÆÄÆC¼¼G¹¾ÿ}ö#ù™Mm§í—ó53L¹ÙPÈZ¦./dÌF¬išCéïÌñ E¦®…S¨S]gR Ÿ S×ÝtÝd" •ÎÂX2Ow“š ÃÞ64 „+ˆë¨VTüƒä¸TµÕ×J˜gÿe:õ“ ÓÞÅlcµîpVùëêY/¹¾°æ¡™œcfú€T³ó?UPò7è5ÖÜÙèÓÖgbHà¶.3‚ @0 ‘`“YÆûøê¬R¥¬®¡ °göEÿßÎÇo°§ Ž ®Õ\/>\Äž~-ЭúàŸ¬’êC WÙÝäVtmÚ»b½v(ðs§â­©Œ…Ö1Ñýž}ÙüßÎMñu±Ï?q ߊF_õ½Ú÷í·øÃÿcO¼šBå¹°]¥ª¡ýÕµµ4d˘ªèç}ì~ÿþ'3~>ê{᱃,x:%¦‹cÛcX÷•ßeê÷صc¹ŒÒ­mßûöùÁ?§>x¿í•ßvt jgÓ¡÷V˜u⬛¯«²òZkÛº_ÿv¦ÜµÓéøÏO¶›YÇÝMÇ ó+\íËÝ›Ç ÛrçhÛÓï‘ ;Ëžú=#ƒ¦N˜4Vé×Tþ©¾A»”¥¿å²Ðç‡{UÛËŠ¸€Ìè¤h¼¡5­]z€eçüé5ÌU‘÷S.ó´m]Kµ¯6}L  @€À_hòéµu÷±ÂÕÏñ=Èf,ûtxÿ޵šêV܈)Õ¤Ýp_;k ëçïû@áÛqßÇÎï~“µáÅPÛªצ•룯¼p)yÉ,§ a~Œ]¯UÕŠº?»,léKO}Ê ZòÉÃ4WÀ¨ oÝÓo;PòG{ª+©ô=üÞä Ǹ¦QS{eýò$ªß¿zïÐÈX/W‡ŸëÄ‹³æp;§¼‘<€oÏ} ¥ËÃs|S_‰œú{À¦jPÕ)v5mÍ«¡ch¯KÀ¨!©ôÿÆÂE¯Íý‘;bÈ+ë—v{fÈ;¯=Ɔø b¥\™_kSÇÚ¶æ‹z*‚s¥.?.MçØyØ‹ÏþþJÔÔx:¸Ï3±/=îahÌZ³ÔÔ¸ÓÀIìßÿžS°0vÞƒìÅÈ©û íÂâ?Ëðü#Ü–¨©g^YÿrëÚ›m[Q/¶¾/¿•³`îœ(¤û³o½Õùfm±>]L#+.o,€ @·*@Õ¬ÍÇw´ü°:¥ª•Dõcètõ뛞ðàžÛ«V«ÄbzЂªFÝÚNÜàµÕ×®³ûì™òì¦ç"»¯Þúˆ3ÿ0ˆZjÏÄ[Êà/-µÕŠëµšZk&JmRe'ÑÝ+Ç7¨S«ÔŒÙq ëÓLÔÊj&±7M×Þô;µ¯kmkæÄõÍ(~ S«¦S&"uµº•=OEÖÚIŒ’ᎪU+U·”ƒ¾+¬@€ ´D@¬¼Ôäœà1J²?XõÙ>æ9m¹Knb+c­Z D¢VÜ´ÝúG¨/~óÂîihŒ }ö퇺軉Äü̉úÜêg»6tW7ç¸áb#ÛÕO©•ˆæT˜n4ɤ•Ø®‘h ãs[¨=Õñ¦ëµÔËØ´ˆZÑ!4JNÍ(C=ˆþ(›[ÍA$V @€Z"@#ž6ë>ÿ¦%MÑ€ @ÿ ¶µWDô<„ÆÉà, @€ ÐB=— …MÑ € @ÿfðO8œ @€Z&0mÚ´ÿ(´àtz”~IEND®B`‚mock-1.0.1/html/_static/scrn2.png0000644000076500001200000035506311532040043017304 0ustar michaeladmin00000000000000‰PNG  IHDR­3dÜhžiCCPICC ProfilexíZuTo·~gNr8twwºëД´tw(”4‚X¤ X  ¨€ŠÒˆ ˆ6* ‚Š‚‚RÂôç÷­»îúþº÷¿ë¬53{ïÙûeÞ™y÷ÙÏ@ì¤gDD  ‹‰²1"ó::9óâž €8 žÞѺÖÖæˆÉؾOhW5.µëë?ý'1]È1`ôÿ}v±×o·‹ÄDÄ 6»Ø;ÀÑC5–Œ²³ÑCð=ðDÿ_˜âÉ.öú…éÞíbOÏ(Ø–{^OO³ÓþÆ^»˜´‹÷{û#þÙ‘1`éÃ|ëåãí €p=bããí €˜ŽèÅvwDr­²ÁÝ{‡œ‘m×·Ê0â#üß²0}šÚßÇþ-–€5€‹bÿ–}³»÷b~í'/÷ËD$€™ÞÙù& î?Kvv6Oïìü¬õ€îïØ¨ý¿lz÷„@à@H9  Ô0¦À Ø'à¼AQàHiàÈÅà(§@=¸š@+h  ‚0&Á3ðÌ‚` ¬‚M‚p¢‡X!nH’€d!H 2€Ì È ò€ü P(J‚2 <èTÕBç¡ËPÔ AcÐè5´-C0 SÂŒ0',KÃʰl Û®°ÇÃp!|®…ákp< OÀ¯à𠼃" ˜P¼( ”2ŠŒ²@9¡|Q¨$Tê(ªuu5€z„šF}D­¡Ñh:47Z­Š6DÛ¡=Ñáè$tú$ú,ú*ºýý ý½…¡Ä°cD1Ê#ŒÆƒÉÄ”bê0W0}˜qÌ[Ì7, ˈÄ*b °Xl6[ŽmÄÞÂŽb_c¿âP8&œNgŽsÇEà2pÇqçq7q£¸7¸<Ï—Á“ñø | þþ,þ~ÿÿƒ‚HÁG¡DaFáAK‘GQCqb„â5Åw‘ÀOP%X| I„#„ „nÂcÂgJ %¥¥¥7e"e)e#eåsÊoD"Q¨It †³‰µÄÄqâ"–Š—JÊŽ*Œ*‡ê4U'Õcªej"µ5™Ú:Žº”º™z˜zަá¦Q£q ‰¢)¢i¤¢yG ÑrÓªÓ:Òî§-¥m¡¥ýDG ¥3¤ó¡Ë «¥ë¦{E·MÏE¯AïBŸ@_Nþ)ý:ƒ*ƒCC9ÃM†ç [Œ\ŒZŒûÓO3ö3Î2á˜Ä˜Ì˜B™Š™Z™&™~0³3k2{0g0ŸcfþÌBÏ¢ÈâÄ’Ìršeå+ ««k2këë"› ›;[&[ÛÛwv.v=ö öbövöi,‡‡GGÇÇ7NN=ÎΣœ·8縨¹”¹<¸ò¸®p½äÆr“¸¹3¹›¸Ÿð x¤xy2xšxžò¢yI¼.¼Ù¼Wx§ù|Ê|Þ|‡ù:ùø™øÉüüUüÃükB¶iÍ/‰‚j‚‚'W……ì„2„®ÍÓ “…£„ë„ÇEP" "¾"ÇE‰Š‹ºˆŠÞ]ã³Ë».öIœGÜFScQ³S;¢ö@JÝL=WýŽVC_#C£WÒÔÑLÕìÒÜÖÒÒJѺ­µ­­­ªÝ­ttuÒuúu1ºFº9ºÃd"Ù’\B×cÖsԫЛÖçÓ÷Õ?¯ÿÉ€dcÐa°e¨c˜e8lDmdkTf4m,`hÜl¼j¢n’frÇ”ÚÔÞ´ÂtÆLÜ,ҬØ››?±àµ°h±Ø°$[XNZq[ù[µXmZX¶~ºGpOØžë6h+›r›Y[YÛ$Û!;F;»Kvëö†öGì_9H:$8ÜÙ˸×kïå½ÛŽæŽåŽ N*N‡œ&cœû\\¼]Z]Q®¶®u®+núnÇܿܕÝsÝŸí“Ü—²õß#ÆãŽ'›gˆg—½—¯×uo¢·‡÷U¼«O‹/Æ×Ù·Ùíçä×ìöwö¿€ p h ¤ÜØDäÔÌÜÂ2*š:&–ö:\-¼4|1Â(¢6b3Ò!òre”_TO4gt\ôxŒLL~ÌûX½ØšØ­ýNûÛ0ˆ80'—÷>Þ ¾.NðHèJäNLN|‘¤‘T‘´™ì’|3…#%)åEªfjuêÎAƒ½iiYiïÓMÒ3¨3"2Æ3•2Ë2·²<²ú‰Ê?ô%Û.»#‡+'-g.×<·%9/)o&ß8¿©€± ±`¦Ð¸°¹ˆ¥(¥hö°ÅákÅ\ÅYÅŸKJºŽˆ)9²QêSzÿ¨òÑÚc”Çb½>nzüÚ Þù'~œô:9Z¦Vv¶œ¾<¥ücÅÞŠþJÙÊSUĪøª÷ÕöÕ}§dOÕÔÐÔ$×|ªu©9­vº¡Ž½.¯n£>¨þùó3g¥Ïž:G{.ýÜÊyßóO.˜^èli8ÝÈÔ˜Ó¸y1üâÛK—Fš´›®4‹6W]¦»œ}y«%²å}«[ëø“+]W•®^º&x­¢¾-·jo_îìxsÝùú£f7úojÝlï$u6ܼU}›íviuWn7º;µ{£gÏrohïBŸ_ßLÿ¾þNSƒ¶ƒïXÞ¹7d:t÷®ÑÝÁaƒáþ½‘Þ{ä{=÷uï÷Œ’G{è=èÓ|hôpè‘é£{ã–ãc¶S“Ž“Ï§Ü§fû>^xúdùiìÓg©ÏQÏs^P¿(}Éö²zZpºá•ì«ö×Z¯Þ˜¿Ÿqž™yôö뻄Yx6Ža®ò½Ðûæy•ùÞó…©>|Œý¸ó)o‘y±ö³äçŽ/ú_Æ–\—–c¿Â_ãüÖ°¢¼2°j»úæ{ø÷íkk ëªëw7œ6æ7ã¶ð[e?Å~ÞØ6Û~±ö7ø› üÍþæs¿¹Àß\ào.ð·.ð·.ð·.ð·.ð·.ð·.ð·.ðÿ·.áåù+@!GØÏ€¯ç r€a JÔÿVÿ›GùmBbìKh@‹ðf t@0d µÀ.r]ô•8¥„œ¤»T¾t»Ìœ,ƒœª¼B‘b‹Ò¤ò¦*›š¢º‰†«f´V¶öi›º“ä%} aC#/ã“ Ó6³‡æ‹–VÖZ{lmBmsìºð{M‹œº0¸îq+rñÀxêz%z·ù|õ“õ h\ VI½N!©eí³?6ÍkqÃñoÖ“h“ESôRÝƧLoϘÌ\ÎÚ>ô-ûEÎ@îå¼êü¼‚øBÿ"‡ÃzÅR%L%ÛGfKïm8–sÜ÷„îI±2‰r• ƒJ«*»jûS¶5æµ:§Iuœõ˜úgFÎ6žË=ï}A«·‘ý"é’A“ssðåø–ŒÖ¼+‡¯_+n+jÏéH¿žx#æfxgÀ-ÏÛN]–Ýz=J½¢}ìý„þƒÏï ݼÛ8\6’/ñ~ب÷ó1¡±ïï>ª?8á1Iž}L÷xóÉÜÓ±g7ž×¿(|3íøJû5éè ï[úwèwK³“síïKæ}H kÚ>F~ùôt1û3ù ×oK–¯|=ñ-iÅoÕá»ù“5ëu¯ÄÍS[£ÛðŽØÎ2ÿXÀ ôviaˆr¡58PÕh `p³øU+¥.1…j€†ŠÖ®ž~…Qƒé óm–56QvŽ}œ\Îܶ<6¼¶|Îü~Ñ‚iBG…DD_‰­I0IÊIYKÉdªdÛå†å_+¬*¡•©Uª(ÕMµõ%šï´^i?Õ™Ô'éÝ×1240DªÑCfCæ#–_­y÷˜ÙÄØVÛ ÙÞËè¨æäîœîrÖuÄmi«‡¶g€× ï>äYô·pt ò ö  K?Qy*ª)úvÌXìÜþŸqLñr Ö‰aIùÉ)'Só¦¤E¥‡dxgºfÙ²ÌÖÏQÊÉcÍGç/Lv•Þ_ìTârÄ£Ô÷hÀ±€ãÞ'\NZ—‘ËI•èÊU÷ª›NÕÕšœ–¨©W;c~Öý\èù„  ¹…‹/7•4^ÎoÉiͺ’y5ãZZ[F{ò<¤ÝH½™ØyàVÌ툮€^ÿ>¿þ€ Áð;†î& ÇÄ!OCêh惼±#+oš¸6ykjàñÈ“‡O'ž=~¾ø=ÍýŠôZÿÍŒûÛ wQ³qs‰ïSæÓ2?ä~,øT²XþùÒ—‘¥_IßÂVÚ¾ƒ†kYë×7^l~ÜzƒÔ!ãv8v Í?ÐI`ƒ°‹Cä À²pJ5†ÞÃ|ÄvâŽà#)\æ”d¢2•,µ - í6Ý<ýC=c$“Óæ–V1ÖÏlíì9L9Ù9¸nrñxñªðÑðÍò_(ô’F OˆÔ‰FŠiˆCâC’VRLRSÒÇeH ¤‡²…r†r;òm !мŠJÙÊêÊ‹*§TmÔ0jƒêE{5ù4?i]×>¤c§+¨»JÒ«Ò1036‚Þ÷šÔ™fšš›[ˆ[b-g¬º¬«ö$Û¸ÚjØqÙûww÷^v¬pÊvŽqñsur3w×Þ'åAï±âùīۻѧÌ7×/Ñ?2À/Ð9È"X/D9T<Œ#œ"|5âMäxÔdôtÌlìÂþùoâ&ãû.%IŠJ¶LLù‘z÷`YšOºlúNƃ̺¬‡,²³7sÆs/æåäûJÑmž-/é;ÒVzöhú1‹ãlÇߟh?™_æSN®ª$V®U-TOŸšªyT;zz¬n¢þá™þ³WÏ=_¡¾¡¡±õb雷¦÷Í[-4­|W䯒¯Y´Ùµïë8z}ê&g§Û­S·_v³ôìéÍé»ÙÿqýŽÁPä݊ᾑO÷EGoŒ¹=ü:ž>É9uûIð3¹Ór¯¾¥šÝ\HXlüº¾!½;ÿ¿ùôÝ5«ÀI_œ²°e ÿ§€…€5vªX°D€\Eÿµ~°"̵)Øb@¨D8é^0æÀ:D‰°Îr!ä …CYP%tºÍÃh˜&ÃÞp.Ü¿BÑ tQ1¨ó¨l„NE·£—0âL-fˉuÅVa_ápA¸Ü:Þ_ŠC!K‘Eñœ H(!,RZP6"ìjñ•2Õ)j,u8õ3#šk´Â´'é¨èÒé6ècè¿0„3|fŒ`\`rae6`îDÍ&V Ö6 ¶‹ì²ìíZw8÷p¾ä àZåÎäaà©EøÇ>¾·ü±Ìƒ‚ÉBŠBKÈÍOTPôØYñ )‰¯’7¥2¤ÍeXð²l²œ…<ü…9Å%¥-äÛÆ¤&¬®¬aªé¡•¤]­3 ûQOßÁà¸á3c!{So³ób‹&ËGV;{H6!¶—í~:ìÙÛìÄæœí²å–ä¾áìYí5éCåkêWè?(”ü8T5¬&‚2ò`ÔjLDìâ ¸O Q‰›É‡Sùv¥;g‚¬³Ù–9[y— ö1~X’]jxtçø“õå­•ÝÕ·jnž¾\_w¶ø|JCðE·&ÛËæ­æWíÚ:ünØtªßVíVî5î,š±¸ÿ`,n\yŠã)óóÊ—ß^[Íœ÷ó½õÂñ£‹ëK,_¹Wؾ~|XïÚ,þéôëûA ø€"0® d€ t!OÀ؆‘ErAz CHOÁ{‹Áp \߃·Qò¨Ô)Ôš™ûtô-ôÂîÇb®a~`U±ÉØ^g‹;…û€WÃà§)ä) (æ æ„VJÊ,Ê%¢;ñ•.UµõiNš´L´Çè˜éÊþ»ŽA’¡Q—q˜É©—™ÌÜÏbÄ2ÂjÃú’-€m•=‹ƒ™ã§&çW7Ì]É£Äó€7˜Ïwá—çj½„„æ…/ŠDŠªˆAbÃâG%öIŠK®IõKËx¤I›²Ãròa 抚JšÊZ*ºª:j†êf¶šîZáÚÙ:uº=äOúl{ M™0›Š™›ûYäY^µšÛÃmãf[o÷ÍÁxï'*ç8—7÷—Öž‡¼z¼·|ÕýÒüG9ƒ¢ƒGC¥ÃކoF†D½ˆÙ{ç€V\[‚BâÅdÉ”¦ƒŠi·2,3_ŠÎ¡È­Ë×(x\]L_r©ÔòèûãéH¾ò¸"¯J£z¡¦ü´qÝÖ™†s®h/¦5i7o·ô_)¸æÚ.Ý1sãd§ÑmB×POIŸÏ€ê†¡ïïöŒu<º8Q?Uû¤ìYÁ‹àiÍW?ß\zë:‹š«'/Ì<¾hý…cõvuÏÏ›Ä_óÏ HÈûï ’‘¹o÷Á„…!}ÈÊ.A“Ð, »Á¥ðC¤Äuõ­†ÎE?AÞódÌ8V›…ÁéáÎá©ññø÷NcKÂ(¥=åKbq‡ê$µõšƒ´2´ïèªè]xæ¯0…1K0`id cS`Ûdïç(âtäâZæîâ)äuå“á‡ø \<)”"ì'b)ª&&*Î"“X—\”š–~(3Hêm”«‘/S(S¼ tKùÊ´êgµŸDM6-qm-ÝPrž^£þ˜Á¶‘´±I¦i¹ÙUóq‹u+Qk¯=§m–íLì/íes<áÌårÞMÏý…G¼µ÷Y_ ¿©€È êà ¡ä°'Á‘;ÑűÜû/Æ)Ç&¦&û§¥‰eÀ™‡*sÜ,ãnáÃÅwŽDe8Ör¹Œ³|¾²¥: †»ö~]âž³½ç}pÍ—œšq—o´F_UhƒÛ{®+Þhíºu¾K¨û|¯l_Ï€ÕàÌPò0çHïýÀ,cÃ’&ä'—_zþlèåK“éÂW/ßfÒÞÞŸežs}_=ÿüÅG©OÆ‹6Ÿ¿X,i,ó,o}½÷­lÅz·ÚôÝòûçIk¸µÒu†õÜ °qÉT7Ol®lÙlUoÍþ”úó³s½í¸Ý»#±slwþ÷`í®€ Åk®‡4RýŸn¡!±HŸ×¯9ÃB,w{»˜‘}ÞÇSß 9s"ûvDȯ>8Äb÷ ³·Ed»X2ÌËÒê¬åehƒ`äZÈ:"†¼‹‘µò‹ˆ±¶ûGž’ g‰`""?êmðÇOM§)Òƒ¨ykT¬=‚ܽßÖÁ´~—`·÷›_ýä0ìhhòÛ¦Œ1Ùňüã7Û VB~……_‹t|ù‚0¤'Ìè!¹ùï£ðžˆf?¢‹ÁÈ…ô†™!_Ýd¼ÿØéý‰á¯ëü‘ëþ»G^ä­ G¢ý‰ù;/óÏ@àƒà?rO$Æ®nwtÑûÓÿóÅ®¿_£!5’H[Æ„FË¡Ñd´&Z ­ xÑÌhv …V@« uÑÚhuD§ Á;ijÿŸ1îúmõÛ2<^Í!Ñîþï^´Àá—uà¿þþ#£ŸÚ?ýÒ?ù«'¹Ó‹ÌSåÁ]Ô'´°{úo[ŒoÜn¯ Ð ˆ ôˆáÕEº&}%yM¼¥%yåH$Uð_5ûÛ^xÙ pHYs  šœ IDATxì\SWûÇOvHX"CA@A"¢âžuÕYµÚÖÙº:Ö:ÚRÛ:j}[mµjÿÕj-ÖQwÕŠ{‹Š ( {C€$7Éÿ9÷&! C,XhŸóñMÎ=ã9ÏùžÛ—_Nž{Âûúë¯ &$€@H $а ÄÅÅuìØ177·NÜÌËËãõéÓ§Nl¡$€@H $ÐX¤¦¦ ¼{6wÑO$€@H $P'&Lp®Nl¡$€@H $ЈµZM#r]EH $€@uBt°¶V†dfRkK‰D̨™ü¢¼‚¢ZuÇÆH $€@H !êžn?X(tô÷îЪ¥³••…H(Ôhµ EqJzÖ­¨˜Ëáw’RÒ¹ù8:صmÝÒÝÕÙ®iÍ ³A+'>N‹Š‰‹‰{T[ÙÝ¡H $€@ÿ>¼Q¯¿Wã¬üÚ¶~uÔතݪj©Tª.…ߎ¼÷ [§ö>žî°[\i˘¸‡ûŽžºrãN¥µXˆ@H $€ž¡Ý¼y#§Ì«~°Î¾ Þy](Tßìék7nûýhØ…§o-‘@H $€@ÝÖ÷æçälm¬êPÃìmmðἺ]H´†@H $P[B¦†ó"´55¨í`°ÆAkkÛ#$€@H Z¨ù¼ˆ:?_X§ÓáÓrµZ$lŒ@H $PçjŽ‹ ¤ŽhƒÕÁ5lB×ù<Ÿ³A‡V­e)÷Š«Öºkï6VD•xíFt -v¬ß[µ¨s{þâúã9Œ5˜AH $€¨ šÏMãÕ½ÖVvX[ó¥›—Y•ùÎ0ʼôGçþغñt*W:rÁê·:Ù„o]²ä¾¤¬uÃȹu9}H€‡›£µDø`Ïç³{X¥_­_üùó±Í„\½âÔwË¿2L³Ê.´BâÜÌÆ–8Ûj5iÕ¶û7U¶6oÃÿÛ;/Øûß™ô¿iq.H $€(a)¢Œ Óe–¹ÜÒÖ¶‰­“çKï,ó°ùlþî‡P%ò諈4Ø°Š¾cFº€lÒñªö³Ýw¬Ž?»û|ŽËØQû¾óQòý¹¿$úVùÎFV 4ªªMWÙõŸ®;ýNf{?_RQƒ+Z Dè 6Üu¯a>X@H 4H5ï×y\¬l?XËP@Å'¾]{²„ÀÏv˜IZŒ~÷ÍÎâv¯¾=äðG並嬄¹©©•uot/„n)ä=Èm5iþ(o˜dU~º¿<¬µÆþñ¿_ާ«ÅÙ–ïõs}qBïmË꜆ÜÌBQRH¸ø °ÖÔq´J•×Y…—§Ö­ˆ‹™FWXƒÍ -Û°èŽY^Z L»†žX@H §&Ps|p=ÄEP÷„‡‰S’vï!W™‘¹r³ÃWo»Ší‡¿ìuè§èö/½ù^_Û‹?|¼ì¯lB¼—¬|½[k')Z—|iå;믱ýF/øzšoé®ßîö›2ÌY EŠË¿¿dûMÎh§qï/ßÑšöÊ¿ÿ ¨¹³mêåÿ{óÛ³´Ö®×ªÏ^ tfƒ3ÅíS¿½r’ëe|mþ›!oåžÿ¿é\B dÃ[A1¡_.Øsíü#­Ò±9Ÿm_é4iÍ஄h¢O„ÝË ¿J}rïõéý\›zºiOı=˽¸ö_<Ñ»)ÝM»sKÇžã Y^²) ëîAgIHÖƒ³«?ÝpͰÛêû”'÷q¶¢ a.o\´äH邵+{›Ýž;s=;PÓÿû²wó¬ïç}r8“4qΆiÞ7CÞ£{:Ë¡OÂéµÓ·K6üozk+ौ>ñsBXP„t7gáø®,F(ß>‡e×kóÚ×ɵ]ûò:Ìå}˜ü¸Ÿ—­ØS/öøßés´B6itws!“qÿ!Q•”¨qÔoÕÒs1Lûòž¶  “¢2aË ‹“n&ñ‘6qÖjéßÁ«uÓÀ«ôè‹1EÖí;··¤„@Ïw¾ýnL+‰¦ðÑÙ‹qÖm:µkÕkåO½ ŸZ^¸öõöÐ6+þFtãìê¢ÑñtZi‹ær)±¶`»"máh%•‰\äZ]:±[› ­zN˜¾ÅGÇ6ñòtë3ïdPì¹±±Å-=¼¼öÊo§wfPã+'´'Å/žsêÔÝ{À´õñ³‹#r[¹DÖgÒû`âq|ް™«ƒÇ¤™/þúÞ®¢ô´¬âf¶2AÞãälRT¤ÔêZT¾‚O¶4—crk³—©š¥×óÄ7$€@H k>¸®N5SÙ É;ƒw¤$.G ºhx´‚Ç#´{ò±ÏÝTäkÌ] ×’ZXÌÒ0âÂø³ÿûaZ‰îµE_÷r²nÝBsì¡íkÃ@«.þðÙÖð<¥H~qØœùCÝÁ(tþîø„äÞÞý寓ÅäÈÑ{‹WNvè0òUÛ¦G3(ÓΜ‰;ÖÓeìxÇ3¿&‘¶£ú8 4éçwÜ.5ºmÁ•N\S±S󌾋¦”NLдm MØCÈ•¥3Ç€Wé·-ÿåb.#²Û×~î—Ó\„µo k%!Åñ!K×…gK,Ž¿t«×ÔñîW~Í6šŠàÇg·|½+<§Tg.7+ÍHÕjœèaÐ^ t§ƒè踀WÇ1§Ü4…±?ÿoSxº²×œe¯x[¨Òo¬ûö×…ša,æ.´‘AK[ÖxáËWÿñ¸ØüdÁªeüúöÒîˆÎÔDþqËñ{JiŸ_½dáØÆ]£¹°{‹‹ûW¯úNÿðÝ_¥LzªF˯|Ÿlé@¨cð¿§X¦ª–žN@H $€L ÔaÚºNòUœ›fP É ’†c”4lb@Tê[ÐÇ¥4¤47™4}f?÷ææB¡˜n’Âsiœ®ƒæÅ§¶üræN6\'Âö©@#Ðhå¾nò I=sâÁ]g›%Í…Ý[š cSK.ÐDþëF\”$§?7öeO¡¼œ?D[°ëàí—>èî7`”vûšqûÀÖîíc‡‹¹¡©µr~Ò‚ Iˆ6hÔÄh™ë¡,UKô]\Ì!—y?òfõêa’Y’â€Ècº8)ühd"MzÖ¡«I ƒ];µÓîϦ3%Y'~ »_9CÒ¦ùr:˜XÇ2çòq'¶ýq5._K‚¨¤$ ç~?~+¾”î0.,øÌa$£¾üv-c“ƒ§ŸV¡¡+¥zôךgïe)Is†µÉ‡[yéi*>7SœÏõ©|ŸliÇ5g×½¦eªbéMî(½1|CH $€þóþçä@Wö™Aªè4†¸º8ÃúºÁkVR"tá„~Ç5+ÎÍ`X“6¢¤žNfFO¤Ð¨³Šô¦J®-5Ȫ>Mqvº!˜¡S¶<Ø-5¸F"$õÜþ¨™ÝÛ9¾з{€%)ŽÝu(ÎtFà mWù4¡BQ šRFà§ü –me 3n¦K¨HÜxqnÁ~Þ´V#°niU ÃFtn)+ëù1c§#Pe†àìq3¡óeíB‰YO8·yj&)Óô|®„µoè 9ã*[BØèl"2ÒÀ&;qF]pvÔË’q8¶,²¶ªYA}WCKÃ5/·œ•,=ç}™K˜CH $€©ùÜ´²ýÍ:Â¥ƒÝLÓ-_½YNÃhT™e•ýÞ^>Ì 6=³Nü~¥¬”íÞ¯›'(Çc«?ß“›ËØt0Sþ0± §–Á˜·“&2·QCl/Î AïŽ#Üf³VEÅŸÌ¿o7íîQ°öÝÝAœ«žt¶èþþóÚ q}mÅèþøÚ¡Ë9jS¡•¡¢{ØŒ*ÇÄgâìájKJnÑÍæô³Qéz8tÑI»ê ´´ÝÃ&“zÿ6Ì®M’ŽzGš¹;hµ!cÕcHKp d4Ì&1CCÚÈœ¼µÚd¶Ko?WxÏŒ ÍO}\Hì,šô{µÝÖïo±•Ü‹Dö$þZm$X{aŒXƒTnŽÀ•¿„–ù·X㺔³[·ÅpOòøº’t˜-»† Ãõç–웂(Ö_Ô¼‚†–ú;d0D`?Í2•w¹üìØùâ @H $€lJv«¤aT3U¶¨eEåŠiÙ­E‹Þ >r,VµÌ£¿›-Ä*¨nìþqßýB“}Mº/H¨w:*ÛôÙäœÆÁgˆ»Ù‘ôH¢²ÝVö.•ÿ8ï;ؽç{[޽^dnMC e%>ƒG?ýŠßp‡>ï}_Úülé:æe¾U=º¸7¾â- uvû©¬!SmÙÞ'v^(60 6u˜·\ìÜ j:OúÈNQ},äÐ]Òüµ-'š“Ò_gŽy 9ñë¡W{LsøáŠ´µÇ³Z¿ûv'˜æ¹½¿íPÃl ;{wJÛ@—‹lr&UæùB`KZ¬!R­&ëÂÁð×{u¶í¸ñ‡B†7í4r,}ˆ.=lÏu£Þ}*¶ýÏV£ƒ·;;«h×µ³úøª…{bei¼lÆüï}··]Z²Ì5+Ã:³xÙÑÙ—ò—€‘y¸ûDtûÑÞ/,\k÷ç‘Ñ9-½;·kžúñ{ß%ëwn ]ÌtÔ¾€z ÆY k1dÑûùǯ]Þsºš¬ÐÒà=‡îi–©’¥¯ðñ¢lv˜CH $€þ»jŽæñ :¤Ž(Ñxƒp41©e#®ôP16)Óã¯ûm÷©›wÓM¾©gw5œïûNÿ¦m{¼Ö–ä©Vm+öìOë~I,) àÜ‚×ÂÇGOGëmQ}fïý"ã.nÀÀ¡C|é‰cl¼ºð"Ê–™ëD‚æ£û5”µ$;æÏe?8:sP¯É zÑrÐúk6ŸL3Ú¡elzðçÆm~K&wsõé9ÐöžoœU´îå)`à¡t $€@H <ÔÁÏ » $€@H 4z¨ƒýâ@H $€žêàg€†]@H $€=ÔÁ~ qH $€@Ï@€þ ݰ @H $€h¼nܸ!ÌU ïÐs$€@H $ðl„Z­öÙzb/$€@H $Ðx €Ö5^ïÑs$€@H $ðlp?øÙ¸a/$€@H ÆM@¨Á¸ˆÆ½‚è=@H $€À³À¸ˆg¡†}@H $€;U\Dæ­ÃÇn$Ùu5¨}³º^MNÒÊ«Ó&m$dº££=-ªkXS]É£#sÞùŽw¶ýùª¼¦Æ5Ö?›µGG>ÝqSã®]ǽ:áµN­liaIªY3Y¾ï¼WC[cS§1@H ¿A æ¸nÏRF3w²„ˆÊ@©˜¯ÕýÓ'®inýº|Ùö¸·7néÛ‚º)‘™Ã«¥gpõo€!w±$4-pͺ9N¬íÎß.³É ÞnòÚÏ ÿõ»Ÿ~pµ}æWJ®Ee‹,UM¼Íêà³Y“Ëé>¯gçq{¶ IW7íºzi×ÊK»,Ø>³+‘8Ì ^”OœZKt=þwî!ì‹@H 4d5='§%ì&0áétú'ê ç¬.ÖÀîp~üµ3W’òŠDrsÛ–A=Ý9Ý\š}þâµ,…Jnçß{`gKZªJ ¿”T$tkï•yq_„Úÿ•M¿vWå'Þ½u+1%]¡[¹úuïÑíE â®ÞI.°òèèëlM4Yço müºt IgOo§›šq—ÉÓ¼ü=5¬0—ɹ‰—O„E¨EÎÝ^ìïbˆc¨Æ¥VíŠ#Ž_‰Î±ò êÕ»œh/œ ½¶/óòlÓÑ·¥%ÏÌÊÆ–0j†GŒ¼½yñBB&x³–A]`⪼w"î?|˜¯P‰¬;ôèïf#&%ñöý•@Tw/•fzwéДˆ,l‰Øø„bVÌ…K7¢j"·óîܳ‹ƒ9…¥)J¼K¬=<—ŽIUˆÝ‚y9@•iâëL­é ?1Ó4Ï­¡óàñ“G¸¾`æ»sþ\:mÁ®Ø«~ìÞá‹62ØÆANÌÕŒ–ϧ3­l]ª«(ñ±SI ÒÜ¿kki^BRc‡^”$MÞ½Ëg£âÒÕDÜܧkP §”–bBH $€Àó&PS\„Aõê`gÛÔ—ÐuΧ~H}nMÈ}B´„/ÒsoÿöÎÇDÀ¥í;ÎÎÞ°lŒ%a’öºþ†¡˜4;¬£ÐxEH⟓Vü–Z“û`Šl½öñÖ÷û‹)¸ÿÛúp÷™¿t´$ʼ£_q‹®ÜÕ^xïÀ¶û±ÿ[}Œ¼÷ÓV„ÐëßO8l0ûÇÅÜ k_±|Z— Ûö»ª-ïö·ÿBhÚò…ûÌ-_ºˆolœr“Lýöà@ó‚˜=o~Â5`_í´ä%ø8x L ¹ÿ€ß<¶ä—¯=r#v°S¾ÿçw÷ÿlµj×&IÚù¹¬!ïnùKT¿,üê÷›FS;¾sw㛋ՙáß~½Ê]€ W½ë§w7ƒ*ccÈ?2µV0ÔsÓq7íÂæ)(]QÁƒ”<öRØõ­:ïšv•œÍHÍ÷tÊÜ<ï]€¼b×jWiUëRõXEw¿yííëÜ»~âÞ§­=èj-„O[ÆO;ÉÑן~ð›ýݲ1MÊJ0‡@H çD€ßòW÷O§ã‚!@5é›JàR]ô˜J4Ï'¢öEEE]ºôš%XS?þ“Á‹v^…²:r'$2¡T´¥57«~ßîü}ß¾!²òC·sðÔ¨¨}û¢Îmô„†§Ï¥(è róæpÕÒBBò¨ +sžÎgò7‹À8!ì<5ÉjéM3¾ýýèÎeÔHBL.©Ù¥a ™MÍ]IRj-§lÛÙZê¼íÜí3Ú‚óV¬X³‘ñÀÚ!VwžrévTÔ«'NŒ‘kuÒÖ#÷½ø#êj0µt3/«Xî;yçÔR¿E;oGýÑN¦Èبà¦r±V§L cE°ç·ÕÐ-~ÍÖcÅZÏL<œ8nÙѿϠ“!F¥_:Sk&„+Lǰv†^zP!f^˜žyƒŸtœó”q~Öóõ1ãR•|…„Ïh"lRüøÚ×;/¥¦e»J[ˆd°£€7è¯,½“óÕ"4Î$ãþmÚ®ßd‰"·# ;ÃÊ[ƒö6ÙÞž·! IDATÖ½¢ãT±†ÓŠ:­RË–s-åü¨4Ñ(Y!Ëê/U.e'‹Ì´ù õ‰ÇÁT ¶•jœ:kPŸ:²8“ 5S”_5m¾šö{tô³àïèvgï1Ca”JyVý1œ<ƒV¦F8ŸiF«•ðK!CtŠÄ5„ˆ$gq:x°'«oælŸ—Ã¥ºL¥<¡=ËYƒ+¶ ?1®ÂðZ)WXBƒQ é`¡MÓVµ.U%–XQ3………¹jØÿרʌkvÛ^Î+„Pn¢XH—èþã,ø²£„)5LH $€Às$ÏÉDQ¥£ <á[ý0òèQv+ú–JKÚ á¼eanžÓÀo¢FÆž ~iv¹˜ž]âÕÚ•íAƼ¹ò•¶2*yD]˜w'%_¯ˆ4*Ö40˜ÚS?Ž "ØsÆ©}s-U±y{N…Ÿ›¦lÌ/m‚S÷èܪÂA­Ñçöt*6O´úYègRª¡“2t„–bû]¢Ö´œ`ÕéÔZß 6%"êP?–NÜÜàÕ+ѹ}ÛèC=à°±ŒÛT/úýÆøV½I‡?¿JDbxN§VQu{êaÊÄt×Ó8 TYºz@ yœSyBe;ˆ“% Ê X¨-g`x¶:Ó©™$Sk:ƒ“йâtLº@VoB$Ð[S¥üµi!«ƒgôôäeë[ºÒ¤ªÖE䉱´BÖz~jŠBëL_úókõ¼”Õù1iÝaâšøÛtÌ~~^U¢_JýÈø†@H z'PÓ~°VàÞ½ Ûõåä¢éKZ[dÿv85y`GØ4ÍO<±jÕãž}œ¬ŠØÍWÒÔJ¨R7e†gئؕ¯t¹>åýV–$5ú¯\Ï·&õväf2‰ÛZ6œ¤™ÝC=½ö[©êÒú0Zwøâa½ZêØÐŒSß„”tÌ»|=ë»ÑÄìÅš˜Ø«g‡.þVÁÙÔ¾A/ÂÅS¸D»¤.[¡– 9µk‡WûÎ=|ÝôgƒÖT©[Œ™ì¶-vû§ãs¦/q·È¾—Ðtä+ÍØ½Ýc¿~Ÿ$ŒßÎÆEüuð/û—_pòjOÅîo»HòÚuïÖ‚sĨVkÞvà0²ùPìÆÍy/tÿz=L¨_ðPk­6ǤL†ÝqýÊNCÀ¾}f+ôâkf¬¢Ó1éY®êÔ‰‚¢ÊüëË›e¿OÔäÀæ¬~l°YõºW“Žl2–¤ãk³É©Øß>yç·²QY—$ݦ}@Ný/|ãÛÄ_´(¸²?Z¼Ø¹y)Ãͯ¬=æ@H $PßjÒÁDÛlÈòÌ÷³Vl;²yç͸E?Íô—G¥”J­­c®s=”+Ÿ¼lçâØÜR—™?o´]3kÅ®¿¶~ó[÷Z8vW/¯Ä|xdJ¯ØŒÓSI}æÌè7gSØ›ïN_´ÈgÏŠ]±;îâïâÔc°U§‘›—¯w^¶qî¥Yï"2µ!éûAÈ•S³Ã"oHmègÍE[ˆ8Mȉ9؆ƒ-žÊ%ÐjÔ{ ¶~gÕŒÓ 6Ù·!ÑÆÇÛUΙ£Î«KZÍÛü­åª÷Bé™ôþx¬V4k¹¶âƾÍ7ZM ž±t馛ìiT?¦e¿àa‡— ß¿5ܺíï.6¬—æÔÉÜ<û%§¶5ÿhò¦“¢Øc&o{gã­‡E|AY3xžMÎ_'¦Ê¡«Ð¬ÌIJÛd:FÐlFǺqâ/ýñžÃ&™òúËvÊ̘cð atZ•¤ªuiVÅXj¥ûëû¾%½"wƲÛK³WbU¿V]hÿêÑâàY+ö¯ÿ„:â9lÕ²ÚKŠâÊŠ—÷¯@H $PàûvÞÛA¤TŸ„n-$êŒ|ˆŸš[Ù‹”¹·âò`OdmÛÕM¦P°¡R9ÉϺù¨•i"¶‹ª€!ð„–T./ÍNOTµñka/$Y“¢sÙHÜrà =¼mu %‘Èyš|_¨P d¼è»YJ¹u'O£`ˆÔL‘YdÕÌRB˜ûw’R"²´éè!-)P $fi÷“ÕŽ-ÚØÕy™—ŠÀÓ ?;Ú22)•î6Öì’¤‰}PK9Q]‰Ê„Çîì][›3àH[r-¡¤¼óâÖžöB%8% B¹D}åN¦Y3‡v6:ê¦L”›¯3ã+4YfBêcÔ»m3‹ÒBðR“ËXwu3'ŒâÊ E$·òó°á) 4ôÁ@KR˜s;Æ‹¬íLš ½|Z8ˆIVbrtv¹­Ó ÍL¬0SØö®”I‰NYR’˜”ù8OADfš”ss|EÈØu¿LñªZ—¬œ-ƒ}b6-øþ’¡L<6eäŠsáǰå+öFÁg%EìÞóCÉÉùþmF†Æ²Ã…mfl³"4‚û0hÅ”{Ïú–³w,¾€(ã¿8ŸŽi32øtS$ž ÖãXUæceD± $€@=Púölhxò–EÇfµ2’û[âêÔï#÷í<0ãtýR½øØfÈC›³ÇâJá2téÉï¯v S̸žKò<þél6÷Ç<1öˆ‰=zma9±ëzÀŒKõí­ÞÕðû³YW‰(ȈˆdWáthDÇ£Î@:-9˜Ëìïo]Ê"ÖlSå£û£æ]g—GùˆBˆ}BwÅŸÅa9Æ©šç¼:Æ[¨ªe‚{ïw+.º°ál)‘éo‹Šžkàf;¾`OŠžÒù›‹"R¸¥Ô÷xª·Jt0ô»ÿ>DßnÛ¶­¸øioØ¢,Õ‹›öœ={dùø“‹¿9Ái?‘3Y÷öŒ¤^ßïØ´ÜúÀ²ßœ+·/¯Œ_Þo½á›Îž=0<ý‰ZB ¢~85¸ÍòÔlË­SûQMéÐeüxB¼¦L ݳ¼³CÙ‡REf!A;Ø?1oæò·ß^µvOØÙ›Èºy½¾7˜Ò¼+1[gL˜ç÷ýŽïçØºxUŒ‚È]»,ïEÈ”M¡Ë{6“€/¾½zJèñ°=«/ßEÿQä^ÙºxÆüÒM¡?Ï :0oë%Fâ4z)ëÔ¢Ðå:Hˆò|ÈŒP‡åaÃBo×`>„=A @HàßO@]PºrCtb×Ö›§»XÇ¥ŒÜòˆþ,QGÜLù<Öê‡ÙÞ-$ÚË›Ï/¼"Û±¢ÛƒÉ•7ã5²VndÓ¯‰œŽ?ÿà1wkBJó /FL.ˆ‰¹!Ùk´ï±?µÏ{ë“ËT2j˜ˆbU£¥L•*Cž9ÿKÌ+—ëºüü¦›m½nɔ*#Šóæ†ÄùMñý_?ù®½Ñ±à›2gù'‘1]¼Ž­è0<Ÿƒ ìùR«îÉ™#7&ÐU‘'¼[ôq:¸íåáüóüÖεúj¸ö·’ÞÕ ‰ýßôý"HüMÈåA!9+gû.ôP­üé!À¯‚sÞòO¢´tÙ³¢óxõ B̹‰3êGÅE…¬d˜’ˆââ’òº¬Ùš>åÝ·ç»]9x{g ¬äó^ã-Tù2ryÛ¥O®Ö-ì²ç•¦Y„HéÜ*ñ\`3þ5›Fn‰(%…É#·fÎëáXû»«rÌ-å•+W>ùä“Çs—Õ¿ºš4¾§ƒ÷©„m­N&S¾[:¾_`ÏÑK–ö'[ϧ˜aŃ ¡„Œìê!Z{õ "—–ÝLÄeÄkéû£ííÝG/ÞDN^zP wôõ"Öξþ>>öe2˜¤Fß4Ü å=UÆü²‘Œ_»d£½gÏwÌ%¡[{´Ë÷\Ô/°W¿@}‰c{ogâåÞÙßÇÑ’\§Ìõm.•Úyö!d÷$¶ˆü)G"õôï2xdr+£˜HÚtò†`¯OGнjhó(µÈÜ¿K }=ÿWT~¶x…@H U7¥ËÒnAm—’›éì¶H$»cÁþ]üím˜¬íWH÷Ꮆ¾‹/l'^{¨òíïBŠS.¥¨-Ú¿·tÄW½Uh#N¦™óûCímm^z»½?)½”PJLUˆI^ »’©E©Åbÿ@Ççö7ñÓù½&õpìÕ­ çµâaÊšRÏvbSH%‡…ãòwÉÍû£Y™%ß1Ëþb˛ٶ‘o{/[K“Y”cZ§+?ëýR ã€ž¶„Ö­è5ÈßÑφx€Ê9+& âŸgµq·µî9¦ÓB[¢ß:f½2ÄRgÈsîj¯ÓU³óqJ›6éMÈžHú1çŸX¸…ô©Â2eÖösšüzzXºû·ùnWaP¹çŽAÖõ‡„\˜úq4ñn=3û8`0ýtïFO*o.“Éll w~åMô¥)—CM ¾;µP¤/„¯F쬸 ¡ø^®’”…‹¨Œ]<¦Ÿ¾õˆ‘åï·â”{„ôqÕËH†~Ü9w;iºK5íÀ¾è{Ò·º€R--ÿч«‡û£—›Þ ‰ß0íþ^­,áÒô` †½@®KHq&8³nD¯uœçAS rw`M0j°-·N߳ݠë€àŸÇ÷š:aàFÒî‘Uo»›èuξ"$€x>ào±½»«þÌ@Ãßb3¢%2‰ñ¯l€ž89è Á#†Hœœf“„WóúflÕÕÙd—‹¨R’ñ³ÔÿÖ° ïLkeèξT‰pÀ;Þ×EOÿì,q¶Ûóa€»á›îr­ëøBêÕ’N¹ìï;û¸Ðç«/ëÇñÐ?½déã½Ò;ea´¦ûho½cZØ¡fwµëØ«JÍI[ØRIÁA¹ š²>圂­œó+íM5nå~tŽéˆªLXµâÌñ‹2¹ÒtduŒ^=±LD ºªg ýíÊÀ]JS¥žC9¿çXOÿs‘Å‚¦»U6e¶wµ/Uö’J¥ýúõëÛ·/Háj-°•Ê(Á-WÙ:Ì=qï;·–õˆ C¨`w;¨¹ñ¿9hBwM½v\ÝHµè“Ibí@È­øIÿK“Ðå ònþd;®DÖ>ÂÆüt4*p¼O¹6¬BMIWO:6£¦·7§Z©¢Õ+×r= 2»–]±u¼þ?uCÉ3æ jÖܨ¯%ö]–Þ‹|'êä‡cæ½··÷þIå]2tÂw$€@Ï€˜j,61°‹dÕ\Vþd2bB—¥}Lÿ‹ûŽ–‡ì½û=œàåSN ­as)®ÈðšïÜÊœh@ÃÀóñìX*&Ù°-&±u^ºÉñ˜„«ãÞ?šñÇø{]ßIK*ì‹Ñý*ÁæoúZ”º *za4-¹ðçƒÄ]ÊoÈ•kZ_O¸Jâô_œX.˜ }¤¢;Û&‰-ÏσÅ1,º¾RlGÁ;_^ámªjþ‰Õ1zûÄÜÙUË.‚ÅÒo=²M+÷(ûõnm¡Ù~(¥Ë«ŽF»OŸ©ÀHß1((hñâÅC‡}* Û¡ŠœØ=‹OÂW*ù¬Ò;“ek‰ÍQ(2"B¡|n¹è]y« $fÂÿB Š‚ŒØØ ÏÑIFÏ"WŽHaEøžÍ'‰W·*7§…Ž}ÖŽ''ƒÇ¬Øž£TÂ!Âñá‡V|{L!oùò²qõŽØ%S¿uñ2ô¢›©¯@KdNbâæ("ì8z>¹üý¡(…RY•Hwç+Mr*™O^º™¨¤(”açâs”6­ÚÂθé'èJûb!@H ú# ¶!ßlŠÍU)²ÒB÷–’ž¬2Of;9€Øq+,®X©T¥Äe$RæÞÅÕ•(¶Å‘…ƒšö´¸nÂ8K!+ñHT£Q…޹@\àT±!áQYii+Þ|¤×2LÄùGñ¹ŒM˦ÿ¹¿‰ò–ÍÍôÍщ…*EaQlÕ‰¤8cñš”ã:ß iß½8…i!-'¹ŠMå[­\“zz-ÿewåœ%V bT?ï}”‘›wèûsßëãƒY—Tñ #¢mÈ|ÂC~Ç$+ùûð Y9ÑAA7ˆÕ)sUfÞSF6ýV{þæøƒ*Bu_¥ž“Œðˆ¹W4ëV <ù¦Ý…0¦Ãj›ÊߨloO6=•!1·oÑ4n¯M š7ÄûN™?Ëkõê~Ól·‚ýV/ó›#º­¦Öú/ ›¡ \b¿-‘xßDÎLKƒ–†ou1ýŒbßåíKó&Œï·˜V{-ݱ© +ƒA©V–$ƒ–^\ë°rÞâ [ÙÐfÄ’Ÿ%D>,øHÚ‚GtÛH{ÍÚ³~<|à…½hc<±PÑuï1©?™:¦ÛÖù¡W§ûO?°V5bÞ¶'é¿ôÀw.à¹É±o§†ˆ½ÏÒ$xêÀÕ^KÂ÷ŽûsÆâ·Ùr¯)¡Cáÿ0!$€ø‡”ÂÃFù㜦Ã;;ïÌúÁ‡©Ø ¼ðûÍêöéÆë¬<Ï•,\ØÇÅBLšØO÷ˆþ$Õ®¯‡qsN@Ìh/ûÀö›‡_›¾æòç´ƒ`áì .4×úÅáò©#O$#zÚ¹žË„¯JaÓ.þ|Ìç[chVfýs?[š©÷¤ŸšnN³y‰mðg^䳘‘ïÃ>5!¶ÎçW˜ŸÞx낳Ëùôùòw{¯¹ÿý•¦ïYvzɆì¸ßûÊ£Ÿ×öñ/·^~ë]eMóEìn®P¤/¬‚³ÛŽÑ™öÆœ#®“mÓãØöò–γm“?¡±Ò÷‡[sž&8ìBKÿÐ 7Ç︵m-ï>¼Cˆ“𹯎þ¢v¬Ë–‰È^YÐúæg÷'|rÄå oÁ&vï»Ï›}¾!sÜ”Î=áÆ ôÿ¡çÙ·Bnt\Û«¶ëÅÛ½{·¯¯/ëÍß}Q* ˆÄΨS*D"‡ Ã0BˆÈ %±´¬j–QÀ“fÐÁT—9Ã(éà åòÊ«Ëês`v~…ÐÃ’:cLàÕÓš¡Cr3`{3Ê‚bF"£3ª>±Ý$\3Îm‰\^S§êMbm9‘‘‘uu»–³‹H FB öÿ7¨úeÞi2·ß¤–Zøck ê¶ê¤,VÁwš™ø)ÿr1J•RC„2±éheq)CÄò2‘MÇãZ>½eSk?eÓÞòZE¡ B7jü‹N!!1©LUrY§®–Ù¯”3«ž\P:A¡L*1DM”Y1æ4LA±ÖÂØ¦Á¬ŽÁEê!#±šÞW´î Ï žñýܹsOy«?Õpd/×Ä—¡"TTœ W¯o‚ÕôºBŽV×½BsªMÏ‘0VƒWOk†iìAäPÔ&×UfAËëjë¶±#f@H Ô!ˆ-i*Z–}rªž,­ºD(©D1K@„=Ñ¥Ò–O´z|¹…þ¬êk0S7+u +Ó&O1A°ÂP©ýêùÔo-õÐT‡F{ÂsCų¿W6̳[ÞH $€@ƒ" þYGÒ¤ºmàå.:ƒž'ÔÁÏ“6Ž…@Hà9àÛ;Uùˆùsv‡C /;;»¡ù„þ $€@H z%°wï^žOàÈz#$€@H †F 7ë/9³¤¡¹…þü§Äܾ¨V«­­­KKKá€'‘HD"ø)Áb³ú"×ÑÑÑÉɉÏçý[\\ ‚òœæ^áR«Õ–””€®/?Ð.@H $ÐÈ ÔJTÀ\Q7òoüîÃ- 2'yá' ‹ŠŠ@ Ã~0B-—`?2º8$€@H ¾€T`5ÅÓŠŠÚ]_^£Ýÿ0„0Îòpû‚† $½6ÜÓPel‰$€@H T âÁXùE #.Ìü3ग़×䯅`¸4–ó¨ƒÿ™ÂQ‘@H 4Fñ`ô·zQ:Ø 3 …ߨ¨(£ü… x¯\¦¡x‰~ $€@ žˆ‡jDêà¿€ÿ==z´iÓ¦‡êt:ã;Áÿ½gŒ@Hàï¨^T þ»|±ÿß'z×ÔÈÎ;ár÷îÝðlWU¡icÌ#$€@HÀH ‚f¨^T 6rÃÌ?Cv|!ǾråJLL \&$$\¿~»›q3ØÈ3H $€@Uj+*ÊôGU± Ô+PºœØ…Qàäà={ö/!g£®Wþh $€À¿†«)ô_2?¨@ü¯YúF<£Ò…ŸÉÊÊ2Τ°°ððáÃFYl,Ç @H $€*%P+Q¿£Q)C,üg¼øâ‹C‡…°àÜÜ\±XÌý´²ñ†þg|ÂQ‘@H FHàiDE}ï—Þ<¸yûÁ«ÊFˆ]~n*(]ø ešÛ†*Ü~n !$€hìj%*j©ƒKoε3s¶3[–ªÇ”v|-yãNQ¥Ü˜«ç,|ãZi¥•å Ñ›Á²áßà•;/ z.Oè_{eªtA+•tåá>æäMük)àÄ@H ¿MÀT3Ô(*j©ƒ Î…üü—‚Íß;õÛEš©\b>64æü V†Ž5¾O_½;ô§ÕÝÈ™¹/ì¿ú¹4;-þAtäƒäL¦ÆÎØ ‘€ûµ¨¨‚!cL0'Ä|fè>@H $ð\ €P( +¸QAsÙTT<£&GwÜ¢3¥žÚ@z½ ÿS&žfØÐ]r8Ÿ–WŸg IDATïÕcüš/ü¬w§Ï¶Þµl0lúxë»Ç• ÛVuþÎ'Á½¡GvAé{úûùôéÝ©O€KËs=î\>€ÔiádzÇõüG4¡"áøg/±ÛɽgŸN¨J—CCL ‹€ñ¾T©T©l*((àn\¸waoX­VíܰœFo@H †GÀ(*†'ï³³³á¡#p“SÀOú[ëçä`xúGs6µþà¥Ä €KË¢{Ïže²‘Õjùè½×¾ p¸ºaÒëKÇöU8Ô™ˆ] )”°Ã¨“¢#ÍÛíÝõKg‘àóLŸðV uŸ²Òî=,‰Z³ô !½=¬]B£Þp·æmŸÜ|áÆ£>Ú"vó o|A†,ûkùÐÛßÎÛ}fâ«s;<6dõù»/Ñ~bgÇðÌÅLãeƒ$À z799~ù0===??°D"±±±qssó÷÷···‡g檺‰ä´Ð)$€@HàyQÛ½ ‚322âââàf8= ’™™™µµµ“““§§'änÕZÒªïØùׯ>²»KÌq2kΠ€£!$,Jܺx¥ýuí®G1Ùp™–SDœ+Úoûîî]K†2÷%ÁψEF7Ê2«ÇwZ W=¦ýß²àÎÖDYšµý³/ƒ7r»Î% ‰¿|ê—ÎŸÙÆÙ¼Õ›Þߊ™(oƒ·£gŽö' Cö=*Zì@7©15t°× ŸÕîÞ½{òLÔÙ¢¥G†Ì^g&°f2œ ’ÚܿۧOŸÖ­[›~‘ÑÐg…þ!$€@ψ Ø5ƒŸâñêB&“™›ëå |í ?Ô›Ä~~~M›6å\«¨SŸÊaKïÁo _=ÉlУg~krwÛ‹9ñq“×7’ùöoC¶$¤ã.ÎŽÐX©®ò¸¥&N ´Ó»ÁÄ|è×{¯÷‡¡£ÔÇÞž¸ÔÔ"5®ÈÎ4´dß{´iåÞºÕ¬ýƒçX{Hõ5øÖÀ Àý 7åÑ?î»íp—ïDlÅÄBD,„j³&%’6²ï*“o¨Oœ€Y¸ºÂ— ˜@H $P9Ø2ƒo•?~ ö}!Á÷ÉÜWÊf ¾†­7ooo¨Ï¬T Û z•Ú`okF€\”Eˆ÷‡ƒ{û'܃ZU>ìWL…U `CKQÙf5)ÍO#¤mÏ€–f©§‡}ß‚ì"ƽË@hüé®Ë}†/áºÉ]Úvƒ\Nލ©_ç.~ͬÄJ`j,"n¦¿fy·ÈžÈÄŒÿšJù-db{™Ä¦¥¿Â!0&µàæÍ›ðíFc™ú‰@H < q! ÂÊÊ Ô0'ˆ-,,š4ibgg‘–P›’’Â[ÖZ[Àœ@c6rtïîГKœàŠ}HŽëîçè¯_hë~RÙ²-!Ë>ÞË>*GíC“².K_M²¦…&ÖÜóµY¾w7¾ð…t (ï3Ëvß·›zp݇mϯCÊÊesô=­»oº¸{4Ù2±·»Ok÷¯Î01Sfs |2»-¾—Ù„˜ ‰¹ˆ@0¹Tâ 7³•™Y[Èm,­šzv-´hÑÃp×6<÷Ñ#$€@H ¡€È`©T Ú~K$Á+$xâ^AþB•¥¥%E€æ6×xÉ™%uè;ì +…ær)a3R¹´’ЈÚ§„ýfssÍŠ¼"!d„™Wâl<½š N~=ñým‘!WsG¹qaŒ¢ŽZÊÍ1*¢¶˜ÿ±ö‘ág>]«½^Ú¤ïp©µðQ!y &þ–fM-̚ȅfô!ËìØ+ö±;ûöí ÷÷˜1cþ1_q`$€@H 8wî„F€ê…X*Y5,ØàúÀ=ÔBtÈ ˜Ä‰'ê@§šÒÊY4fLkŸ-/18Ë­ÙHçÒôíã‡ì5Øš¸ú¯az E €ñá8šFòaìñ²þ/Ø ð5gø‚6¥º¢8µP,’K%æ2¡LN"bÓÒWqSîÜádfè&@H $ð\ €Ò©À _Øæä/÷ …Ü÷ÌIá:ÖÁÏc®Rßu™¹_d–2ŒÐÜ®©^x?‘qŒz"§µw13ó‹µD&â yD*à‹…|±€HDD(&By²RÉ…òÔ“h $€hì@é‚Ìå¤0÷ —@ Ã+”@Ø€ƒWH0ÙF¨ƒéI­l¥Oÿu}QÿÝþÃM©åñ,dp{òt:7)üÇç¸Yù„/"|1á+ œ„-ÿÝ(pvH $€Àß!b..Q lÁ …9íkj¿‘ê`Ó)`¾ÑÐ è/½À4tôgãt|-}gCŽ?$j˜'¤?­Ì…õ4úÙâ@H z# l”0}çÔ0WU¦Š7ØêmÐðÓð´"¾Â!D<‘€g.H…|™˜/xÒRÊFGpïžÞ$¶DH $€þƒ¸M_N6p"òÆK bx¥ùÿ œr$BˆƒÐÁ©3ãéd<”GÄB"@Ä0}Å„@H §!À _h îT/—ç䯱 uðÓðÄ6õN@HtJø)Da´DEx Ö¥†¨52 šÐßÍõî €@H 4fœæ$/'Ús‚˜kSÄøàÆ¼Îÿ"ßµìùR)¬ã)µ €µŒ†Ê_5Ü£¢Òü‹¦ŠSAH $€ê™òˆˆ=4BǦñtfˆ`úöƒu4ƒ $€@5€`P¿‰IÊ#×J/§ “Z3â /ò’§ô±ëèéàââjö†ÁêàybƒçB~<BØa(-o-ø"8îðôÐ4ø=9-„G`BH $€@µ@Cºq³dëyrCiKlÅÄRH,ùfM%n‡s¤„'õ-,lÓ¦MÓ¦MÁÒ3éàÒÌ;×n&æ)à·o­ì=||›J«uê‰JeVRj!±sk!¢ª0iW÷ˆi=âå€fµœgœLƒu‰Gxpr0ü ~7ƒP è‘pÂós˜@H $P=ÁɉÊmg™¥¶Ä^D¬„ÄZä&8˜ ,$<3Ÿätþ•¨ÛR©T"¡1—µÖÁé—7O>箉³ÿL]hmRPs6j«çˆ•dïÃ’ÎA+3®½¿dþ’.ÃQ×¼´ÏÚBǃŸSæÁ±iBæÑ_”ƒŒ@@ö5Ìà¹&Ï û!$€øï€ÈàsW™ˆ+â""æ"b&°ñm¥Bk©Hn&”I„B‹ÀäÛÉ €¥–ú"ïê*‚}WŒIÎ,IÎ,Œº5ÉüR¾vÎv¶3Û]JkK#çÚ™9¿´YÉ6õmïŸ×¼ª}ø)?9æ^t|~i©"+3¿ˆ©t“ÂÒ?Þ2s¶w‡ͤ¼ªl-ÚKÌ,Á "ÁTot<l @óqðJè?ˆ†çäàR\Ëû´ÞÜDÃH $€@Ã%À0ÌHc+ÙÏfrW«nr{‘ÀL$JÄ–ffVrskKkIsï”””‚‚˜FíôÅÃsÛ.2(ø»‰]\XB«fîNÖtSùaØwã@éÚ™ x뻇E |o®›»ʃ{7Y¸3ò^è7{áâü»Ù÷JIæÍ]K¾Ø• ‡a•F~Ö»Óg[ïZ6˜ëû˜U¼wvÎö hÿBoŸM¼ÚºŒýù;œñ¥ôêÖO¹áœíÞƒŠèí³wCíÁ!-ÌvE)“Oc› CçÓ~E‡?<îãïþøÔù¸«×˵‡Ú ?.€Ælûã vœ~3€–túxÃA¶_ê‘€~HnGئ'EDª€ù"ª†á&e‡ëqô ¦KãôãñüiâùÏúµ°B5)=ð^?¶ºÒÚŠ­ñ $€x>àˆäÉ‹]›ôó4÷qöha&‹ Bf&‘Éer ¡¥ iâê“——WRR.ÕN—æd@Ÿ¾ý¼+L&ÿöæãç7[öWøÕýMvÏï±ö4‘¶4ËšM\½ÿÍ-[tÔ.¼çl?ù~ )a²£ï^ˆ.¦’W¹yþØÝdìÒY½ïîž "¤4tOÎ'•Dœü¹ˆagÐ$¥=ÿë‹CÖ_IHüëà›M‘»t™Në}W†^ìï"%jùè½×¢ÿï£ÞÛ—Ž=ŸLGÊM¸ˆáû¹HžX ƒÐJÄ[Š"±P*å™I‰ÔŒX9È@ÃajЭv:X͆5(KôÂÄ"l ÂþkêMØ&&{Ï;qâ:õeÍ|bîåãYßN½ZÚšË[øPìê×µ»1$بmÛ¾»{×’éS¦L€& x‰ì®ñÅ"!t°˜çP‰‰@LD (f0R;lß¶=ô Þ|Œ óú^:…P¡ÙÍ«µs+ÿ¡û· b—QÑBxg_Ôl°ò‰­5Zéâì¯JNeÓ6)Yí“•šØÂP¦7Ø’p+$xÎÝKÆwsY–媲6̉›ôþš²Má#©:.{°‡‹ñ>“öúž­Ý[zøŽÙºÙ 7®©!£,¡$˜ê•ü’2œ¡ ˜Ñ2ŒFÃ@†ý%9ÐÂð@H $€j"ÀSi@QÀ7ÌD§£_,Ã+<OâC˜%„_ŠôÁ–Ïò;]'Î&_„ìž:ÉYµ|Ú`’FÃ$ 5÷í ±¹¹9ͼ‡7æÄ?RCè¯ÔƪÜÎwé`%•ÙÁÅ£ØØäL?gš5M…œ¬6É=axï’™+É«÷—,Ì#ê “vóÔ}Ñ€Ù«|]IŸ7ÖßOjß„ZMˆ‹Jt÷·LŒ‚Œ÷öKúy3”ªòaC¹‚–š´wñé1œ=˜W(j;¤3ÉMN)!Ží@ñܺ~‹çtǃç‡ÆL=€_Q†np>ÝæñÕð‹Ê:ú >¬©ø™åz¶îͦÜ9uüÔåˆbcc±GÖÍ<Ü=ý:u÷s­p’Ì{ç8z)•xظdÒuèØ1#:”oTx#ìZõQEämû¹æÆ]Ù¿g¬Ò̵Ók³{¼/¼sîÔ©Ó—r`LRRbÖÌÕÃÓÛ¯{O¿òÖ Íñ $€À¿šÄB€¨í áñÔ„¯ÒjA ÃFh úm³Éa¬µüRWè²0á–ÝÊyÁkföY£Gh!Zµ{çô/Ê·&Ía+‡¬ÙæÕ²ë«£É–ÍoöÞ|&yv‡ñ˦m_²~xÀ©ƒ ×ÌœÀ ßd¥a&_3Ó¬4 øÏïÏ Yr|ɺՅsçWˆ‹Ð”ľ>zª~ø!Ÿ|8’"wyy=Ù6gö`¯%¦ö8‡¼ùõ m¿žøîˆÇXöñÞ×ÎL¡íËtÔ´ý[3ü?Õû¯/¹} m5hõµ-SÞ™µoöÆù£wûÎþhÚ±¯¶˜øHÛ`ª[ð#ˆ°¬¡7)OÍhàŽ¥‚XMàDL4’óƒ |1iä§ûŸ$Óî«Ë ‚ÊÊ™”_?œ8aÍ©²B~üqÅëíÝ>½ÜÞ¹T=¿}£‘_—:d‚þ¿º¾k‡ÎLÞ;0©íÈJ†$}/„•Ýðz“ø†@HàßM ³•LÅ>k$áó´„/òå"¾”GÌ„D" Q™CÔR9s¯i_þ9qa^Q©šÍÌÍÍ%¬Vƒß?‘ú¶¢”!B©\ÊÙv_—Y¸¢¨T(5‡~3CN^©$B9„óNý)y*· ë2K¸œÜ{zræt6Ïä;ÌÞ³ª‰(îIJeð°]S+® ÷*qŸœ9FYD“›ëÛ¢i—éÉ©¥Db.®z8èS¥ÐÆbæAF*'ÂqÛJÆ™X1mÅfÿôpú:ˆÛo¹úòÚ…yŒÐŒ,œbÒ³uO€¯% ýƒ§Ôð-DF"¬¥ÿ@kÃ~pÜîù•Š`€ÕTjqœ²n Ó¼rØÀóöŠv}¬3"è¿1‰œ¸šv„ìÿhˆ‰Ú…Ï‘41÷>­\sÕøŠ@Hà¿G¶|a7~”€f´b¢…³§à)|¸€`x Ô±1Õ^³]%æÖ*nË'› A§–Ä|ºñJ#7œ}To¼íäõït/?\ % Á+”š8 4×eÌThK/MÚ³WÝ£Ó¬¤Õ=|K¡ÕA¨¹F«Q2Z¥Z«QFNC„5jˆ¯ûëÚbá_ÛéÙ&\úüèƒ_p&7ãÿÙ;€¨ªýŸÙ˜ÅQP1@PQrÏD|n/RÔ|j‘¥&–¦Ïõ¹ðÜnKLSK-£Œg (¦h"¥âúT4QDd•m˜aîÌüçÎ 0$›¨ø;oÞ̹÷žõ3C~ïïþÎïÜOŒ=r×¾ñ Iýic¥öXÿë O«‡!3œæ„²ELühf5†„ŠÚdLÀ§íÆk*¬‹~3>•!ÄcUJìG+>SVpÿÏÄ_½k/®¬…9$€@/.µvUÇeصpà(LèJ$**tì1ÊP®nº´¹ÉYúí+ö(G©d¾U;ÛJ%ÝÜÁþš‹ŸèTà ÁáPK0õéáªtÔ-X¤!Sñ3ŸmœÁlkP¬BˆÏBYòaßqŸ·+Ϥ~1¡R»~p•§s \¹;tŒ¾rØÑë3{˜8QTVøýþ–ArÃzÚÔÊÜFÈ·¢}ò­ì\<}\<+«a $€À‹C€«Ó—1j˜ƒÕZX¯et48h m9ì;âóù\X7WßxÍ QÚÊ®ýK(‚›“ùSìK«ÑÁc 5Ha¿ZPÀZX9?Yø½B¦ü)úE\ËF]’Vi¶]4Ô©§ßÜŸb ªmpȦ™¶¤¸Ÿ™žžšž™žW¿äÔ±ÿ˜–1äÇœÌÞYEW•ÁäÔ"'AϹ!?%¦›«m¦A<…@H ¥uÛŠ£¾|_YV®ƒˆ ÀHè:Ô…š(ËIQ~©X,¨1ÉÄU¸¥¡ÀùœÚ!Ð5 Ù‚Ïð`/eˆw ûÁðT7gâ·n_©ƒO]J«³iÕÎóíuþùÈÕ¤é©9Ëþ› S°êÔÛßd&ß'ÜϾ_5ݹsç軑ÓLÊÖ–µ{û?1ù)çw¬ ¨VbÑЕÉuyµºxˆ@Hày$Àãñ^•ß·U!ÉQ‘\)Tªn(î?R<,(z˜S˜}ëÒKœ\ggg0 ÛW_¾äpŠO•€öTæqx°{¬ ‘®Ùx4‡X4³&v3‚·,ê7Ç€äÔ"Wñ±õ{g¹Y–œÚ>Õd8…oUÈβ#¯ÏI cÞòéß³³}yÖ¥íSC+ ZÙJØ<ßgîgÁC^‘<"=ü?}§ÇKªGâÏÇDž‚&¶ä_ ¬‹M¸,íÈëtKÞêïÞÓ¾uù¥ðíÆ–¡·v6¦Õ*†‚$€@-—€^ wí&uí¤ž¡„T ëäÀ_B*mocc#“É$ ÒPj¨ƒ[îÏà9›™Ž>„ `-DŠà xÛpÁ3æ[¿4³_!²¾³~ßóúœ Ëï©ESOUcúé°‘òÊ;I!»WFBä.xU+I†lÙü¶›á¤Olü÷Þ^ïTÖ„ÐÏ+ò´LåžÄÔ‰‚]hW­a}„]Á 5º$[~_ãfk¸ZM7¹KMñÍV¬gw`]N¹ž”üç]³˜žz`ódB`­/ÃáªaGe_ 8KÀ>ધ¸¯ò˜,6‰@H < ꩃÙ!›®Ý1ÎAyñÛÿ°;Ð×46zÉá‰]^›ø}!˜¯Û³ë˳–}ìÒµûß¿Ò}èæ‡lµäÃÿFË÷^¼ìã q½ÄØZå§•µ/jãÐëÓ_rcýþ%y𿟃×oýã”WÆnúÛ©ØaìÇ'þ|5ëÕ]ÊáN:zîý·]\/L¤ `z t: ¸¬k`pVÍh¨ÿ:b5QkH¹Žèš}ÜS@€]"$€@ÍK !:Ø0Õd¤Y¿›¿1nÔÖ iw=ü¡þ©°ü_Ü™ýYÔ“‘8Oþ5ñÁÕ¸ŸœÙ=õÛ³ÔÖ\ç#ÞÓ6’Qk/<(»zx+¹¾uÔê#´LÍN€«% è]G¥á2×Rù«ÑÒb-Úƒ›ýÁ‘@H ´x ÑÁfìÁ–v#ÕÑOÖ¯û.¯s;sK}–ÞåÝÉÝóÕÉP¼’oŸ?™•óܺŒûð:€XTbWéÑCËžƒ»¥FïùêÛ£ptíN©±L]ºSåÓux#†oÏ'm^ñ¢S¸ý ¢cKøÙ8Z‹`0 kTŒV¥ÖjÊ©_¸kÔD…û¢5Ç—€} $€x±ÔS³ÆÒ¸3IzWZeQ6в‚Hl–½v§ýï‹ Onì\:qÀËëbîÖ¤h!¡kò˜òjÎôdi^•-µªÔ|‘U:CÈkÃ;Vh`h-#Ü¥ë+3O*ûùŽúÔ«Œ-U§î—`¾¾#“3UÆO–ŸèTà Áa-ÁVÍqU:ê ~S1&$€@H 4-zê`‘Mèÿè÷‘çof%ýwûjB&{t´d²®œ¸¢öñ†/÷|×ÿ¼Wdn”U<:öe‚‚Vüwÿº¿¹Ô\yz.úüo.Æþüßp¸rÙºðΘTùtÚ'Œîj]zT2)2QÙïNú²øGÏßq1ëQòÑCÑ„tøŠiûÆ~ðó‰€H°e†š k­Ò‚ÖÂÊ9¿`† DÀ„@H ¦%@ͱõHüŽ .Fæ¿?fÞ›ÝÙZî+þö¬R•Ýš:î}C;£–/ãN«HM\‰Q„ÁœK/I=Þ?rwaàÆyùÓ×­ýdñÒ­†êÕ>~š?î'zªë¨Oö.^0¬[•­¤Ð|1­÷ݦü–{ÜOKÆO›ÂnBP§îZõùêäó†¾=®ÇnèbÀ§ßlýt`µþñ°yh¹\—®/j-GÌ%.ì*G„ì&ðH@gü:›a0!_îj†^° $€@/ À¨YóÙIõÔÁ _‡‡üVü¨@ÉËVvzG¡óÄŒœñª8Ç—Z꽃-ÿ±¯ìú‰vû #ç}Öí½=ïé³êv>_^ùHÆ/:¹ÑNµ©ü_jRK_ÞKs0­¬òr¨˜–·tÿ÷oÅ J”RK×ÌGÁJi+K>©Gw6cwç—–( _$Õ›FÅÀ0ÓXŽ)$¶‘ãqtbžD0}7¹Žfš-=k¢Í6qì $€À‹F aÊ/me'­ŽŠ[×ÕÃl§|:qÔAc#þ›~õu6·¼ÎX@ÿyûàèQK“hþ­]C åAyƒ†Ä·i¥Ï°GÕÞþª»ŠªÕÁÃf$Àç.ì©L#Ãîß\öRæðd±€hq\3~Ø@H „@ÃtpSÀ¹‡ä¬Î-V2 ßÒ® ˜qëzL;}ut¶’ˆÛÙÛÕ©BE› ꮢ6fž8ÝO”0õ ¸B€»0ŸG,ø4ºÆ~âü±$€@/ú‰É¦æ#²±Õo]ì©a[Ú5,Õ¿»†õƒµêOv’ãÓÍä¸|pæ€w2<…œ †™z®ç¬ÿX $€xá ¾xá¾ògsÂ:ØS™ÿç`.` †x CP>8´Àßé³ùµá¨@H <Ïž®=¸)È©ò22K¤òö²ÊØÁm671æìŸ¤ï>öBÕÍß¹­îè3´§‰ë3Sp/½¨",_l'—K@µÑ¤Ê}Åð[ÙÛÕÏÌ­¯ü"¿ë8\pæ‚X ‘"xUÀ\UÃ`f‡_d<8w$€@H é 4N«®m˜½:ÝyâÆ¥c%06öPõÆòåcõQÕš~¸5[TÜ:¼%¶ïœSz4™ôÌ»þóñÄu¤=an‹&¾¯UÑÁª˜ KcÊLÇbë;gŨm‰"9hy0!Þë¾þÐ$dœiIÌ›'@7O†+Zðà€;„#¸>‚ ¦mÜïÔ|—x $€x± 4ÅóæÂÊ]`76U¹‘¨¦0#åfjJz±a6¦¸ ¯XÁÚQ5ª‚‚<»9‚FUh8i¬—µfö“~N©ÓÖnBÇѳf/îX#|…±5øÔe§§ÜL¿—©ïH•í/ »iR¤J–/€Äb½ôÈ ÖÉ*I'‰í´àÝ›CvNö&$7j˪øB$® ç/ \:®¾"XS”™šr3W¡R彈[; x:ÂZØIN«Sktå:¢¡'èc†! Æ‹¨òÄ$€@H  4…MdÛÐO²I‘ýŸµ{A²Iâ·ø³aòŒõ Vôž³mfÿŒ_WHñœ2½¿Íñå3£<–lóïi(«ºA#£Å¬{/Ãoåß.YW¿Ú–öW±Ãˆ)ŸŒîíh(É~hòî9ÑoÞJ{kUlÈ¢_É ‘³öGœ#b÷iÿZàõ’0÷Òž Ç U,Ù6Í5foœš}Ïãüa‰{–î‹Ë Z»Oþè“לëhWYJ¥B é2ôÃY’¶Çæž¹˜êåM~ûù«,ÛqÏôá=ˆÙ°|WÛqgï€iþ>V¤Ôì‹“Ão¢C2$±ïº­þPøjÔ×ßEœ£ó–{Mž1Ë«Ã_i}cåçõvR†x°«œNÇÕ0Z†Ñh†¡;ÉY€†&$€@H 4)¦°g†mØ´f ¼Ö}²õ£ÍÜOE°Ã´àÐó‰"bÝ® ¡Ó@gB.], ªÄ³)0‹ ©Dsçl>ÑϵrRB§>ÔÉ¢ó³Çt(N[½-,ËÞwáêµ#ó£w.ú91¯²0Ýt÷QVYF‘Šš™‹rs Â÷ÿN|‡y‘²¤ð“Ð “|ŽŠ`¿Å»·}ºn’ìÒm°œ» œØ_HQûaó‚w®Y ËOÚ8¾;øÊ»{ÒÞ)‰F™ž–›žšCaăf®\²mòÛ[±»âÔ6ÂÌÿRl;9hwÈæ%éȨùùfxЮˆsm‡ÍY4§Cfüž•A×ÌnV å[D‚Í“ µr2‚0®vTÖ@&a5Û,·ˆIâ$@H g‰@Sè`âÐÍí•Îðêæ þ4) è†oòîv|ž¬G9<,TI»½êNÈÕ«É—éePª7®]>[@Ü{:›Z:¥Îiç}dÒì‰1q‚ãK.#Æ¿ ù+×YÛ-äj$/@HÿåæŒzk´=(rzÌwêNUoĺéË6íËd=ì;RÙmãòJ—mxDêÖÇõÞ™ŸŽSÂÙŒL¼×3ñùƒ8¬ê¢·"ººKØÁÓ™çÈw¡ñwh“y…´o3#TS]/Ú»ƒ”gíÖNRéÍ+0M‡1~ýí;ô÷óƒg$§꯵Èw"tŒÂjF£…Äj¢Öð‘ÀøÁ-òKÇI!$€xºšBËúúúŽ‚×è!àR`âÕ[^mnÝzƒF>°iKº|làl_Rv|;x,x v¨ê~˨©"ľëólÖðÆ7=¨žomo §Xó°~$C¬[:g‡CAòñ%34DSéÂL4¢ç-XzàJ¹û Á][CÍê®ÀÕÛ¯<A\[6•ž?™n=*/æLÈ{¶í-wò|m ÞåÃ8ìê#dè8•¥¬Å³ðAI â«µä®–0 wu•†Ë@^Kå¯FK_ ˆµhnÉ_>Î $€ÀÓ!Ð:XYn¼° IŸ$öÝ@SfFG'f¤Äž미›\BxzPBdÝ_éÒ­]lFHßþݪÊ`"´nç罹À²¶ÖNÝ ÿû/'ryÿ;{ò;ÚÁûcRe‹ªk'£ïò»Møà#°EƒÞ…Ì“Rósá½?³ŠJU…9÷<ÄÅJ‘–ÙÒ:ÛƒSþwákWNï[ûIDøõq3u,.}˜³î?°O—²û÷ ]u1k‹†œ>UŒPèô*Ø€ó£¾Øº{aàp¦ÛKK;Û‚ øxì5EQ깋)°ÏÁÞÔjnl§¥|r´Á0`Ö¨­J­Õ”Ó;!pÖ¨‰ ×ɵ”/ç@HàÙ!Ð:XdQ)êÀ€ú´¿ly_¹"z˼eëö´î?kÕVõÊ_òŽ ôr"B§^ÔþêàÕ¥M5ž# I:¼øà5Y¯)¼ËBƒgï‹Íðô[òNï¶ÕÊÃa¥Ý”ŠHšÀ? ɹ²wûÊ™Kañçäw]„à±Ðg„³Ú\=/Lórow1¹¼?(hË%gg É?þk"¸[Ñ·UõHÞcömÚ¾mÛ…4â>löš õ²ž^?abóÊPðQ>·yA`¼º¸‹œÞw¼X_ÓØšq„Òás—xÊ%éqQ%cÝ ­Nzú¯œÐÛ!éÀêó–žÎ„¸lëúÖs'i}oÏË;ŸèTà Áa-Á5‚pU:ê ~S1&$€@H 4-NFN•@¸MÛºJûù »v®~M3 …Š'” õ[£R¨˜ÊÃú5Ž*•¦zuá …t÷ Ú—DÖV¦¸H%±–VÈúúôSš›C¬ÈåÕK¶¸MÝ<ÌY£(Uñ¤0{6#”Ô²ÓGqÚ·JdŽ­Jïüºu[x™óÔÍKiuHU)hA¡¤aCªÏðŸ^ÙÄ?bGm°Yý‘cë—DJ¯LÍù)Uã`#nk#m%#Ö–D,%ªR’ºaŠŸŸ„“?~üÓ,öŒ@H <»âââ,,,@Þ‰Åbx‡‡€ÏçÃΰG$ „¤bSXXX¥!õIÌ \C›õl26ž°AbÚÐ9È]‰>Ž…ÉhLÆVÑßÊÚ¤S“ÂϪRÖ- ÖßRŒðí§W±<‰”F¾€-‚³íä_‹Øžl» ­¸oé¯oÁlÅ–tRËåê¸x– ÖrÄ\"à®rDÈn¢ëuDZÒœq.H $€ÀS%ÐPÙ÷Tý,v.ì¹vó¶‚R•Ц­ÌTÁ×a¬Ž¾k6ûÂ`³–ÙA‹2qh0 ÛÈñ8:1O"˜¾ÀéEG3˜@H $дP7O¡u6VECJlÀdýB'>‡p9Tîj‰…Ÿ+àñø„Ã#Å¢Åur/ô'@Hà‰hŠurOd`Øè F€C÷“ãrÀ̵ :p…»8D¦³àÓE ’1!$€@H i  nZžØZ ÀNr|D0œƒA s9áñü@A ƒU@H $€š–úE4-Ol­t°§2ÃÓ€=˜ZÁ /ðæƒ=˜C,šQïÚµ«sÀjH $€À_øËëÍ}±õEsO û{žè8àA¸`¦‘"x°­(`®€ªa° ³ŽÃÏÓtp¬H $€À³OíÁÏþwôBŒnž Õ‚Ü!, Ê—p!|:MÛŒ¿Ói¾G^â8I$€@OÚƒŸtìòY' àé@ka'9­N­Ñ•눆ž  a»nãE<ë_ Ž $€ÀóGý"ž¿ï¬EŽvR†xZPÁ €-ÃÀf/!å°Ç4haÜW¹E~ë8)$€@O•@3>o~ªóÄΟq è]kåX0‡«Öx1¬³„š!°¹4&$€@H 4-§iÖä\=~-GevJ¹‰1‘c²Ì_4[£'Ó£·Ìþdcª¢¶*¥±!ωªõzmõ çU7?zòê“ûcú~N/ëtÔ¬ÑiÁ(¬f4Zj¦îj  Ðǘ@H $д§ƒU×6|0iö“vŸË6 +çô2zfÙÍ:HHU^bÔ‰°Ä<¥Ù)å]ÿùø/?ç=C £¸GÊšï˜MQFnYFiC;gn‹ŠH,7;1ÞÏúîÙ;ÿü÷eŸÝZ¶.éÛ uúC®ÃÏLWRÊÀ ¾P}b”öÌsÐ8püDH E ¦lÐô2OÞ(ë%˾ÂÖ§*“Ò«Q_q® 4¡ÜkòŒY^¨ðMÿ}ÏÖ}Çˈ¤³[k¶}SÜ;ýíÖmIùPÔ}ʹ}Ù’W³®„ïÛ– â»x÷(WÚŽ!iÒ÷­\t!“É܆Ϙ5ÍQBÒ£7n8I&ŒuýuwX‘øÌ\3¾·œ(®m \}ËX‡Ê,›+N _¼.¬ò¤œÍÖhß.3"" .e„Ìžƒñ‘^ذ|W[¶³wÀ4+}¢‚ßÃÖDœH"b×É󖼿,½öQÈ £Ü# $ЇGTWÃw8r޽yp·m‹Ð UæÑo¶G]bÙ:Oܸt¬DßE zç |!8j †¨„«ÒQ·`‘†@LÅÏT*{˜øxÖy‡´§ŽŸýÄä.Ù”<¸CßvµÝx&¡È. 9SÔãFn"!ÞÖÞë«ÿ[nÔK’ÓeC ‰ÏŽýýãô¿9‰ßÇ÷Y‘EººgÿÚî1!$€x*k“¨û/BrÏ\ÎÔ<¸xºÌÖÓô%5#Ý Úq®í°9˃ætȌ߳2èZQ¤„oÜÚ;0èŸÎd/›Wÿoå¶$‘ï’k‰“ö­ü.×pAÿ‘}dˆ`÷YÁ;—ÏŸßÙ¦ªvgÈ˃ç¬Ü¼{áï‚äã¿üA1£($ùñvŸíãç+#Š˜}1Å„Äÿø%ˆ`Ï)k·í ñu«Ò{¾D°í„ Ý!—t†Sz[Xö%òWÜiɈéËûÉ…„š¹r]ȶÉloÅîŠÀ°­’‘"Ÿàç-.KÙ¿ö;Êò׃ÖíüqÛ×;G€ÂNˆ»ìr.î,»÷²©êÌš}L{¤yì™KˆJe”Œúu[wpppôò=eúœ—«è›ÑvLn“±siàÎÓ¦ÆÁ¬ß7.[»éjy»ƒÂV“z­í¨}µÂ‡·Ê@JJÑqÔLÊrV/(Fµa¶}oUæLÈ{¶í-wò|m`O¶=cG2YïMê–%Á1ÚM[º~Š·-”¤å$Ý—‡¬õóöÊN8¾gíìÝç2©K,¤ª($n7Íä!JŠ Ý° àBÎcU ÛÈóõÆ¡žât9.ì!§ót ‚é @éhæi¥œä¬N‹´?D_‹]s¤¤ÆHtIÇïÌ2–ñœvÃÄoX—t$eØßغí_—UQ¹äNî?§Åšp#Ùø{3m\y?{Ö„¸abÅOHú6ì–ÀåˆÌåÐW‰Æ_uaá¦ObÅ.Gè«ýÅ/Wi%éÈ-ãYç#‚i·%²NE•­Ã˜okتó/V.‡Ç¯»ŸYçßTæåûïýí•Ë/Vއ»øÅñŠ9U¶^ï\iÉWë.ÓÑÒ‰6íês„3 Ö°Ó„¹ˆÛÇ® /0™'õÙÕñŸ\þçö{¿»-ÀtÓRRëÐÕFcRÇΠö2ŽÇ^S¥ž£ÆZ‰ƒ½´mgW(ù{Ø«‰Ñÿ·)JOR"w¡>‚eÅY—ž¯t±µ¤«£*“&ûÂï¶4åŸ §ÂÒ9r?רh‘ÂéÐò !-Ë‚)X¥.2UÉ•aûö K3þû}Ô…è-ÛOTõ¼€rBYxÏ‹>}bçÒpÙ`#͵Ϸ¶¦EïÞÊThJf€½¹ÿÀ>]Êî߃³êb£¸Ï<ù{rfnò‰³`ýw“óJŠà³“[{QÎå лòQ)£É¹væ3ÐÁ'“Á·„df›E‘›|ú†ÊeBàÊ 0ÅÃBSP¯E$>‡paKe*x-,ø\Ç'á€,PqüTÒÝØ[ò¡C¢s½ý;}¶ÔímYÑŸ%tû窉965á«bQÐ*÷ ÛÄè?‡¿—F-þàör!µWÀõX™C0\šaŸvßxÅ”,Mç»6¿£wAy™¹_-“¯ø*.76Î:èwûƒyÉK;y2kÕª=•E³ºý¶ä`‘÷ŒnÛWu„ï¾yü‹DC©G’z$b¼ÎcÆÝä‰C¾2Ù}©×Ô¤XöjÐ8ëC[ãî蟤T2—cîg:¾ÿà ÛEKÝ?[Úém’5wjV]*šk¬â\Ùš11³¶Â’!ÅF§o8mx$¤¼Ÿ5Àóôʃð×£OE+?>=`]vÅ!$¦:˜²öÊÄÅŠDgWùo„±&~"$€¨F€%“¨ýVÛyΔX¹Û’Jõ#µ×ôô_9¡4øÀÕ À‘­ïœ}íøÄn²ŸÇň„¨][$žܳ⒨ƒ õ«‹–|¹y×¾upÞ !=ùÆvS|~ߦ}ûØ+ÄaÂS;«Ük¤øDèµb·þŽb’û}ò¸þ¢ŠºúJTÑò½&ÿóbÒꤸÐ}b÷A¶§ô×*Þåÿ˜ïcSè…ÛÄnÞî­c“Ø+fÛï9tìäðˆ-óòæìì=Ô+æÀ¹Í Îuîí%&§÷£÷XZU,úmÓ¼šs²ð™D9ØC‘°wu‚­goWr)å@ôµWßÛ¿3tÿNZˆÈ½ßÚ…X“š(Dé¿í9°-Dì{ObºLP¶¼sè~r¬æZF@¨»0<Ì?Rø>¥øÁ¥[Þ¡ò1ð ïÿKo}È,ê7^#ñ§'Œšß†þ é Š?ºäFþ½R"—’‡w¨z[ôiùájÇel xc}þÿo.ušùx®ñBµO¶ÉÏNöúØ­øÊÖŒC<ÖÏrJ÷Z‘Gé$>™Œ^:ðçYôî­>–mG&Ìý,ëƒ=D¤loÀmø£;žÐg\œl×zäÉõ7Œ­?ÌkÔF¸§ïéH»×é>—û,N8”Òá=W³îÆŠð‡_Á‡ûÌ÷dÿÓ1ËíóB-½‰mL*-¿ÂŽÍ{連³l‰Røû½³Ä‚mR±îb"Í9„ÿÖÝ׉{êÛÄá+2·žÿiÒ“œèhõå ãíï4µm+µ2"4§â$­Š $€@-§ƒ…Ý—ý£¾å.½}ô—±k¶±:6Þ37 z¿Vý %Rã?°6Ã÷¼®(Ôðl$B2}ša\VÎ> ·¾®P€¥“/ Æ­Ù6ÎÐ䜯' M•vŒ]}7íõh-Í T'¤r ÒQ«~¥/kÝý£­¡Š¢Ržµ t0ÉÐ@凕mª¸”±²†x.˜m¿×Äm;ý S¡DÈë± dP©Š'¥ý¿ ¡„ð2Š"ÏZÊÎGÈN¼”HèáäÉ¥<©TÈë¹íë‘*2Κ3(F,Ûö7(Åh\ظ¯¬rºÏV"Eð9áòÁ9˜`dx<ØÔ0Íž˜û…!ÐiW·êEp­àÈ@+Õ©wÊŠÔÊÛ¬¤Óë°vN–Piý?.‰6wœü7;—6†?~ËÑ„ ýc¼Ì}®Ÿü57z£VkR³¡•Aç a—ˆÒ¦pú}”O¬?žHE0$Y¥^sù IDATöŸ H˜sCÙ¡—¦œŽbFÇAú‹|é¤÷Ö/Î` ’ÌT“—…ù)…÷Š´^©%}Ð’pSI‹EÍáK‚¯ÙÍpèÛ]êÐF$³1þeÓF”Œ Ä® T¹¿Þݺ·—óÇmXWeɃú6™’Ûy?Þ$*vìp*·¸š[s§Ýë;¾LËZº¯‡'Q˜@H <žÀU<¡ÔÔ|«‘Pbcnh k>ذ¹Z„ªC} FkvV¥_bm¶kc!žÐªæ"y³íWœ„þ%†9VdŒÍAwUf÷úK*µõ‰/43ë(hw¬œ6VkaŸ:ØS™ÇáiÀ9˜€‹H#x=<ÉáÐâiè`e>}¬A^³¦à¿àÍDo¿æ»üsª'»¾¯*¾"}å¼Ü•`WÞ†ÆÖàñÚnv©üa©Ë+üÈÃTÖ9þ«ø^Ô(]™îä›sΨ¼Ns–=Ú‡Í4qSúq†ù.úbð¿ÇV‹áRµ”¯–L ¶"ë…ë-¦ ~µ)I?¨·W Ü=½ °¢w4e½;5KŸÓ¿G^,ý¸‡ÉßòqkÓ˘GH $PUTZÊc$ðDè8\¬“°"Eð À(`ˆªEm…\ÂkÍžøV¬2½«*«Tcf‘žà»6Ãû¯Ù»Øè¾öËÑÅøC¦÷,~Ëõ×ŸÒÆ®¸2ï´[Ï¿Ïp£tvžN¤Û']È úÇ•C“>ì*;1ë/ü 8Âêy/w«'S OP ZG]ô~ Ä]É»¯?AO ,+ÿÒÛt½œôßáËú JêvÂht¦ƒoSBMk™KÂqs=Ë>ê‘Uvùôý‹ÿ\ÿñµ7‡è[)ÇÍU¢f}}Ò‘º[—3ôÇl?œ¾ïö,û»ëéøÂøË9?lMGˆV¤~:©M/B¨'4¤®Ž¯µ+/£zÚ‚×Ê©j—Ål1|CH $Pÿ>Õ§–EMMrS£ÿêaÁãÁÚ8>‚ kæš?‰œl¡××wÆ‚®51¬Rã'w¡šœ»P’:ž&6²˜ÈFê;ÝýâRú°^¥Ö?Í×Qó,_à>°ÃÏ ýz{ªÐ øhµº$ÎKrп¹_38 0÷ó¾ý= m'ЇB¾ìU±õîÖ¢ ÝÆFt'4-ïL Ü+Ì)àó,E<‘ˆg)åó!`³ d¾5Ø+NµDÃ¥¾H w²ö}·ë—óaR&ÕØÂ©Ço›zqíñJej)·„9Bš;7ùTJé•ã©kBÙc+X ”Ê~Ü}/‘.Ÿ¿¸gÄ÷Øk°  `dqFŸw-Â?m{çÐõ¹•&jÂw²ó'C¯´Í*ün¶½¬\•wÉWŠS·¼_3ÚXEN²EàÙ¼öìøl·^"M»AN3Râ+ß_쳂,Zå8ÈMXœµaLʱš‡pÙÃG°Ù^ÑÀ.K+¦Ð¦ÕÂqä]ðô½q{øàÛ§M±££U)w¯¸»â éjí-#±qzeÏg—ßYâ>÷Í$r#}ø@ê8aL¶ƒ¸ó†Ï§ó©6“Í8!óY¯ØF¤Jbwb£QÚæ¿'_ý`è!‹ÿaKPWÝáT­Bêõn¯ðûWÆn½=6z·]ô‰Ãú­BXHoÜúQQŽ×}×Þ~—^¥ ‚-T Ú-^vq@Ù§I!_%‚ÚÉõ:¸KÛäúú¹ëõÕº:„ïèVc™ETÕÍž?iãÐbÉÕY¡†)C:ZoÖ¥Ch1bœm,Ü'Ü(ŠÕ7Kì¿;Öݽ(óì˜~X¸d!k3\ƒoû—ªyËÛ ªqª,9$€@µàdäüÕ3ßZjái$ÐdÿˆµÁ&h®‹S;a¹–(5œãw´mmD¶Ö"™ŒÀÚ/±˜(äBÐ???ÉãÇo²¾Í5ÄdŽ©~ša JA‰sÄR¾Èü£® ¯<šõÁJò”e|¾añ˜®¤š³ÅRAµºÊRuø@-icÜŸ59Õ´}KaÍv`$E â£X|ˆ«ÌŒQª³ 5àmeS}lUÊU?Е”2e%5Ÿ×¶ ìúW¤,Tå³Û×Y·™x,³-Эï´eÊÚšª2†#ñjÿê1,Š@O…_ùDû‹‹³°° …b±Þ!Á¡@¸ñÁã’Ã& ˜ÚØV¯Åžèȱñš€N:0C¬`5£ÑÂxD¨‰"HÐsO¸=ViŸ´‘WYœcicÞR)e\Y¬Á9ž];½3²™ªŽ¤zêæ+2?¶êE«s,¥xU9W·‘P^IpV¶WmÍaQõµ‚uëK!$€¨®“« žoV\6H®NÇQi¸ 䵄ºké ±öñ½šu´Ø@H $Рn_bK˜GË` faŠÑªÔZM9¯pÖ¨!ÌBK˜#Î $€x¦ ~¦¾Žw0|¢S/‡µCÔÂUéì³~a㽸ppæH $€À“ €:øIPÅ6ëM"E€—«¤0È_-(`-£¡ò Á¡{¤aBH $€@“x–t°&ûLxXlb6L071&ò`L앥Ɏ=øþd“N{¶h¹\—c»šñ8cWÀ…]åˆÝD‡YT.B{¶†£AH $€ž_‹¡º¶aöêtç‰—Ž•öPõÆòåc»7„ˆ*çØ‘p¥·›w¶y×>~‚¸Žô±×džøåˆÊ»œlH›„(R¬ w|cå±] ýáˆùŸ‘=s£ók4iáLÊÓjœ%ƒæïì}cãæ#)úKb±ëÐi£z5pH5ÛÇ3="€1¶‘ãqtbžD0}A`1Í4[zÒ!]šm"Ø@H $ð×§ƒõmV>µ®Šn‡ IU“UT¨$R[‡—ÚÔØI_Vÿ.ѽØ€¤|Ý€NÒunÐzbi¯/bþ]S˜ž–ųqxÉš)Rk}תEUåUvˆUÉÀióÛ«Eü²¸ý»’òÉ ÉsºZÃÂ,>—a´"AÙSûÄçáÓþîA”j[¹”¹{ÔJFLŸa}÷ÌñQÛB:o[ãÒh;¥FQX¤2ŒYQ”§""™µqS¯ªS¨q¤:±ö½ˆ4‡Àm›º4z5oö|ážÊt{e >WÀƒ½”9<ÂY, Z\'×ì_vˆ@H Åh ,²°ÐsâW¶v3ì£ >€@žêæ—ó×§ìƒQ—rÅξóûÛóHqZÌ—›w¥—{7×,Bª ^EÊg+W«¼oò%=z㆓dÂX×_w‡‰ÏÌ5ã{ËIÑÕ-ó‚oU~Q¶³B¾èN­ÓU» œò ƒµw{•íK•¾+‰¸ööîïb¢Ö5­î¶ï6Ыµ"CJ¥o­»÷éïÒß³(þ½èüGJ§UUZÔêµÇzM™±?4gØò5âöï9u:{Ïžá?FT9S/aÆ «¡‹>Ñ%åðR5+dOwIéÑ¥³cˆïº­þV¤´FuÕÕðŽœ+ Ãp·mÍK÷""¨å:#dö$ßÅ»Gu(<úÍö¨K¬ÅºÂBO ?'‰C÷“%Ìãp-# Ô]˜Ï#ð½Á¯ê)Ç~Nâ0‘@H z¨T®õªV¥pf؆Mר)Wõ¨BÈÊ_Z÷–£¯ðЊ™Ñ qwT>.„É-SdÙu¿÷XÓ1 Q±×ßœÔ9ë˵»Ò‰Ã„ùY]Ý¿'¹JÃô€G`¯»g*£($ù)v?áç{1"*f_ÌðÞ“níß"ØsÊúé¯[Ý´ *¹Ú¦]†³ŽlÝ’Ju¯ªÈ°‘¬áÍIÉ€)ÛD=« j¤ªVd(öànºòÖQêPѺŸÜ¤¼FSZ@rcö‡vööÜYv3vùâ¿•ÞÌ€½$òWÜIx5Qÿ³Ÿ\˜{ùˆ`ûaó?%¿Zl"éé<žý¤ãpøŽŽpùàÌïdx<ì †™gÉýÙ‡‰#DH $€êB )t0qèæö Õ„êŒ{iú^-ø¢¶}“Àš' k:e¥™¸wÀš™>š4‹˜„0·Š´Ké`6ÕÛÍ…tšpòDR‘¹Q+ 'áS2yõ¦×^b£¢¨dTÝ¿Vg××ú:B‘nnò¨dcÙjíÈ;uîáçÔ÷•é™úQU+ñØC¬û×.‚r2·áS§Oª¹»•ç”ÍÓ_—Rz(œr¸~ñ4PÙ}ãæ…Ub]fÊ¢ôæ•êÕI÷Ö â³2Ã÷}]:ôÍ1¬?†ƒ“œ$e¶îâÙ]&$ \'Y'¾ Uüû#Ÿ;G G¦`ìkã@Ó; ê1 ÏàÐu0ûËÀ7$€@H  4…–ôõõ¥ÂKsó#±`W%šÔ-K‚ÓÅý§-ÁœÝ¸/–õôeGmÓ¶|¬­ìú¦wZ`¨Möq®µÝ—•vb’”z£nnö#°­šœ¯ÌÚ÷9jõpФ©£ã¦ƒAa;ÌÚ¼®»”O5š¹dWuÓXy{¹ƒµ|J×"{¢J¤5ÌÏTÉÐ 33ÁÌ\Ùn•ê’6ËCÖž8x0:öøž„ãÿ›¾yzS§Y‰ÛÄA/ ÿùtlhRìÁ)Á»úÚ5Å—[9œ'›Óq¸à̰"Eðà0WÀ’æÖqøÉ[GH $€^4MagS–³>èU/GA¦–€YWÜÉ­½(çò…\xØÿ¨ÔpɸŠÎÀYÒÎÄeÅ8“øÇkWgÕ¿´{/W0ÓîÝ´ãÇ¾jIF‡êÜXÜ8tãq-Ÿ|Pgµˆ`¨¡6ºtw€Ã’RË+^.mùRÛLÊ.7>6úǵó.C–Êx3Õ59×Î\cú/ød²”ÈÌ*S©5uFÉ¿{+S¡!¹É§o¨\&®œà¦yÅÃÂj· Pò™Ntód ü#¨;„#¸>‚ kæ0!$€@H i 4…YT(C°æ ašÄi°‡¤,aïêåßX¸ƒNÍ=} Æm¸jœ<õ&²þMð"eIû·lºëäM= ËØ*ͺPKD‹Bª¶pÞ¬¢×ÉÑŠìw}Æø.'ÔšI¦ßÊTµ÷Êó•9Ã0 é>qùdo×['¶Í›´2è`b®™™²õä^Þp'páÀÞ?'— 6Õ¬Î(Óöï ZðÁ¤ ûã‰Üûí¡`Ûö:$oÄ–y‡®–¦ÿ¶g]`àÓ€çqï©C\ëtÂÐãSÿðt „µ°“œV§ÖèÊuDCOÐÇpsÁ˜š¾ŸúXqH $€@‹ ÀÉÈ){BQ)J‰D *VQTÊ“J…愦¾kªT¡á[I l½“¦(õ›JG'{¾2íû•›n÷…;—9ÖÞW½;hD˜ì ÌVΩÐJ˜ºafjØòåÙ@ËšÒb•™éרΨÐ_b JçˆPÂÒ¥yú“Må{#&Ð,UÿˆµÁfõ|[ ØEY©åžLcÚÉ$¶Ö¢V­ˆÔŠXZ‘òRòû²)~~~°ÝÜøñã›e\Ø @H $𜈋‹³°° …b±Þ!Á¡@ €çùð¤™Ã&Fð),,ì &¡Ä`’”<. .(E«†rfòöí 3Ö–Œ˜ðŒˆ`ÌË$¤£a¦ üF*ôñ¤VÕʱó©Q/”Ôø¾@õVÔ¥ù†ÜK°½=å7Ø<™X+Ç€9\5쨬£¦}0 «p(ÊÃÃî‘@H –G †®zÞ¦(t»mÛð…RÃh$­ÛJž Kðc(Jº,Ù­á=¯šõ1³kÐe"tØPNÇQ3-€G„š€…<&0~pƒ b%$€@Hà¯<÷:˜NN(• Ÿ/wXs–Ý¿úšZþ5®–0 wu•†Ëh5Œ–Pa-}Ñ%thnù?œ!@H æ&Ðëäš{ÌØ_ $ÀÑr XÀYX£b´*µv2¿ C4j¢Âur-ð;Ç)!$€xÊP?å/»×à |!8„Z‚!jáªtÔ-ü" ¦bLH $€hZ¨ƒ›–'¶Ö@Z\»Õ …AþjAkaåÈ_0C¦ý"È«!$€@µhþÁµÎ/<7´\®ŽËàÑj-GÌ%.ì*G„ì&BÑá’Âçæ›Ä"$€xn ~n¾ª>P]HÀ ÛÈñ8:1O"˜¾`ß<Í`BH $€@Ó@¿ˆ¦å‰­5”ŸC¸l£ [ Zð¹ì¥ÌáÈbǘ@H $дP_4-Ol­¡8öÐàrÀ̵ :p…waØìöÆg ’1!$€@H i  nZžØZ è8>5sùà j˜Ë Gà j¬Â˜@H $дž²¾Ðä\=~-GUeVª¼Œ´ôD}I“{ð»ØÄìêMk²Ï„‡™9oRNõàê¡=[¾ Ùr¢fu“b˜mì©Ì£nðë/ƒáÃ|°sˆÅSþ6`BX $€xÖ 4J_ü¼pÒì…¡tŽÌ…Óf0ÿ¦‚dD/›ýIh1Í>&©ò£N„%æ)MË)n^»èð­RÓ“M–WežøåHÔÕÌê ªrŽ ºú úùŠcMúŽåÁÑqWËËs®§äTœÆL“ÐqÀ'‚pÁL#Eð<ª€¹à ­s ý"GYY“™©@ùdî×?^GH $ðüh”vr“üó·©ÎNº8ãf&ˆWÕ³)â^nVu¡Á“5û™&¡ãèY³wü«­’5E™©)7s*UQ^AQ5ÅÌä+X9 Qä)Øè³U!=)é:7hýâ7ºBéQkf0éçÖÍ£¡ DR‘éHªæ•PN6lÑœùkæŒí—4EÙé)7SÓ2«Z³«V£º ›'CI-øGPw ÖÆq!|: ÖÌ=­Ä0J}bÌéËŠ«†BJebõŸØ ”©;gúˆ[·mßRk±€³3±.7¡Ol<Ø0@H ç„@£ôEÇ}H\ìµ;…^¼ôì„““³F»’ó™äÕ )½õõwçÊ˽&ϘåÕAªJ‹Z½öX¯É#3ö‡æ [þ//='FáÑMsOZø¯ ôáä%Üs¢ß¼•öÖªØE¿’A#;fí8GÄîÓþµÀë%aqrøâMa•„žë¶úWÊnÅÍõ Vôž³mfÿŒ_WHñœ2½¿Íñå3£<–lÇÿlåj•÷âMaIÐH̺÷2üVÎFÛ–þytçÖ¨K¹bgßù‹ýí©5’Mª›_ÎJ‡ì‰ Ù'\CÖˆÎmÙ°ÿœáªØ+pí‚.Ö¥ìhû nw'âÄ£À•¾^ôky¿Áà0‰´î?-ÀûÚ®à ùÄ~Àì…Ó ‰êjøŽGαu×yÛÖ¸€Q“€§!¬…ä´:µFW®#z‚€>eÉ<µ}•3ƒíWè¿”Oª?YåF™8UìZã+°*pîÇ>n2¸’üÍÔ®Si‘![âc=k”mü åO3\?¬:ˆBýM`ãÛÆ@H ´h²Ë\{Â?õ·®ÝÉM¿bRzrznZB±íåbs3vâß_§š›ÿ—¶¦3Ã÷}ù¨•ƒí l  °y2!°VŽC À®vTÖ†u–P3°Í2\mþĜݳݤ×È£SMiÖ¨7‡|þFJÂù½KÆTØ~äzEþ f¬$íô­Ùòv_;·rñìë"£¿/LH $€À_hä¿—mzôµ={.&Ÿ šïá–Ý•ÄÅÇÄÇ ¬¡•íÙlvò*ÖO¡zåFGâ6Ö(,L†ÝÚžÊcÖ<Ì×ú®,e¥Qáð*›f³Ýz’t`Ó"8V²-jûNB^•“¨Ì¨/ö6ÉQ—Á!£†0áu螘—áJ÷WºtSÊH¨å¾ý»U´¡oYhÝ ¬Ô÷SSŠåÝ­Øk*}[¥÷ª9õýÌ:ràêkŸX&œÊ)îV·u&íhr®»Ãè¿ óK7ìÏÌ2ûŒÝ¤B‹Îrµ„½«ã¨4\F ž„ºké ±öi؃ÓOýI™û=?aC¿1§ {jÎÑÔ€·AðÖHj¸½¡§ùÁ)§Šz®Q¶Æ‰â[kÞ™JÛ'äèÉ!‘¡l¶hb3éÞrZÄŽƒ½N"#Cí[çøBG>¹wtî¢]}EÎy‡–[ÿÊÐÁé1œ†.ÒWaß#C?_´êèå#éaC{„ªiÇ×|8‡á˜Ëþi»Bý‡†îºuôÎôíƒ×Ï…oþÖoªñ";p’¦:ø/'e(ŠH $€ž<ÆùEÀsa/úp¿u¿Ž`þ’w¥Þº¤W95¯öô_9¡·CÒÕ æ-=ië;g]_;ƒì®âq@ˆBeÙÝÅ pœ=üã•<Ú½—ìÔ IDAT†Þs@Ÿ3ªhTh§¤Ãç.ñ”KÒã¢J<¨»-Q’2IþÊ[(:ÐË ü€{AâàÕ¥¾=hGÄŽÀÁ“þ£t xñÁkpÉØ¾¾Tõ(U X÷\4ª=IÚµdææý±²Þþ‹ß{ÕPÍ8Úª‡tÜB©~ú†Œ2mÿΠLLäÞoíb¨òB~p´Á0`Ö¨­J­£<ØÞ©—°š¨*ŒèÍ''òóÏiocFö>eŒ¡ã¯¸dnVö¡DÎåo¦Î1ŠVêÄS·$´74ˆ`öO˜c FD°Ç§‘'.Â^8µhÙ“!g?xù§ú3ôôUë·¬_µþU{1“y¨Bìˆ<ºw [¬õŸdý#†öí„ÆÁF²"ØÃCß8¼o8f¸™Ë‰1ÁCÖïø~ï–õCˆ5ýÃ{̤*Zà @H 'M€“‘Õ'˜4ªRpîJ`ÙX“¥â´?n•ÈZ•Þùuë¶ð2ç©›—ŽÛ Ä(*žP*lÈøh]ÂJ„ 6«3*àáK$ ~ƒæüLUJü#vÔ›µ;YµBØ´ârrè¶Æ¡•´¸• ±‘‘5Q—’ÁSüüüt:Ýøñã›aüÊÔÄ®ï@GëÏç/ì+ËŒYÝ~¨~É\@BÙÎú{ååwÅ^¡ìhü—,‘\?²+²Âê_ô§IÜù®ÍaÌ–øˆÚâE˜´CÍÏ)!#]¬”J"ÊÿµgûQl‹cÎEô' å?q?*´Çì-ŠxN0ÉߺN¥C³·,â}v\LÌ¿¼†ÓzcÖŸXØ2—Cü¼X¾#¡hf+Òˆ+fÍúïø}ïÌA§W·}…3dGQÌLÕéÕ>¯¯`mÆÄÿ÷ìïé]! ¤Ìc”¾ ¾#$€¨/¸¸8 ¡P(‹á >ŸY9lÒÀR|6………5XÀÕu` 1iP†&Mù×"öD€£›ÄîC¡"Aƒ6BcêêGÏ6¼w€–ñ¡ÕèàNDnÁà¡j-¬œO 0ó5lÔˆæç¥¾f;üt|_dä¯ûù“¬äݵ?6¨ÇÈêžÜ¡ÁÁ&ô¼±Dpý“Gä½#ÁãYˆHqÖ-£¬Ž<þóO©ðP!7Ò`m޼zŸ!n|RV¢Hw´¬.þó¼¡^dÜñŸ~JgŸK» õ.ßÌ& ƒ+S½{¬¨ jÁ0V;wo°Jëe/{µàú)ÑÿÞ¥UD0xdÔaR]` $€À%Ð` øDGõ˜Æ}×lö)„=44 Ofצ!–ÜÇô€—››€–ËÕq9 ôÔZŽ˜KtW9"d7Ñÿ]#nt2eâ.ƒ9ósמ1ìƒÿ£$%Á;Ž/Im±¦ÉÿÓUÅeDlßÓ{øAõv76åáЮòOR`S©¶WL`,£ÿŒ9Õº1Ö·éäAN±ã\1Á € µÏßÎ%ÄŤ©†÷èìælèQ,5ºJè®Àk^U¯€[E='e2TÌ"$€hbÆ:›¸Ù'ÞœPb#lr;ó5vP;uȆ °£ót ‚é ìÁ:šiΔZÑ_B¥6œ‹üìTºÿhÖjk,å¿pãòMðÇTL àr¢.Ì3¶OV}ÙӲ⨼œ´s¯¦Ä+.uÞC£h³>òC7b\ýY^^nÙ±CeAškDµzmW ;ü‘« ´¡“ª:j¢÷v]õû¦7¤»íZ"x´þÐ`úÀ?aOdÂè*ξŠpJ¨¢÷š`¸›Š=zz]iþëÆVÆzÎn£GŽþëÒ¦WÚ£i¯ÀŠ5û?ö©i®‰º¨Ö#"$€hÆÆ‹hHŸX Ô$À¡ûÉq9` æZ¸B€» ŸG,øtÏÉÍ–˜ÌSŸ±¾K–}8ÈÓÓ³¯g_öÕÃÓgæ¬OõÈœó]*³0IuŽ aRçqY‘˨-àxKS˜ö~ßÄ$æäd¦'ž>´á_;« @_Ž}š»E˜ðù¿}“˜N륧&Ú¹zç±t“’Õ³ í±Z;¢Që §NÍñžûMrN±²¸ 51æ§c‰üNªZxˆ@H   nˆØDã ÀNr|D0œƒA s9áñü@A ƒU¸ÙRüO{X¯‚€ÉLÃÐþGL2ÆOûüçs9`(®ˆùÜ(ƒu­íÈöFÃ’ENêѶuë¶í<^³(8,·ö@/2Ïcˆ5<ÕÉÖsrõóáŠ0ØõRS÷HÛ4I²A}`8Nø|j×¶ÖbëÖ®C',:UL8)“æ1‹@H i4£¾hšc+-“€öTæÁÿÀL­¿` †Ya·>8´h¾ßiÁ…j ²ÞßÍ”·•ׇ†¾äXl2÷4&VµÙƒVF7ö¿XêW{;"ÇÑWóv|j”߯ÁxŒbËv)} ¬M;üÏñGwT¯F<†¸Ñ¸Ú1òÇ÷hœ‘UÍÉÖÆñ«·w–ÿ~•QÄÎ{ô³ëþc»¨h3H $€ž('?ø‰ŽoôñƒWÌwíØÖBK8ejΩtm[aQ«ÖÄRBD–D­ ¿ý«Yã?k`™â‚ìbjˆ­ ‰êêØÏäd—±Z °ÑzuŸWC{¬Öƒ2'3Ÿí_Ìö_eÜMÔEµñ $€^\Ï\üà÷«À™×‡€Ž.ƒÿƒÜ!, Ú5—p!|:M[E>Õ§Ý–R–o%“[Éê?¾ÌNÞ€jÐQC{¬6F‘¼Öõ}MÔEµñ $€@] 4ßóæºŽ˽<a°k´:µFW®#z‚€>fÂ4Êýö…Š“FH $€Guðãáõf!ÀÑÐxZPÁ €-ÃÀ¦‡aw’- /LH $€hRMó¼Y¥(,.ex|Ø%X*6E›šìØÈhÒi„w¶ ž¯êÁÕ裱÷KˆëÉÃÑNÐÌÝÕqT´˜&ûÌ¡SŒëó0ájä)¦S-WëÑM£ŠÂ.Ê„ÀZ9ÖÌáªaGeÐd`V3°Ír£ÇÊH $€¨I ÑšU‘zèëÏ¢`³VC1÷h7©ñ¨¡ŸªÌ¿Qy÷0/ÝêÒª&}Çòà[DÒÙM~=%ç‰ëàfî®.*ʨrŽ Wz»™‡©Ê9úK¸Ê»‹ù«<áŒNGMÁ°ë8jF£¥vaê¡Öð˜}Œ $€@MK ‘:8s_àÒ „ÈzûÏ×G¨,H¹z‰î„Û ”µfCD’ÏâoÇ» ‰¤ëÜ õÄÒž¶¤)-(RJdmHAzFÓÖÙÅ BjÑó…éiY<‡—¬™"±–ÙèO³×àM©‚ [4gbýMQvFvórp–7tŒÆ¶Í|Vï®Z‘Fõn$Pþ 5³”ßÁÕQBTYiwT"[Ç—Ú<~vBg%¨å»æ±ûø j üUmOê«% è]G¥á2ZðŒ ÔEXK_ ˆµh~Rà±]$€@/.Z´QÝ€\:"˜¸ù/ŸéË*˶ö¨èT¥E­^{¬×ä‘ûCs†-_3Ñ)>lûžñp©³÷ìþƒ@Æ]سt_\í§µûä>yMž‘G1ëÞËð[9LJùlåj•÷âMþ¯ü?{çU•ÿñsçÁ0CòQ$HI 2_™€ùÚHpµÝÕ L6×T|þ E×”WØ|¬’Æb Fë+USÉ | Â"‰H¬5‹EÀ#q*µJÁªJµêaÍhаJIøœÜ£~‘@H <½ºõœ\Åÿ¨`òõh`*ˆ_’ªŒIÄÛoü Ëk‡Ö€ö Ý2ézVü ð‹·i¿‰‹bÖ­¶¼{éÀW9*ÑÀ—Ü©èôZ茱°‰¬tj¡ R h¨²<ïÞœQ~®„Ô_ùIÎæØ"ØsÎÆøOãý\¡¡á‚ª¢¯‡Î„å¢Äî3ÖÍíS›AE°ý¤U Ÿ¯ Nêsâ3 ÂX[UU“—žz†ø¾æmÆç ÒS í'q!wÏíÚ£=}˜)?›V('¤ò»DÁöÓWÅÅ/ ´ÐŸ±awmÖ÷lZc¼wV~ŸÜÍIO)›à-&UéñÑß(‡ûºÛ²ãÙÅ÷õÝŽ@}™cðŠÈ‘V„g•8†.‚‰rý•ªJcþAš¯ì¸xýïú7¯kì^4wU•›"Ønââ [¶ÿnˆa|½¹Ú£( ˆF¹ ¡‘`X5‚ðš yP€P1@H $€z–@·t01ÑÆxPÙsΖ𠠉/X\ûÆ}¯|w:;ÿP¸zí!f®/¹Ü:óÅ—_m€S¥erbæô,]gÔÉí%K]z1½ÔhãBWt<ÄÕNˆâömP¦./t$ÄzˆkëJEîC@[ô2ØÅÙäg*+í^kÇ'–C†ÑÈhE%´çRF¯údåŒé~¥‡bïu+æMóñ‚¢¥wä;Ógþî(ÓšYцe‡ö~šv¯—ƒö7èÒ6ô=÷®7Þ;dnb3oÓÊ©~éÀV~ËC‚^ŸE£æ»x‡“koªiþ8ÎÙ}8LLq߈ÿêâ ·›8×ÛÕÙë@¨ Y" 6v/è­I,éËOìI:œÛk`s¼»ñú#üT«4 »• …AþªA«áÉ9¿†ÂÌ‹x„ìÑ5@H §”@·t°…uÀvîx¶Q•ÒÛÞ fjßÏÞÁÅwÎ;¡³Ç:¨î[ôኔ 7þyp!h V º  0bB1Õ¢u´´U«*îi?±ƒø{ÀUa4W€z©5þÐne×¼,œ[‚¾UÀOò„ˆ¸„Úæ•k%CWÅ­ðöªÈ;¾k}èÎseÔM“éw§=Ùä¹Þa¯4ˆe+¸‰›RñÌr]7ymUhgYNÚB¡íÙ™p“åjêëvý{¡ß…Äuæ¦5áãÜM/e%Å~œ]iü^è7驲šÇÓð>#à3bòÀ/â6Ñ€í{MôGßS]¢$€@Hàé&Ð-l76`ä)ä%~´+½äNuUeÉåSÉ_œ¢y¹`JNBÕy¨þ\'tîåì`+€_ºïWÂÏñ>ÎRyñ](ÖAtVdÞ J·‹ er£òKÿ¤ÙÐ\ Œ¼{óŽÏþ¼ëlójࡵIì]-!ÌùuÊÅÊûEY™å w]]¥­ëµ{FUyùÌevlЇ¼E£Åeå²v«7_ì wî;U´ÚoÍíÚ+é³0êß¶³¦œ‘r&ÿûÏ×GÔ93r/ô»©*8}UáHsTä?Ý×)mý:ªÌÐ :Ý@Ž{ÈiÄ| ˆ`ú‚`¼†Ð@H $г´ÁÑ®úä;¾¿eý‰gœMŠ=›¤õâùÖ(mË  Å¡3W½¥ÜtàDüšôÐU“G §çX“+æé$©)>þMþŒ7=§8¸t)%fYed| €F›\4!-€ Fçia±©²¾MòuÏÍÈ3F¦´™æKÏݺywbdœƒÕ-þñEßPæÖJ Ÿ:£Y`´™ÈL G×#ÛP| !é@wÝÞûí ƒ¹Ró[swÚs:W„ï*é<ƒÒ£m-tY&Pr‰Z7Mï V5p©»ºúç“÷ÏlI<êKŽc¼-˲´(Zß‹¡ý¹>8ïu%ÿÙ•¯íÑnÄ\—n¯×4ú †ð*wÕÄÄDÀòùÂð ²XHÔáûÝ`$€@H <$¦´²þ!«¶S öÑ+XÂ7•˜›QqfÌTŠ:xì‰/2q~ΗË (-VV«€†ÜizR¯Ž1GÜ9UmÑ÷×Ú Š?‹Ú| [’°ÒQç¹­VÔ9Œ ;}° 9LB ‘´5˶º†óÝï½çÆýs¹J m5ÚV÷Bϳ ¦·²;”ô¼=D1ÿû¬©±QÏöímÂj¹’wü&Û·—ØÚ\lÙ‹H͉XB”õ${Íœ€€Hž1cÆCxÅ*H $€ÀSGàìÙ³&&&"‘H,Ã; …B@ÀçóÎT°e-gÉÉÉÝ‹7âI,Dt±‡ö Ô­aP“ÚÞRó¦a4lÏ\c«óö&$7V’L îHC݇uÞè¶õ'l˜×4ÔÖWÛ?ÓýÞ;í˜Mÿhu/ô<ƒn¥›õ.?ª¢†a £!<$3Á@Ï'¸Áo¶[ù;jÌè $€x¢ tYÕý³9MŸT#oP±*‰•­¤ƒHð/‘Ý*ª`Åìéî¸í›@×-Ç„¯ú£§¼¢ð«¿Ggç%oøgÿÍó^ty}ý‚ú8wR«î——ó-úš³µrbniÑáŇ­O¶œµnæàöÛÖUymµ‚Fm?0„{*ÓƒMLžÈ†}o©µÈᬺT5|ÑŠðA , d ¨­ìº12dÒõ¬øÚÍs5wf>ïý IUÖÜ-¬VÀîºdÀøð¨-;—Ìñ®)8þïï©"få÷ÉÝœ”ß¾àgIä{3d„Í9° D°çœñŸÆû¹‚–4½/+HŽŽO.·ó[½~²ãÝc K¿È¯¦×™Ùñ^P»N›9Z$¿ø×¨øK¦~‘›Ö_ÚµDŸ¶¯ô”² ÞbR•ýr¸¯» );ž]|ÚJ,á­J4yñªeÁ  ¯§ì+ÒO n=~ÑÀ—Ü©ÔôZ茱0˜éæG­ 5-NÙw.7V<.$jC\ü[cl®g%æÜ[ÀVÕË/}ø-Cª/NϺrŸTžþˆ`+ïÈøÏ×-ž ®, Û"¬&ðEÅJûˆŽY,¤ÁòÖ>7¿xÊŒ‚^ó¢ãæy[eìŒÊÙÞ}cè~r<‚Á<¢T’€OL4”"ùWb²’‚ìÜÜÜüí}{£b‹âBÀfÇ.2Z­èpììÙ!³#â—Qx $€èžÐÁF¹Á6Á‹ƒœ<ÙÃeYu×~(…Ò•ïNgçÿ W¯Ý1Ò®ù—'¡;¤éÔDŽÏ ÏÞ÷ïï áèö­þ‚¾$oEožæ÷æXè‹J:ÅíÛðŒžËË#A‹Zq¥#«¸šï“g:öuž<ãu(ÿp…©Éìžu²…óðÁý­e4ÚZöß3Yç~¢5¾£.iγͼM+§úM¤)ºV~ËC‚^Ÿ@¯7™Õô÷ü^´sëF»mhÐÀËÈøÍœž¥õœÜ^r°4ÓŽ°äò·gÏ^¦þ.\…ïFMÔßÓIpóë}I97é°ªïë+^2S;$H W—A`Ún´ƒˆX>7pèËòž[û4Þ\~ó"ýRøßSÇ/—ùRú ›¦aÀ@r0¨a>ŸÀ(¨aˆ ?NËO˜Í´¶€=p;n¤-ååå”ÖÖ­igýýŒD°¤£7ó‘ß9›””˜´5ƒþ@†@H ÇÝãàÙ8ÐÁ„¾€¯âÁ 1y¼:Øøp‹k9Žæôªµñ*g…DÊs ®4h¯Ói¢!$€@Ÿ€ìV÷ D?ôÙÊ•™óPRVúsÐùwr¿ü§ª•kP~åÂÅçJÎ¥¤dÁ ßÙ¯‚RhÒÁ÷ï”@èwœÏØgn} ¡`Kem=š }ÁåXYáîÍ;^´¹túd48€7«C)=õïcÞ]ôí·pfг½á½ÉøfTÏÝ¿u£¼ÖÁÎÞòjêeBËÁC“Š’;°¡ƒÎ Wˆ9ÃAk] 'ï~uìÏ—¹'A_Їƒ’åÔ3mjtü"ó^0ªÛE…2û¡¶.Ã¡Ü «³qñµÜû±”fœSÕu?•‚óÑc_|çPxVÊtñ`}%ç%NÃÉ¡’ÝI^.;9Í:ÌRé^•“u,ÿûݹP¤_Œø”¸k.±bEÊïÊåÄöåáv÷+n*èïî’†œƒވW. IDAT°VŠàCT0OÈMŸG¸Äaäc6Ÿ#7Ó¼­èÚmœ á¯Ñ2,UÖÍaÀm…É¡Þ7¹nzÄæH $€@ô\œÍB?ژɠw4t檷¼]®Ÿˆ_³(dMÔš/óAž¶²âôÄÍ1{AÛ{½µ,~†›AØÍÞkŠ˜ÈSÖ‡ýý;…£˜Ôd}V@“Œôå<-,`„C}qÖ÷2Oš¿ËÅ¥-_˜è]Ÿ—´&,toV©g@ä¬4»¡ÉDý_šì$ Ñ‹’eæ/.]9¾—ön[¶(l˶}ÕTt7õ% ÆÂ¤©­PO~¿4z[r=q™³$ÄtS+£ãwðœé —Rb–}yYê´dÎ$R¾%2dÙ‡K·§|ßBèC§\ Úbø/Rnˇa9Ê>°Åé½Çágz¸*je }/|¦Xž{"÷9š?­‹™Û{A~3ÉNÙ}Ãqæ8š—f̧ñæÖ3þ/jœÉعfÙ¢˜ 1—«›¾"h]uå]Cƒ ?‚¦C˜ðù°p–à–Nƒgæ~ 3·µ’šJ›ŒÞý¢ƒÑ³f/?Ø”ÑP–â«K£ð9˜¯M×16Þ†’=ËF(d˜ÙÑ ÿ¹x»E¥²ìƒ:W³£ýªÕ¢"$€@]#À”V>ÖäD•¢6 ã‹ÌDÆâœ-æ ¯©P™›]ÿçÒ]g«ÖüsbQ)ä "‘@¡N®Ђ1SÕ}­Áq  ¡ø³¨Í×ɰ% +µ=Rl;PÈë`|"‘Vy±rè´Ù‘açuGV¿“NfnY;]U[Ç77328ãã§½4‰!ŒA¢ƒa'G*y‚oFIÐB[•Ù’ ç~¶q¶ï%øñÛÄÄÔKƒ7†Oá «|ÔÉ©!ÀV>I›ÍARËë@¦‹$fq'mì3ÿû¬©±k—:;XŠÔ„©gIæj;K3ksa¯^ÄübbFÔ‘S+æÀ63fÌ0æ¦'ÏA~°ûü$B‚ò”ûÜ %x~B€ûü4â³ãnF|¯h(:(v äúvw'yy\é³Âú·MICîl±xñß–“æ Éæ±ý–jk Ö?§6ÕSJd¹ æ^óµ®||Hf&TÝxW³„û*eÐ@H £Ξ=kbb2N,Ã; …B@6mÐJ¥R±œ%''þGÞ¨Ë= j¯œW#ÝÜ:¾ –÷¢œfŽ ‚OÛ$`ÛŽØê¼½ t4Î$“Cƒu"Ž©#UW—vMeNwÍõ­¯ƒ¤i[Ëñ?èl½^:¡vx|‰ŽdSAoØMEÅõ¯âS!Cƒ3X cÖ«œ†C¾™´À&W…º6›·¥ë¢Ë°“2¬»Êi4<«fYø#B. ¬Bb±bxý–j3ÊBçõÕõ®Ë7…8Ò»ÉÔ¸V“øžV/¼Zÿ±«iY´o¿Õ™dãγoä«­Öô^–±S+‚}Ö¦¥­š&®Ì]=Ó+&³é:¹qæwàžR˜ó†³€°²² Ep3 ,!$€èizò«§]wßßà7þ¾Îv¦õîmÝ© £Èiz|ü¤yƒŠUI¬l%jÜõq›Mþ¿¯Bð¸ëz¼¥ÙĵŸ…Ý=*•ÀÌÆ²³´u³y'¦›'ÏÊQÅË2<%쨬¡OYB²„’…'ÿ:᪫f&nmTªîóÖ†8ê4pc²ë—Ë.ž®|Ps·š^Ê;©†ø¶°·¾Ïášù¬üó4ꦷçœ9A1™IÜIúf=Љ+çºLZ»cAÀë“Ýì[øhª‹$€@H üªu0Än-{ëÒW;=W‘™¥¨³²¯Ó´hI-Îü%æÖÝ‘æÝlþ4•þ å4Œ’U©á±’(!‹†ž{H7=[Í=%ïÈxk¢JúµÁЕØB+] Ù:aÔÖæ¾95Ü|HK²«ùiÚ3fÿÎ) uüÝÂÁó!"sõ|x‘ iqK¦¡6$‰GH $€zŒ@Ï='×cCBGO#žš° w5ŒBÅc¡¬&4D¥¦/Äê_&ìþìsö½íííí{7ÊW½»S¿X{ä¾öjEÅÍ&;2»•x6>ÁhÞ´1¶ü~Ó³vœcHÂÅÛy'·Ei½&-õß—kXG¯s,"$€@Ý$€:¸›±yÏ`Ô ,Á²V)XµB©†E!/R„UJ¢h\º¬g:{X/²¦%ÓŒ·>;Ƈ»’—™{‹€Zæ¬ÄÈ‚À¦n/kÕmÚÚ8ºåaÁÑØQKub­sYYI™Œµwó ûh_Å‘ÈÆ@H $ðH ~$XÑig ˆF¹  &ðÔO¡¡iÁÿ"Ö‘üîýþ¶ÝÜÀ2gyÙzøÌžàÁˆmmÿ¡];M?–ûüíu$mésFøüÔ¥M3Òör#iZ?s¡o@ÈòèåïÅÆh¯Ú[ÀSzhH $€À#!€:ø‘`E§%+EÀÓŒJ Õ €ÕðäÈ_ЈP€U#~ 3ÙåÒ¸GœÔíOµ…'ú»Ãټ̴¤¤4HïõYø,—D!ìÃÕ•Šh|Xà8íæ©´gþÓNî抺^,\_ƒÃ̴ĘÕ1i™„¸ûï>û X $€x4÷úÁfèõ & ]?8*Ôɺ¯²ë”LZ!kg!±µ”X™3 òÌ3¤¡ž\~|ëw¦¬¦6òLÅR)·£x>d•2™’ˆí{·J!¦-X™LÖ@™ZZJd$·áO#$€@@à×¾~0Þ$$`œC7Àƒ`0l#Çg4b¾FÄú‚Hª†~å&µìÝz= #c6•ö6m§¢@*µ”¶s݈G<…@H t‘æEt6ëa†ð¶Q&ÄÄDÀòa/e†OÅB*ŽÑ@H $гP_ô,OôÖU ÝOŽÇ@0˜gB4BBÓ…|b" ;·HFCH $€@Ïè‰DEõµ¼+wjå¡Dji;`Ð`Ëöö-îìø—O¦×É<:íUQ]Zö³™}?KQOL³³Çú! aÃhOÀ#BPÃ< |>/j †Yü¾Ö˜X $€x݈U?$oˆ?T¯×•gxÂ;nz'ºYd ReÔûùt^˯§ÄlËž0§'ÇÓÍé`sã4°§2ŸáÃîq þB0^1,€x0CLPdžg‘@H ®èž®½¸•Š`ÉäÐuÓ^€ YYåíºÞÍØlÒê-#‰Yž9N[:ÊÚÑø^ÇòÚj1µ4‡«¬¬æ>YH%¢ª«©#ÜÉ®3Å–]  a '‚ð ¬f„¾O02ƒÁ0˜Ñ¦Ø $€h—@·tpé…¯`¿;ïpNC?ioG­`-=—´cg:\;ù-Œr’c›bO’Àé.ßìL®!ßu3F€t®ËIÞ¾ëD4äú^Ð8 ©ËŠ[ú 5¾ÏÍÔ÷Â⢮­]tŒømø$HJ—í>’ÅmR0lQüJçÆT‰’cÛbSnL_?†~ëNlþàŠëÒ÷‡Þür׉Q‹¢ìÌò[§ÿùIü¥»0 as–DŒìO¾Yz¬Þ{ݧóÍo]•DF„ƇŒ+9²&6uȆOçÕýphï®ä.Ðí·lçTãbº]¶x±`£ 5TWC~é&|><ǃå# <, ênývbX $€xztë÷fEí= å1Ê¥/YArÌÎt󉋣քš§Çì;Xù}r7'eç·/øYyÆ^Ø]–\;´D°oèÆÈI׳â\¨€šµUU5yé©gˆïkÞf|"„…VÅ„ÊÑÛS²\§‡­ˆš7g¼¾2upw#¤êØáÓ Ø‰÷ΙÔ¹‡Ç@Vu¯¼¾´VÁùÅ¿FÅ_2õ‹Ü´~œøÒÞ¨}UÄlèdvÖõZrçây:þ —kˆââ±R»×ÆJIÅ×ñ ‚‡-ˆIXµxñ Ta”Ð#5!_BX ;É©5J•憨è ú˜e ÛÑÆntlè $€øMè–fP&ÊzV‹F^x(ôÝ7ÖU\͇3%—¿={ö2½tá*·Ál!’·¢7Oó{s,‚©´­»öC)\¿òÝéìüÿAáêµ;ðNwß"£W}²rÆt?‡Æˆ/Dy¯ýPHˆÃ{Ìì4Øë•qvÍ—¿ïH?'BŠ¿¼TËžL&VÓ_êß|Y^VP.Ëþ{&ëÜOÔùw·åÄaè((]úï÷¹Á--^.øî»z2êÅ„ˆz[Ñ3»óe–{7»¢ÑØIÖ‹Pƒ ̪YV¥b¡Àí$Z^hH $€èQÝŠtZ? !ÕҌçýÜü@*ò ÕÅr߼IJ߀>,¦¼3Thj/Ñ Úª7¤-Ú˜}?{sû9ÏO6µsÐ]°²kܹ֠fÛf£~7)=þø¿÷Ä“<¹gȫУ¼©6Œ̪¿ƒƒ£ƒ_è(¡ù pFHîÞÍ ­ç-óÿ÷†ø›ãA»Q-š›àxì‹ÃéÇSrRsCãBÆÑDU´GF6O&ž•ãÀ O ;*kÜ7 +YØfù‘uŒŽ‘@H §•@·âÁ6žÓ<\qRt¡’ÊêòJ.q—[—ápºAVgãâåá:à4ÆÌÌy(¾?× ‡{9;Ø Ú“;fŽƒl@vÿkϱòšêÒÂk5†rÚÒ}èÚò¼såÄk²§µ~w{gº‰m½Lh9Øcø`›gh ‘ðû¹¹súÜjÄ0÷!bÚBkj¬EÔŸììD ðL£Š¤²}{Iúô2ëeI¤fDò i¨#ùÍ Ðh43fÌx„£A×H $€ÀKàìÙ³&&&"‘H,Ã; …B@+QÁšT`*x‰³äääîŃ1‰$¢Ö!S¾è!'(àÖ­}·üìTeÃÆ €;1_Ú†Íñèr!†F‚aÕÂShhZ°©Š@BÅhH $€èYÝÊîÙ¡ ·§™€Z¥¸»¤0È_5(`5<9òLƒÂÌ‹xšÿ8pîH $€ NÄGÍÐ+ Ô<ž†Ç˜P)̈yDȃ]刈ÛDC$$š‡ÊdA’H $€èÔÁ€…U!†® Á`ØFŽÏhÄ| ˆ`ú‚„n - !$€@H g `^DÏòDo]% `¶T¦‚×ÄDÀòùÂð ²XHÅ1@H $€z–ꋞå‰ÞºJ€¡ûÉñóLˆR! ]XÀ'&¿Y€HFCH $€@Ï@ܳ<Ñ[ ÀJæ 9Ô0,  †!*Œ†@H ž%€ú¢gy¢·.ÐÀžÊ|š/ˆþB0^1,€x0CLðï´‹\±@H $Ð&Ôm¢Á “€†œƒ0])‚/äS̃Ì`0˜ñ8oö…@Hàé €:øé¸Ï¿úYÒÍ“ajÈ é&°ë ð`ùné4xf $€@=KupÏòDo]$ äk@«a'9µF©Ò<Ð=A@³,aa; 4$€@H ô('+Φ¸|2µˆ¸NžàÑõ}eY©‡‹îçñÓ¼¬IÈÚÎ\T•Ÿñí 2ò5_»®ûíÑÛòô9ƒ”a½ØUN£á©X5ËÂæßBKw’3-ü÷UNLL|úð㌑@H <ÁÁÁ£›‡î£{ñ`ÅåØwß }÷Íç*t=Vž^IϬ¼&è!t¢"[zèØühÒ¢ª"ë“E)'²Šo}¹(ú@>Ô¨¾òÅñQ›÷¶ õaódBàY9†€žvTÖ–K–P²°Íòc v…@H <z&œ{äÛ·FO—R”}¬†‚kè$=EMeyíýbfãÐך>eÜÌ&­Þ2’˜I᪪®¦¶AbiMjJJ«Y['giÛÍôÕ×b5}ÕÚ™ù-w1aáWB1}ׯgXVÕV”VÔ‘ÔÊÚV*i§¢a3qqÔšPÓâô˜}ç (YpŽŠà€e;ã?MÚð&t†Öó5‹E°,„…U V­PªUh^¤«”DÏÉõ#æ!ÝUŽˆ¸M4àG\Ï®ûˆÑ@H $`H »:˜êÈÜíí$GˆÅð |nˇa9Ê>”{zïqwAw’"àe« ï.©ÏÛ½jÉ0H5N9vYâ:cAÀhñÝœôcU“!“Xß´î¹3\V”t§ÚkÕÚú&„{kò u Z2g)Hß²ìÃ¥ÛS¾‡@då»·G…„…­€'ò<ߚ팚LfO•š3C7ãÁr1_"˜¾ ¼¯¡…_•Žõ÷Èø±Å¿ª1 ¦¡ätlt\v™Á÷Fƒ% Ë—GG/_±ç4MTê ceœ5uÏ64p'ž€=} $€À¯ŽSZYÿ襒×)øfá "‰ˆ¦15…¼ŽHÌ@ôÈkëøff"~õÅs×{ t6ÈÎÿs}z<`Í?'öïPv­U«©rˆúò›¬R(*–/‚µªŒ'ºG ÿû¬©±Q Ÿµ³)Õ¤NIŽ”hì{‰{››ö’ÒEòÌ̉RNrþoN@@¤M̘1£{ö@ëüþîïÞšs7ÜòÍŸ“寙{…o<wÉÈ\°?âùÝó2óñÙ˜“±Ä³ûÓ“å'˜»Ï?ÛrjÃ<鲇¹q^áiÄ}ÛÝ‹a ¨ûÝ£$€xjœ={ÖÄÄD$‰ÅbxƒC¡P(ø|>Ù ¶êâ,99¹MaÚ#Äø3ȯk*´åV$Ñ­n&1ç Šªc;·•4ÖôÚbߎE0¤w©Uc/ÍŸ €A¼ë_$’ÐÐ$Ú##ÀÐýäx Ãgx&„š.,àÍœë?Ü iŠû“dBú×kÚøJ;#w}ûcÍÛ¤!?Aì>ß\ï·—vštæ’.",Q5LœÚþfܧX $€@×ý§¬æg«â›YY>äÖ]kÕõQbË#;É èfr<$3Á@Ï'¸j˜ínþNóqYD*¥ÿ®B:1•ÊSÈ1 £255ò/3Û «‡¦¦bN·[õÒö x2@ß`8,12®L³^IÄRcÓlr•XAëé4]Ç@H }¿f}!’ZZÛô¶}X¬›V×Zé3Áò/@@{*óáLð¿!p«ìЂC“_îï´2ÿpD€¯ö—ÆÃ#ú`A+:lþá„Æ:Ë3JšÒ^Ùüƒ±¾ºÖËëRä ‘eD4^ð]^ÐÔBÏ{CÉÑ_0¡¹¹Ð7bÏžhF,63 ¹•ºZ5¹±³=„b1}1û³ ÒyóF3B±94ˆNͽ¥çŠ0æ8_íe±0`ùþ‡ÈÖ9(ËÞ?ÛƒˆPÈxÄn İ«‡9’$,ŸM‡C'Âø„ìoš#ˆÿ²ìhnš0è2z¶-Ùáè€Ù³#b÷LX8±EM™ÈÓ;ÖAH §•@÷Â9O+5œwÐ0O_âKjòŽï;CèRâ ƒ¿\©ÁAiW·Lsdl›ž”3õ_ïÔ¿íLGÛ”¶ï¼-êÏ“z)ËR¾yˆDhÎ=¾!$€ÀÓMà—û½ùéæŽ³oA@È×€VÃNrjR¥y !*z‚€>†uùØÖAØíÁ![ò 1º¯ýP+‚ÛìB` "¸¡¦(?yŒ• IDAT?77»ˆ“tZfç<ÅL˜½çpQeóù‚>ƒýáBb`Àò¸ÓùÉ F:Qêæï3e8ý:@uŸ âÇeÿ»ƒ ›KE0˜¥ç¶ù’vò ô#«¾§.|…FT!ÃÚù­A\‰¾•å]¤N6Õ¹ÙÙÙ¹¹ùuÒþpââ¥Ûô|F·¾Y¹xÏáÓ%e²¥eÒ¹p¹Q´f.÷¯ã?XŒ^6Í™6l¸ò¯$­ÙÏ×ÿ³?õä÷µ‡¤ê~‹¿‰ÈÝ aãÜ\Ý<}W%|Ä-J¡«‰H $€Ú"€:¸-2xþ±€”a½5¨`PÀ¬šeaQ(p;Ɇ×c·újN¡:õïèvÙÑØFlåâîîå5•z­÷¸…'·’¹z®¿‹­8bO¶.mÕÔíçwSÕþŠ{?fv\Q³HnlÜü©$'_wƒå„`œŸ b––k49]ÄB¦}(”ôh°«SS]©hÊL&å×sh“­³ÜŸ÷5j”——û+³bàDq5Ýÿ¼}“z¾•²6ˆd&Îõåùý ÷xùþÜŽsq•T=XSΚºGîJÔW‡ÏòŸàb+œwZë¶q~i³ügÎ]­ÓÅ©gàk€žù;Zéa $€ÀÃ@ü0”°Î#'›'ÏÊÁ’„exJØQY{²Ð0ÄCôêã6¡Í ÅíiTB ö/˜º4Ñ'ò³Â»õMíném2©oXBýÝ´m áÔÖ¹£væëôhï‘ÊPÞÍ;ÉUO /.»©±‚@dÝâ´xÀ ÒµuÍ˳Z±I£«JùO„T—4>NÂØ¼QOb=pTY{ò¶FY_[O­¶–~|Ç­¹ÁÖæ ½ßXµOY÷va^ÚŽHç1³ç4kìæz†¥&Ù«Uæìµs:9ˉ]ÁÈeEáÉ´”‘Áà,)ü¯yàVIt¾Ý#Ož:y„³“œmöΠ‹Zƒ#<@H $ð0P? %¬óÈ h44¬Ò¨!(¬dUj¦éJ‰_dý`Sç¨zÍ[ºãhI;óWrJ-à­?8Ó †Šb¨+j뇔wZ:O û8g#ÈV¢QO» °tóýSjÅP~™GÿÛ±˜äZ6¾ ìû÷ƒv‰iùÚ3lÉéíižú(^±… LƒGTçAMYÅÏĪ¿½væÎ÷ÂÖÜ*©mŠ Ľíí%tíY0EÕrVÐË®·…öø×ú®¸vêßÿS>ë;ÁC¤¨.-ûÙ̾ŸeöUUd¥#ÏMöv³ýµÎÔ`\ùßgMµXÿçR[,›&{@ÿOåÐËÌÚBÜË‚X˜Ss¢¬#Wcæh4š3f´ ¬¬6:ƒýÓ`g6ãßÙšÊ"jOU–5¤½-µ^]c±Ô²EÛYM=õ*µì–„k¨,» _ÄRÛÖ~`$2¥PjÕ»ÅtZflCMÅÝz¡†ÖrlíB…ííd°OR(¶ímiœGíj*ï¦p ‹mí[N6““Õ7Ô·åWÐkbÓ¶ïB½âi$€xjœ={ÖÄÄD$Á¾Jð‡B¡P ÀЬÚ}­Tð(>gÉÉÉú¯XKŠÑï¾YÞò±œ¸jÝÌ¡­NwpâÆ¡EÛÏ’à¸Ï=º(„±+2 $½_øê© åkVAôÊ{çó;õÓs#îùËìµ”äcÄïå ªë)1Û²F†'Ìqë¼vW”ø÷× o·'EkAªUøÚ¢€´`HPÃqjxr2%@4 Eø—É‹h¼ÇTà6–ÂÒiÚ%ÊèeioX;¸ÉÚll ʸ©V× ¦ð•¯­Ö†#iY‹¦ùÚw0±–mè±@ Ò]Ú…†*Ý»Í!YÙ^m¹Âm656H<‡@H cÝÒÁ ÿ~¼­/:´÷P q ²õ¦vw 5×bC×”XMß;~Aí?5*xq2ø-µ¥Ù¢Š:m;¾üg•ÈB*1¼þZo3/fã03öæ¹q²Ò·­µÝô7/K—%‹#D}9i¢¨©,¯½ß@ÌlúZëâÅ-ûÑïNu¿´¸\ALmû;JÛm^Û;-„)4ÀNjDä8mAè(kG³öjë]SZ´>ÙrbÔº™ƒ‰äùˆ5É3vz× ‹ªºšÚ‰¥5©))­fmœ¥íƒ0lýˆŽÔ<ž†Ç˜À jFÌ#Bì*GDÜ& éiÔhè $€x‚HÉÎŽ{ðˆÑ´‰Jzt°½×è/ê䊼è‹ígT"ñ}gÍŒÑY¨¸xhGÊ×çjh—EñëÈ¿÷ÑGoîZôîEñ+WŽî;JÞ_7Øœ_—·ô2nʳåRÏñ°yË?ôê+º–¾..õmÍ™Ø;rsGãQÓ§é3ff" £ó5 ‚é ÂZ@CH $€@Ïè‰õ"¸5 Hóo×÷oX‘QÐk^tܻ﴾'Vu¯¼¾´VÁùåm«6gË'‡¬Z>Þ‚Ú­{12Þ f"v6s´ˆOà×ví#\×­IL=g;1|Õšðþe9»¢Ö\®]I¼*Ï»7gE”Ÿ+ѯü_ ZÝ ¨óXMÀl©L¯‰‰€'äó„ád±Šc4$€@H ô,G /ä7/‚Ò#…ÿ=uür9¬_*¿QzŸ˜YÑßéËíý4í^/‘Ø?Gã²tîÚ ÕF§¹çãG¯Š ŸúÆ4h?‹Ë«Ë ¢i7ÚÇAD,ŸBÃËaà7vÎøÜS÷¦~ü7Ü;¿2ôÝct„÷´²JâÁëBf¼>ʰ€ñîä5´‘ýØa½|K77š“ùÓ}ƒq˜¹¾ärëÌ_~u¦MJË#ÏddHü›“'Ïzûu8]ü£. ,³xIßÔ?Ά颒¦ÊpÔdò²K5·›ø—i#†:»I{5ҋݳ.ÐÄÂyøàþºd:RwíN;øŒ¶ë?: ê””Ü×:ºj¤Óà!®´¡þiuƒ´Õß;C÷“ã1 æ™ ¤BÀýðá–ÑáHFCH $€@Ïx:˜“U„ØØp|ö¥™sÞ í`F$CWÅ­ðöªÈ;¾k}èNˆ‰ª´Û_µñ”•]{ ¢ú’÷=$w+*@ÓRk3åÄYÝùÃéPâ¡—¬¬*Ú“q£÷¼çxÛÀUªÿ8³°íŸ X©KߌwgXG¯¾êαE®HùáÁ°q㟷‚ 4ÓWk½,Ÿ7úÆS [uë 4Ÿy˜’Ñ^TŠ6G>›¦©ï_(¦§Y%'˜¡Ôúé×~ôeØIN@ÃÁ<$ƒæ1Pàó üÂ=…¨0@H $€z–@Ïé H@ÐMb7„ª@¹œØz wï×ÛV€UU^>s™ôáoÑ_ðËÊeDËaANëÅwªõS´>tïBRâ4 ‚¦å'þº3yWtd<Ć۰Âÿfù‡Ó{×Z IºÓ}]õòw?CR€ø9×~¦•¹ÙnÛp¯N'M[ÈHãÝiçUvìX~YMaÖ·Ñ_æMqŸncë9ÞÇY*/¾ ź¦ïwÿ>Q^[vîøI8;hĸ©•Ÿ;z¹²úÚ7t³2±««Þ Úëô]bí ÏΕŸØ}¢ ¬¦²¤¨¸Úh/|3úDÝý[7Êkõ73sr¿ôxÖeymѹï ÁŸƒ]Ó³w²ÜÈ jÅã(i`Oe>M‹€DáÎà ~@<˜!&=÷wú8&ƒ} $€@O£±Â. ܤQµZÏø¿(åÇ3v®Éàû“[ÛÍèÜÌ©c® X·¦ öŒÓôS'Ç Ö[¦óNØKgÒÜ·å…½M++2;¯Ô–“æ1ë×K¬‰þ ,#$€€–ƃñ/áWA€Q3D­aY «¬Z¡Tî& !EX¥$Šßt(ëö™o—OÚáá?ôÛ¶|óuÚ˜½{xÝîäæå+ÿs[Œl(ÝþÆöE Òö®£¡å?Œø¢¨U²(#Á—áÌ7"£D©¨(ý66€ž÷˜§mÅþ”øy¶6ÚPr:ÂÃà*üYeì àNÂ…=ù²ü=áI$iÖó ’+Av4D×Ól8le°>xÅñýË©SföÁwfËN/oô‘c/Øâ²¿±µlÏlˆƒEP³àp¬¶çˆ„ìi -†Áõk^zöàl®§ˆ=¹ÚúFg¤dCÁþ‘ÏÏ'$Óf²'N…¦­Üâ-ËŽÖMÁ7ŽËšÈßâ»ü(×iÃáå¾¹{ÂžŽ ç åÿÝ}ð'îrÁþ߈=G ™€ÿ¦É.‹í‘߈CÛuÁž¹€=/<ȃ3ÿ¿Ä¿ô“îRÛ”ôÜz,ßžZMèrí`­ïÚÏ{Üý÷t/`­õïH 'êà'ïžý&G, äB0„F‚aÕÂShhZ0äE@BÅ¿YcËwÎáSŸ>]i=À:3æ³B˜^Ô˜´Ì­i7ಅ‰KÓ<½²õŇ³ÎÝãn“RV•¹uîTC&5Ùt²¾Ÿº}3ÇîÂÒ¤Ìâ¦ýw´ýöó &Ä}aÄnÎæôI;ø?Z¥}J²ÜpûFÊù›…‰âŒÕyº%ÅÜ5Àj‚Ýú $ð@üÞô_ã”a¥x˜P R䯰žœù `(´±ûö¯q"Sƒìm£´âüÚ_fî?7ÉŽîd€‹ ¿øÌ ›0ÚžsׯCÈN ÝhEz.bËž÷þU4×Ýàw6{_8qßó§qöö®Ú–ãCÒ¾¹BE¤¢˜,L»™2mÜ”?mÛáO¶£‡5ŠWٕ㉄Ìyõy¡ÐÚ}Šɸ.#ìipEÖ&}ô'7GgOß)n½RGø}ýå1#=Ý,äÈͼë?Öšôgo0 è ./¼ªüxÊHßÀ9þä|›º¾ñQØ4—>VÃ|¦ƒ¢“º½IÈŽ¯®B9/m+ñÙíãHh×îk½ú‹%vn¯²óL1WW÷ÖbÚ³»sî†M÷»i/kÍHχ©ý˜Q®„øûxsu”¶M¯®È¹u?¿/ÌÍÞÞóÈÏüÉê¿~-}aª;I:_Â6\ÉL¢“ÎÞdÙ«Ç“ÈÂ)nuB—…iÌ©hÍ„=ý9½ekßgïèö¸e°ë¥IGŒö!ÖN^žœy Õf8p7¨MJì…ƒóÁí‡oŒtt¹êsêVû›Jë»fê2íãÕÓèÎïhH §êà§ïžÿ*g¬æñ4<Æ„ÏøŒ˜G„<ØUŽˆ`ex“߯sÚY´ÈñxÆñ÷AúÊ“g~þþ°ø·ß=~›%u7n•ÒÛtë+»Þýå¹2(ë5=øÅÜ$¦bÃ]Sd% yí9(UÒßÂfS ¹}t1?¡´!«ôÒÍçz ´µí7ui&q‡µ¯ewÀ•¿­aö°’ælè’TL¿ýdp^Ì+.VL@t¼–VK|\ûq9ÉJh;:R¶2{¹/#‹½§-ÍÓýRoÿÖÿ´ùG*Ù’}ᙑK&Iµ]ç­vï×϶Ÿ{ „B[Þ}ýah{õwB÷v¬o‚ddFãSÒšµÜ{›Ð h´¹Èº Ï©þ¤¸–µöŽ;9™wá›þ»O¥“#çórŽì$‘¿wlé¢5ŽókÏ5rnüjbЛoã@㹆mRª¿qž7ÿš½uxך«b $ð4àþ3õ4Lçø+'ÀÐè$ƒù<Âg4b¾D0}A TC ¿ëëjKHÕùÓwæŒ|Ž&|èÌdÌÊ÷^Zx¿ärñáUßœ;‘w2oÌœAö„”»È ¯Û¨©ª)—÷…—3ÑØ°õ§Øº!çéÂT ‹©¨òy¡¿¶žiÓ£d »Ô§£ò¢W• SÝOݽ¨¿yßçÀÕ}î÷|­ƒ–ï¦ö¾ åšÜÔ ¯À™»_»æÙ²Fu‹ IïŠé·»Bó§Þ¤À—Y ‘ÛëóÈ|ÿbж’ #D'è[¸1rXKU¢~m#32ÒŒ;Õ´–m´Š”rc/å¦ë©bé³À?|ÖbHâM¹=zÌ3Á‹‹IÞ¶œáÚzï-™h{¿!#¾pCd7r2 j·s mŸ’¾Úä4þ%Ô×5uÛñ]k§O¼„øÍÀxðoî–>¡0„Ç0|*xML|=ʽì%¤áËûmKü¢°V(’Ò°,Ÿª¨ea+a±ø¨ÀªõQ -A…*ü0yEHÉC’åæÞ‚“¿ôéÖõÕÄÐ8©‘çP?Ñûóg¿ ãh&h‚‘áC¯•~_8+qðÿ[íñ¼ÃÀ¶öß)5èT•æY>w¨Í3|4ÈÙòJ.F-‰DðݼyóºNU€JÙ(¿ÏâpÒ?=·ØUÊV¥Yd6‚­²_4Èʆ×!¸ý4*9dÊZóx×Y£Ñ° ÕZ%—)Ÿ¯‹S–¦Š»…M%a8µ\&GÏÆ0¾*y[›5´é½:ÌéŽiAOßIóéòS%—·Q#4r¹†Á×|F%£H ¢™$L5˜í¦uK™RŽÌA3t™U° ˆ ŠEo4* ‹¶±2g•g@C™ò cºaÕ%Jr™LÃâñMççAf­%H7A€ @xR8þüÀÙl6‡ÃO(phmm ?‚VVVÔ›´Z-ü,BÉÈÈèÅï—­XØá5ìÏÏ¡ C¢zÓ&­¢¹EÍâóÙµUR¶³+ßô‘SÚNŽÔ?%†n–ÚÏÝ‘ø–!ôdc…ä·*ë47wgêa¢NÆvlVŸÚú^v•KØ®í#Ùˆí:gEèø!®¶©:9–ænI̾"\ÿŪh›««jÕÈÆq¸+Ï e'|èæá³b‚Ç!÷žSC<„Š8M•ÿÉ>z){û¥ÿ Nz¾¹uÅÕ³\“h[e-*.’I«5Žî¼.ÁÂÑå:™ÆŠçâîÜ ½º4“ÙÙïT¶`¥…x0Žþ‚.ðë œ78ØÇûLI¯;þ> áÿ¼½¦[– æú° ņǧ¬âd‘ïž$)Äœ`èIïS£¨!6&n1s}¯¹ }Oçÿ º±ºsŸY6|Z]K̘jXê§Û,YÔ uol1ØÐ ¯Þ4k¤Ù·‚€@÷ªt1¤S’ô A]¢daBé칟Ý[-A€ @xêè›L™k鯻ºähJæ± 2Là¹z×6RÜ:ûÅ'»®4Áã;£¯[å7ܶâß“O5¸ºs¥U Ó°¥úÒÞÎWãÑö£ßùào¿w¬®Êݸõ«7Ö2ÝÓVzb[b.Z½}-úú …6]ý—«wm¢ž”¹w2uÍ ËŸ¸fË’W‘¢ò_»?Î/‡Ñ\áÒÍó&¸"õOŸ®I@Â@·º¯r/7pÜg¯YhW•]ƒª“Cßž½~Ï4«Ò¯öž¿:ÆÉŽ¥¾ó}ÆÞý—ª€rŬ›es &â~„ñ½f,[±ÄÕêjFö8Ìÿè½jQL¸PóqLVTøpë> èçŠÖ<Ýs0Öÿ4Z0×ó›=2Ð*d˼qÌtM$»vüàqôÁ–‘v ª:™;¬Î¾ƼÊF¯úMx%)lóuIú÷õ“‡•:’[ý‡"§º³ÌñTÜ8ºi{®“`t­kŽ83b>Y2^(p:åÓ#…JÄ!x¡þFí”ð øé¤Ä#0ŽoØÖµ#7jéæ¾|Ú6kYíà•êövͨڧ‚]„ • lß¿Ž}ÓÌÖ¾€Ö—±£ÞùÇ™7ÚøŸMôóè 2¶ï°\gß,+ú¹¦®õ~Pœ`œ·³á*£ï¼ ‚A€ @è~ˆ³YˆÖ—N°óܨä]«Cà€¤¢ä1»®ØÌŽÜ¶uçʘƒàT²>=Òæ×‚×ÄÌ0‰¼jl†M_Ÿºec0¿éÊ‘áæµ­J¤hÁè â.RÞUiÑs¯ŒÇ/nåø.^³è9 W^Y½1|ì3_»95ç|´1¿ü™%qÉK¦Úçï‰)Â>©¦A©¸r,í[4I(ª¬Ê-¼ÖÌu~e4ô îK£Æ;³5Ú{µÊêÈV\MŠÚ~©JñFHÔêðð)®‚þÛÂ'¸^tð˜4s¦Ðσ„Ÿ€å`ãê5v’p&Lq‚Ÿ€é *¿-úÁ¶¶µÇ95G|.¾÷ŒËP×”×â–Ï^ ^ úÝmü<£<4xÓr¯‘veoëõšç­sÿúêßçU[~b p_„¨ßó/W*“–b¸&ÐÃ}ì`µ¶RÜ,ÁÛŠÏœ¼Z ½ŠÕÍp …3.xKÈ[¢7§A»¬\7<Ä~䨗ù\£2Šš+rvšþ÷9ã^öðžàçí 9>/XŸÏ9øõw0àöð¬mÝ_ÀƒÝ½_sáëR)°æ îüúh–߆"t·ãÜwâ¶Ï™ý6~nŸcmá"ƒU…¾N k¨#Cƒ“Ó)ž“B£üÜGŽòòzw«ä2T„ï¾åñœÇŒy(êfŒ˜Ó˜×!Í5Ú êêûø æË(Z–U;x¼¿ÃûCÀFÂÿç·ý¿íàýþ¿Jר¾1c©‚A€ @è_ë¸PQAÙÕëjô2DcÕrkåB&"÷å¨ä­§¾úêDáɽ’“?.Ýñvh?ÜÅÅÕevèxk»çÙR$ 2eþŒöΉÕQûóÔÅs§ ê+ÅàÎêµ³faßîž üHÊÉÓj(/\ 52ÄacªÐu~Þ•÷œëÈב“‹ÎOìo€÷–Ý×2žž7´X¬ÔžÙw Èiâ[s¦<{»<ƒCkÚ°ß ‘WúõQ¦"íö8Nná"‚A£«š«jF3P‘´ðxçC=£2UWxr0>zå \q£âžM\4 ýé4SãF4E_?!¬¼o”ƒhðÁ nk»¯ÕÔ´iÚµ¬ÿÞG+³®¿\cR‚A€ @ ô}‹³AF)ª9ÿƒT^ÿÓ‰£… jð¶?å /ݲ÷>õ}l‹®XÆS×ÉСá>xãªü½Éy¹)ëw¤I¸Î^c™%õÍ•…×çxyõc#x·Žmm’Ÿê¶ÿ*î·+ÚÚ[ÛP‹J²_PK+º÷ ª»Ý ~Âóž:­É?‚A€ @ }F o~°•ë{›C]9 ¹»"ÖGn>[|­€Gâ4ªª#©›×þåíÄ#EÖ}wÚHd÷jÄÆ`WtåÀGaëW‡íH:Hù­†÷&vpŸ7šƒŠlÞœtÙÝ‹šN~SÚL7J ÷øaèì‰.ºV®˜>2VwG­-Çβ)C|4dÞÿ‹™äŽò÷l^¿:$þ£ø«Øóƒ .{ Žü£Ü+¶Ï´¹à1g'­Î¹ÖL÷á¸(ÿÕ¿¯ tBÕÙÛWoŠŒøô»Zgß™¤ÈÜöéwjW’Ñ.cgÂÖ¡W2ã×uÌtȼMQ~ΊI«7}´Of?aEìbð)-é‰[Åhˆ%U„ºjÑÞ훓wí»¢t.މ |•IaOš@ïWêÄq½æ­Mà4åžhxc:¾†ÁÅÎ'bMº’ÙÃüqëß3áOS=ð'd;¸Rœ,l:U&ÿñŽªð¦¢ñµL®µ(š›[›5 wÑÊkÏ<ó ¸Â,… $‚A€ оí¬c¦Q´4«µˆk7„­¿=ñ[µÚX\.8@“j ÈèÐØA%#%— 9 y‹škgK1Aj¶®n¥U·ª'›)ÈØK×ÔŠVµåÒ|:öµ 51ìÐõQš[A•hA‘aÓ´­ µÁLcŶ5LI7¥=¤šBV§µ³½þEÎE›¿˜>Áº™ái.¿±äÂõgÜ<ìXò‹_lÍ-W臥)æC´åzé…T(æÉ!ÇÛÉÁ^§v¬‘vÖÏr­aÓÚAlkx™œæŠx²ã/ãÇ¿yóæS¿ðƒEÆ‚A€ Ð5vÿ`.,ð€Íîö³ØŒ§ÍôJƒ/Hù‘úãÎÿ(Y<ã#t ÈÂpp=ͤwd pÇ&‹ÇàéZæeЇf ³²eЛÒ0ø÷T:cH_ª·N®O>E=ÉæþÖxìC1èÆÄÓLˆºáÄž$¼UFüqP7Ž t½ýõöµž(d•Üj¾Øð; ¨Û¢ßµÿ4 r„íïÿŽcý;Ûúò—X îî/AH¸¿„>‚A€ @ ,¸•”§‘ó?Ý"l„¸¶ƒÃc€¾'V±G®ûü ¹ìµFkekÏÜ7£'£ŒòƒŸwãþyV»¶ ùB#ìAm ñßö*¶m墸¿Qé¤Qînnnƒ z0dA€ @ sˆlŽÉÓßbÅæ;8?¨lŸÝÁu«øÁ7qð³ÃT£Î7ž»ÍºÕ8迪ß=;ø—‘ƒïMuR¿:ÒíùçŸçóùðjÄn¹‚A€ @ =D€øÁ=Š=DÀ†½ ^eëù¢Ý.mmmàÛÚº <<`.— ‡dÓ´‡8„5A€ @ ~{?ø·7çOžÅ°e¸¹l6ÛÖÖö †Cø¤ Ä€¡*ƒÜÞ®£Æ“gBO4JKKë ¡!‚À¯ààà'Ê4â?QÓñ›V†Ž ƒãKû¾´ >1´kµZ þM/b2ÕÖ—äe½Zÿp¦¤Ê‘á‚A€ @ 9}Û/B}514NjTz¨Ÿèýù³_å"Tž¶û<ò O]ì=ØØßO5ucQî×§žQŒü½—c?±d°Q×?vT5Õkªw/˜WŸþx÷‘+çÑŽ¨¬Q={(@ð„uciî©ÜI>—ØO˜jD‚A€ @ ¾ùÁ:…=„Š8M•ÿÉ>z){û¥ÿ Nz¾¹uÅÕ³8ÁÚVY‹ŠË‚dÒêF£»Ϫ+ãqt¹N¦±â¹¸;ƒÇv?ª¶¶îjŒå>µ¬¾¶¥Y…l‡º<7Ä SQ/½Ó¬a³yöÎŽ\+„ýD[Ë :iÕ*U¹,Û¼i¤i'”ØL!ƶêiÕÍ- dÇ ¢Ô-Z[ÜØ}aa¸²î9 ‚A€ @ O!ýá;ûNó*½ê7ᕤ°Í×%éß×OVvêHnõ>ˆœêκ´wãóÕûÑï|ð·ß»VÜ8ºi{®“`t­ä nç̈ùdÉP„*O§|z¤P‰¸#/Ôߨž0ÝÓVz:)ñÈL…ã¶u­gk ›ýšø%GS2]á>ÏÕ»¶x˜Ä:ÕWOì;’YHõŽ^½k“&ûƒäS L E€ýu+Ôznïæ#´zˆ `ÀìÖy©Ÿä^nà¸Ï^³>ÐÉ )nýâ“]Wš@‡Ñ‹×­òn‹é¨"=±-1»ªÉ!o»þ1&ü•q[ygfõ‘ôúéQQ“ï&F¥ÕR”#¦/ òPkarÄ7÷ÇO~3ûÔd?aIðÔ«iñ—šÓÄÐuK&ÕÒSö䂿 ÀÊUö?cÄÆ†ìZ:npþöì*´xÛ—~v•‰«7¾¸&õm/VIîç³/(ÞÙ÷e+|‡Ûª«r™jl𥕅oÎÛ¾êôÀÀ­aB´è~òI ‚Aà·@¿äß×%Är=ƃ„Euc«º±BÖTÑ¨Ö ¤±6}u|ê–Áü¦+Gþ]„‰©Ød­äÞâ1³½R^»«@ŠòŒà;ÏX·qÄýZ™²¡E£ÑÖçc'ØyFTê—[Bç"eQrZ>²Äìøb–»-ªÿ. œ`ç¹QÉ»V‡.è|þéhÜîÌB•×ܰ1KO¿ÕyòæR¿ÜõyêÎIÎßT£Ú3ŸƒÌñz+fWú¶mÉoz`ï¼ÃÚÂôoÑ$¡`¨²*·ðZ3R”ü#f×›Ù‘Û¶Nâ\9s°±>œ^ûól¸ñCg‡D¾5ÞI ±[Ô$M=ei8“Bb>JÞõÎÄ¡× ÓŠî&¨¥¡AVž›]áüÆDOÔtaïGñm掶GµçÅ $/ψߓk7}MÌæP›ªÜøƒ¸îã\*.¾Ž´Òª°ì+ÚŸ¿¯E.ãÜÿttsZöÇéáQ›Ã‡×íÙ|µuTƒR˜ËÖü”±1·Ü>è}âSˆ<Á¼Z,J.—«à.DWˆ,3À£-Ž™˜¯E¦ÀŒnǃ;êÕ#},²%‚A€ @x\ô‹lPž5ÔLºò l½^ó¼uî__ýû<þ­®ÑÇcѤÐ(?÷‘£¼<¡¢”·J.CEøî[Ïy̘7æ¢nn†ŠÓ˜×!"Ë5Ú êêìÁCí¨P¦­=n©9zàsñ½g\†š„7[ú¡ç*üí­‘î#}'Orb£¬{'wm ýKȉvO¥E­-õP›,š1”Íâòù\PÁ£dœqÁ[BÞ½‰Õ€ü EM9èÖüx®ðÂ]¨ ïnÌ¿™ï:ê°×æës:o|ìâáÓÇ8³‡ugÝ¢Ô|J7¤Ê‰ Á ™OH\jÜ"<ØZ”/®¸t¡M@> ‚A€ ðd"Ð/~ð@}zª´ð¸žC=‘Yí«×nÌüáþèIS^²¬õÄÈšƒNM›î×TnTÜÓÿìkîëÛÁCÄ]µ[¸/G%oMõ­“œÜ»5tÏìÞvZ´•I‘ñù7–lLX<·ØãÔ´bémzoÀ0v°ã³PWkõÒiûá..®¾³C/ ÞÄç+¨¡Œ"t hÎ%¿—¸kß}·±¿݇"¢­?˜ŒX£ºÿBâïÁSTAr-jeRMÜÏá>ã ;or^nÊú]'i¼¸Î^|ÈR8–YRß\YXAYŽ—îCH[õÜUÍëkÿöŽªÖÔ2½;[×àìVÿsÿ‰ZYcuÅO²–_Z`ø‹^Ãlê‹/A^ƒê^«ÆyÔ+Xè®Ý%·êj+J*õÛŠ©õ°^ P)åÖü‘>¯Œ:iMt§©L>Û44EëÝj:áõ×F*oߊ69Žw]=±V*yëPO_¯ç±ðzn¶Ê(ß±/EU‡¾æí ÏôÑ–ž,¼ªh©¼ð]B\'[Š\|E½ç­Z×å;3JhòùX ¯^ 'ŠaIƒ2Òó:ÿu_QS{{»²©"3!V0”ƒõ¬ÏJƒÿþÁûn¶´)ëŠbýqsxpŠîÐÚpY„V¦äIÊÊ.æ¥û …k$k¶Nˆ¬øæÍ3Áx*8~‰ö¯»‰¹y»®¥E lWR½Ñéÿ 2šcÂé²3 ÐìŸpºâLT$WdÝêCñ!‚A€ @x2°Cì­ªE{·á1áâe¢É#™ã¹ÏÍÉ->²¹˜3z¬;WVuò›Òys¨ßtýÞ¡ÄáO®×¼¢Ú}ÙrOŒ~cºï‰SO;Ÿˆ5A;·ïK‹ þ¸À•ï½jà¯QUIM?’J58O}wš‰hŸÀ˜­ñ™—÷Å]ÞQêÉ[§¸Ù’}q’¡cÇy¢Ë™'®n|;lÁ/É™…i1XœpMª‡õÃ?Ð „Êa°{5bcð§;Ò|Fu¸„%ûಱè¬04è­üÊ4ßüÌ ;Ö^1ΗƒªÏ8ùÇqs1ŽÌBÁ’ضôDè˜ð¼×-¾ÿÉÜ‘¹˜Äyî6oös£ý8è’rô+ÃÙ\­¯:Yk?Ò¡è,ÍŒ[› GCg‡Gû9°͸K¯®CQ¨½=IvöTü—#v½=fÝN>Ÿì‡?G+tk…hÜ(ßi뢨yFò[Wh¹@ÑRR}ÿ>b¿(@9–Ý’#g£‹Gû'\ü8Ä×¼¼üfâÿúâ¿iùWÕ„”&Ö·!ä:iÆ „þµª7êÃ7j LGW7çZ,ÀÎÑy˜³#n´c«z¬Í„|‚Aà‰B`@u½á—®SÈê´v¶×¿ˆØ{¾A´ù‹éÃ!œ¤Q(Ô\.D(5ò5×ÎÖa*²±äÂõgÜ<ìXò‹_lÍ-Wè‡怬Ø\¶¹ã®Q+ÔZÄârA…¢U·B7›mkEIU+Z×H-­V¶¶lZ-ðÐX±Ùl+sþLž”Ëb’2ëZE«Úʤ*­`’ëë”VX­§aü×YÊí ^é“T•^/8p `ɰð ­­­Y,–••ÕªhµZ UNž<9oÞ¼'IýÓE¾_d$F)’ìo¤*]Ĥ#”TÔ6–T•‰\=³¶ IDATo{F0œTØÜä¤ð]o¾ªò0Çs¡%‘þ[òýxH^šj'X)E-!c~1$0¤.,!E-Ùcy:@ƒ–ìžì¬È~²‰@Z†RS~˜R5¥¬åWx¥¤”}ù‡‹Ï äŸR÷ϱK},©JÚ‚A€ ð°8þ|ÏŠŒŒŒ®Ý¾ÑòÖÉõº½ÉÜß`(à¤Ò‚X<»Î%ªNìI2¼•cÄ×uÙ(~&,¶Ž¹I«áÀŠmË|©»ã¸€;NWð'xظÑF\3bÚÜÝ‘W§ƒ¡Òݪ¿§Zé˜u°´G"ÑcE ª¼Jƒ¼YMUÆÄ\ÐÇÆc]v{`ù¥ï‹,ÈËØ‰s% ÿ÷ìŸSç´5ë2ücżîÔ a¸¡0n)ؾ@Ýc1X£Æ©4=(*„¼úí$ä}öy²Ð>ÄÚY¸îd2ÕôXæ(R'‚À‚@ç^éƒ*8rþ§[„jÄvp0¾¨¢GÌØ#×}þ…\ö‹Z£µ²µ§·nèÑ@BDxÚ _o-ÙYPë¯ø÷1¦¬’æQ€þô¶pŽ—ßœwßõ’ÛáÇânܘ7X—Çb§è1n²3¥QÉ*.‹ÚOö£–¼üô:ý‚ò’»àkóõéB4é"‚@ßèçä:haÅæ;8;õÖ Ö1aóøC†:èö/ëÀ˜~-p\a<\v ììÆ/ǾJ[ã•åAÓ9|„BŸ” }># Ëå!Ê‹À‘8~Á0;ØR ö9³irP|ÖÍž§7Ñ[›ÐŽ8-”c§ËHŽŸ5L(Ù½´Àà—CT™IiP’®ô‹>x’C‚A€ @ <2‚üÈt'‚O+¬?l8¨W>08û¶ú¬»RÇ’ÝÞi‚À¤²Ø™Ô½ÖÌÏN¡·sÐG‚•+ÆÐiÖÖºœ`6ÞФXóèü õè¤5ïYª—Ú‡›å:§"o¥@,à}!p¡ò"è}&p†Ó@ÌGÕè^ð̻֓‘B 'þNîIµ”èõ„"ð›|NŽž yMÜšÃsà›<ÐF÷ÑïgS¶µYóìxº½EŒS¨‘×ÔÉá/gÓÑç5Òõ¦¦’×4É%ßßk†CŸÞèNh ‚A€ <þçäÈ4=C€çÌÜêÌt ˆLJ?ÓFã««±F²^ÕlúÀóaèÓ+å 1A€ @ zÉ‹è=fdA€ @ ‚ÀÓñƒŸþ9$‚A€ @ ôâ÷32‚ @ ‚AàéG€øÁOÿ ‚A€ @ zñƒ{A ‚A€ ðô#Ð?~°ZÑÜPß(“5+Ô={›«%à´õ%yG¯Ööýê«§3rN—˜màßY»%v]¶5”拿ʯ5`qÐ}YMõ­…ž§¨Q[WøÕÁÂÒº§He¢*A€ @ ‡‡@¯÷ í¨Š¢2çóOH ío¬Ù3ÇËÖpØóŠº±4÷Tî$áˬòì£ùÊÙþÓ|ðžýÆ¢é¤ÝHÑÃZãµ<…fôÉÜsû2àXvjsè­Àmküõí<ÔcZ阈K5˜7ßkƲK\-‡uÙ¾oÌÎ,Ï=óuñÃ&Y¡æKÙW8S#]¬ôÚñƒÇÑ[FÚY¡ê é){re ¾ûì•«]ÐO kãdãÂw…L¨þ&.>³bìÒ䥟Œ ÉDî ôÁRÅþå×&xLÛRôÞ‰¦{*mkarÄ7hü”gofŸº–¼ÝæBRâ‘ :rŽoØÖµ#íúÎ÷{÷_ªÂwWQ̺Ù#;êÀE —÷nN=©81rפ®ÉÛ¿;÷2vkÛÆ¹\EÅÇ1qê©ë·¾"=±-ñ4Z0×ó›=2Ćl™7ε”$­Ž¿nÔvèŠäÿ}Ù2VF"R#‚A€ ð”"ЧüàºÿÃn–pö¤‘ËŸŽnN˾à8=Å•gA¤)¿€`Ñú=»>Oÿèm¬sCq&8ÁNÓ×|´cGðÿŒÂa]+/çlgA£hFME™{¾}M4›ùòåHSt$ œà±‹v}¾k¶ø¿ýô¶^G A€ @ '>ùÁh mP‡ rëO?T#ä šà4|‚Hî`u¹´™&åç>r”öaØ­¢o¡"\²häð—ÿ8ïMš†ùéô¦ìñÊÈáC÷è{!±]}^°>Ÿsðëï°Ÿzûs;)V®Âé. í9IMåÅ#4ãÕáF´­++…‘Ò«ßž?³¸\&OýUpžKJÊ‹K)[y¥ìjñ·24ÚǽC’4x¡ G¶FìÎ,„°ôêÈ·ÁÕ§’@&D}²iÞÜÙJ ‘Ә׬Ôhœ¾PWßXsE Óÿ>gÜËÞü¼-éÀr{_-d´tÓö5­PE\>fP{jzNñ3nÆü HΠ üç¾·}Îì·_w¦/9Ô·o〞¿÷sEhÈ(/h%… @ ‚À¯>ùÁƒ‡ l.œ¼¤µ8ŽæÅšƒ›5mzŒ¢°fáFµšòàLÇhÕ÷MLŽz"¢ö̶M[·—Üvâ”×Áõ4:¶&œtž“ÿjÅ>üôXÈÓ€Þ´`µùÞöù3—†.QS—QãRdnO’:Ï ”'wCŠ‚` $T˜ë²bGú.÷®YâÁ×ënïdGÓi–R€ ÔfÊ>²¤Ã´µm Ÿ$p€wrä¶j-âz½µm3´Ø\)LO\|©^cÆÊÞa0´uØ2CEÓ5ÔÝ3£' ‡‰€ªYxUÑRyGa¹.N†à¨‰Cæ8ÂÐ?“‘YRzâÛsÍgÂÊl¾u£¶…é%Ûö\Dóˆ¨r'ù¿>HyBÁê¶‹^;-Úê9ß7 ªlP¢¡S'@dÔ¤8z¾Ç*yëPO_¯ç± çY ÷KQñ_~eä(oÚuö›@¥"˜ŒÆ,pp;úÇ:"®³Œ­=–YRß\YXP‹³A¼‡xàÆSûN•×È꥕U–t€íäNü̵à/Àt€‚°y]CùÙ2µÇ‚°˜ðÕw›;ø»:¡Œ¶/¹¨Þ·=åËÔ¿î=ßÀè"Õ§ÒÔE”#‚}Ÿ>¢UYŦõ—=¥û±Ðýå¿ôÃ6ÅùtqAÏö'T•ï`mç8ÌÍÓÓÓÍÍ‘3@¸ÿR½©õûC|ìiG΢ä³&ß;¦¤Ý)HO/¸ó;cøëlW•†½4+­GÆ® @¿X¼zì¦Kã(G=ùRÇû=Ÿå¶FišX|üfóc7¦_À'Ñ€‹RðMξ—_8}Äœƒ²æÛœœ¥à\ôºHã~ÿRÐîpjõI¯¥þvôÉFV®ìØ*ôZ{>=1*tsdÄîGïµ!ŸÀ˜ã\®dÆ­]½ñlÍÐÙáù9èŸT&À I¸ðǼ#p•U¹iIα§'Б°‡¿ö†;W)I[¡ ÌPC{.ÂÙw&âµ[Ã>ýNíÊA²ÂCåx+`X “2x⬩¸ÁëM/]œtÄ<ïÀu‹g òÜ‘!ë×B†Ã÷”KíüÊDðûÑë¾nˆí6?ìçâ;rü3-H44ÛùD¬ rBWÒ"Cv)„-8Ö¿÷*â¿ú÷5N¨:{ûêM‘Ÿ~WkQ‡úöíŽ Ûx|ßYi­Òÿìý(,ì/K3% §qAþÔ ·ÑákJéHyÌ sQV~/+`‹ˆ`:ƒOÃQ@pdäø!$ï\à;ìpùCŽfª ñ©úÅó1žùÝãÜÖ¦ö÷_y(ïŒDRt(6¡‚ ñ«KqUÎ*Ç 4‰䡲Ћ (=|rÐþ^ÿÞ³©oý›îµê_ YùÙÃû—Z¸“Ó¿rúÊM~ã|:BIûR?Œú8»$õ}ï¾r|ãeÅâh æ¾÷´q™P‚z1ËÔ5þ,<=%Kú®l‹º_Î^Ý/÷ãGS~6gÖÙŽW9Ðîe= ¡À¡µ5$˰¬¬¬è§V«ÕPåäÉ“óæÍë©¿:,OO‘(C¼á²Fžµê÷ vJü“ŠòÃÆ>¶jJEÖ‚–QXž*²[.¸Ø’íGýPh¤YÖn P@JSv¾?£) ±¤¡`‰2cÓÓ"ß/² jIiÉ¡¸ötXÑ•& áIEʰ±½Pº¿¤÷‚4k€Û‚€IvÈ“èS†¨²Bü¤QŽ0ò?Ó”? / ºôb–奩v‚åIEÙOË9¥7òüÜà¨R…œåþEÊü'öt)MY$ø }gQSøXãúëvjèo3ÿ„‹ùëü€¸ÇLÌ1oéVøÓJpþüùž;}‹ëQbsóùCø 'zÀ'ãöÀ JÞµk δ¹Ü àVÒ¬@¥¾9Á”T°ëá8ÁÀÜtsæfØ"2¸L€£Ü{=5’©qq‘¡›±Ì}#4ø8Á &)ýˆ€º¾¬å'¶ÌÐôìþEtçaòq“GéÙT‘.½sÑáãYDBC–gyVœP´¡\CSUæ, ãô)’9±þþ!Ç©Œ7H\$%/¾´¾z¥Ò±èžÉ 9üuÄ–™ ÷5ŒdÜJª(8‡±aoê~mXÞK &ŒÒ ®u-’Wîß Çߣ7âÉë‹7èЦžÕ§šÈË'ê›áær\–!nkÈ [¥á#LÎ)gX§º”•¨“¸ 1Ú•9qàMxÐÛ‹D"à€)ÏÙ ‚TæÊÒ,}1†^Sš•¨ËÚ¥Œ¢§ƒ!W_•—§®Ò'ÕøˆRu³h‹~þ_y«öÃäžMÕ!  T€-FÍ‘§4·°BT?ñ÷ͩЛfaê»Lþ×—æ¬Ñà$,fNÿ‚ÓqN5¥9©!z°„ò¥x 銅³¬{{9>] ¨ÓeƒþÖe4ô³lúM¥’ŽÓŸ„]ÝIëü|ÑO–å‰Ö€èoÑÄ|ÆWœ§.\”XÉ0”¦¿p`7Bþ›‚°l©X´Ñóš™ÅáÐeaÁ žCdIÑ'¹­c„õIÖ•èöP`»Ïݵk†L¡Òj´\{Gx)Olê1ðsxö?8úå;z8mBÍñ8·YÑH˜”2.yxø,OÕ™ºu“ ·&?ÎmZ4|ÕÆ&‰”—÷,œw¹Q€'Aik,*·4ýS*(ÙÖ|'½ À_ÔEõ*kŠ sD Í|ÞÓ Äð=‚÷QCà6r/ä¤Á@pW{UT2iáÁÁcD.趪ë%Épg{«S„àªåŸ« 3ÄÈ.‰ìÇSJ&,õ¾wõü±[MzsaÐÂat_ ?$ /Ÿ1Qy‚Êòk9 #â! %ié3—÷D¤G//Ë~ß $ZÄáZæ¬è‚•± KÙwöDì xɹB9ß0•g…Ø-À¦£•±IÏ¡ªCÑ·mh°AuF¥ 0ï\§‹Åé0ÿ!£`wÄú³; "`BÒ8uU~Ö­&'FUo¾pìâ±ìË#–Ïç%]Ìÿ»ma ¶X‹ìÁ"`ø–GÓòˆøÉâ[mˆ}UAØîìs<`¢ê/gNj٪åkg:Óå{—ï,<ô,««5£¸sZb;);†ö,—¦\¼|¤•+7ǺdíLOÿ83áý(x ļ˜Úè^ bý‹ZŽÕßHòÅgˆ@‹ÅѾa/)ÎÇÙù’Àj¤x‚Ú0!ééi³¸^7?žƒAéúcŽ ¬JKßä»óc„À± D’tqüÂõ£ýRßõ Ö’%äA9ØÔl…hn¦NµÀªélêS1]¤ô7 )òà\>}‘þ€à௠æœÊó–§ùÆ&%¡«ÙÑiñÓªž¹]²O™~¹ÂWólÕkÇüßÉ:´±¸ªU9án ÓP@p¬ðeöåìãrÝ÷“!U×+`ñ|aN–ùDxÙ sGR¸L¨»5QSŽ £&Ë@‰4•yÑpkkþª6/ÚhNj©¥«áf ¦ÇY’ô¤·A^ù#R^Äîfà!%>¼‰»™ÔQ{ûí3)p 7iZI еÐGí-ÓÞO±P¸ÓÝt&œ¾©£np¹zþo)JYú’¤W+²+å‘Ùdª6ƒi[^$ÄÁÄ”:F+UmÙ‡aÂXܤ°9“€aM¢ŒmW6ÝnÒ!Ö~›ò”#óh°-áЮ¬»Ý¤›‹v ƒOKÆ´Í£e0t(£Ì€D}[`êTDŠ FK¨á‘§ñÔt^ÚNSæ¦è¦»½¥(ë#ȻյhKnmeû`äEÐíôÿØÓôaÝéXè άhooÂK Aú ô´‰WR°#)Æ«…Æ!2ï6,ÈÎ×j;½Èa%ФÅtõI¯pZnÅ¥H 8QÐù§ÐÇz{ý÷]M 4 Æz*ƒ}/ ÞW„Ñi“PXEêβΗ„^mqu¦PKr–°„v0ªËSŒ:¯A…3·ñJ WLо"¼`é³€>[;GÒ‹™¹Bä’OÁ´9;±]¬Cèe€+é¦ÛÐÕgp˜sÚÖTgX·M xt˦ó³UI ÑŸe] aP•ñM¥Ô}·ÐMôgK¦óO2À!a0éÂÆööŽ€˜·t9Ü|Áô"¦ö­Þ+§â³Ï>럼˜)RÇŽ@zÄ‚Y –C¤gÇæ¯s¥î÷h¤—!ر·‹99YY9Y_ýçܖ㊚²cð°â ›ÄÅyÂDp#©Dº¡wŸþ±gÖ q” ÊC•Ë>#///sõ{‚ÂíBöËh©ð‰o9ÛŽp¥ÓgäÒ‹8p~èïY¸ÀÅCV˜+…Í3ƒ‡yÚðù6òziiqqqå/à K.^7Üé2&phãàÌg©j¤å¥¥— ÎÃôèÊsyPó™IËзÃÿ6j‹}¢K—`êFÅæ}8GµDN# 9~Ú¼¸ý9•î'¿Íøë»cu<¤¼ÑéZ5°³±6³ÃÐ×±¢)HÝmÑ ©(\y:¥ÖνE±sè§*;ŽÀÇŒË&³Ô wWÇCh’n—„£­n±žÁ—(½,ºj£V²«aª©÷ƒÒðv¼N–é a*ÐÃu¨[„îÙ+ÉçÁ1SùñÄ5³"¨l!&wÔÕÙJ?÷c˜®nÑ0]Õ6ó“%±rA´xçBœ¡)ùl¾·ù¥qΗžL4ËuÜX.Ž8%]=«2L Ü·€¾ö2±ö<…Õ{ç.L¿ù¢ïÚÆ€Û-]Çj˜,˜BdªþSrDâÁOÉD5 =@Àñ{ï÷‹pHO¬R‚åuˆï1pÐÔwÃNpðé2|/›ÎX ù¶©±’×k-ŠFÞtّ݃O–ªlª'á\€Aã÷”1ÐÊq[À3ŒßXkz#1T¶0›-Öi‹¨DýJkSž\1ˆm<ü@•‚ã_Áðo§à÷‹’S“C„vÓ©ÇÑÔûákS“7ø8އûw½(}{=óƒ &,üÞ c¡”^%Z•œ“©¼ôÒþ ¢Yñàíøÿi’+Mjãñ§L0*}á²ÄœòòKÉA/A¸10%ÚðÈ?ƒ#kæªÿ…IÚŽhCVNÎþdؽ+UÆ °PµqòçůØ|85ÎÇqˆGU§O–Òñ÷Ž#XœAÐ$Û8yƒh2õF‡Œÿý¢´FÎD%¬¦·&ÎÉ: ‚ù¤RÛác&¨èÈØ¬ãùÅRyW“ØQ >.Þ=lK–s<ÿøþaí ?€FzÑìõÆÏrÛ°v¼;¾A䆵 Îü“>_ÜHÛ³Xtÿ¼‡;ú„>žöxNò†E«ô/1ñž5“f³p–/Tl\q„—À?CR.]¬ª¿Ã‡üÚïx_ÁŸJðjîPj2?†°ä “´þ„yX¨$âX'o™)ˆŸe »Ð=›•¸h^Z‘Kÿ [ZЇ8äÖË%a§/§ƒQ×È3-T»X‡¦Ôô7 Šžå’¸?'çpbœ.Ŧ4&G Ξ¨µûï_%tŒÀ—’ì\Ø$¯‹³Õš‡×81~ÿñüK°‰a/Ñí™&ÂWÊÙœÔhjÇÂñNz—šaO¿ž/6ÞÁ±ØÉ…²b‰?ã– ÝFòÿø—`¸Pþ§¥›9]ÚØH{HéÏÁe–ÎA¦-Opý1n@D^=ÚIö‹èì\úQå}Æááþ;öp!5´‚z†úæéÝ—.Õ*>¤{6ZY‘„÷U¥K`ÞÅÓ0Ìð0{»²Bÿ]}É‹gö] ~súÿ>‰´RRûº zöP®˜’ ß¸€æ<çSý>vT¥Œ~º[¯4l¢D?‰Ï ºB=鯳*é´aÛ®ª¼yf%2Ô ÙÝN@JãIo5»j [™"ΤŸÖC ðX·%ZòÀ7¤KÀ¡Óº§Þá/JƒºC‘8(¯/‚CeôÌÔíÓ› ÐQ¶wfGUmE&\ùŠ AŒw<°XšÊÄÆù‡ÉMN·dKG-jIìcn Ð$N ×žN•Ô~ xd µW ~§ ÍöëÀÐÇâ"Œ¥3u)%ÌENkž»ž¡‘‰²ìp6ì\aìho/¢6a ¶Y0N·“€@—<µ÷¼X§ÛƒÀ ú–½NtKBšèO8J1ÃRïÙ)¦Kk˜BoZ&)‹`aYµw†¼‰™4:s>5L\g뉮—‰©-0:¸Ð“Û_à`MjQPÜ“òò’¨lÕ‚Aèälmo»™§?‹ú½b,£a¦*æšÉü ð_yÚlÿ¬Uº8_ºžh}/þ¶¤ ½Dá¹C“Õ¯ïÕýo+ÃçRÀ>z˜1±l#Œ5ļ°îäT5_0BDã ߆m…:Xðè{åTÀ~ýó>9z™’O‚À @Þ'÷ =蕬^®a±l8<žIB^_©¨6ŽhˆÈ_ÔÆø¹3R‚Aàá /=[™D.ï|ÿ>£`ïw¶4}ÐËZã°GRcÙ¿xú´äR”ðéªöIsmýÙÍ‘» Ï”Œ M]:fð ¯QÜBJ„Ÿ×Vלúú˜zª÷TïŽ{4>Ûþ¢)Ï>š¯œí?͇­®Ïûú¨zêÈ'RÏþ¶›ðûM!À›¥TBÄoÊhb,Aày‡´)ßC6dñ“åðÐày/U*߃ġJ‚ü¢R>j2ž‡o{ó—>ùÁùbp‚ýBw-3D-«“³[è÷m³´ª–í肬a)¨°*Ü—VmN@ƒœðpm«¬EÅåA2iu£ÆÑ݃gÕ#®ÈvFô?d‹£õÞuj+—‡&Ž0&<X6g¹>ˆT‚À#Bÿ#’DÄüÖ _´OÊ è“l;ô„ª%G3r éàHï>®¸uö‹Ov]i‚§3F/^·Êo¸­ôĶÄÓhÁ\ÏoödÈW²eÞ8g¤¸šw݈ƒ ®**>މSO]¿=ðÅ£›¶ç: F×J¨½“83b>Y2¡ÊÓ)Ÿ)T"îÁ õ7j§„'L÷dúß­E»÷ž*f#¦†. œÄ5Š`ÖZ “#¾¹?~Êð›Ù§® û K‚§^M‹¿Ô„œ&†®[2‰­•ˆ‰¸Tƒ‡ð½f,[±Ä•ÛZ»úšýÑ'OêuÓ@R'‚A€ @è >å»ü~‘Ÿ=RÖ&G¾—˜~?\ (ùGÌ®+6³#·mĹr æ`<¨hFME™{¾}M4›ùòa«Ç¢/?'xìâ­»R“g{éU¤â¬ƒé8+õ^«ZɽÅc0òÚ]R”gì'ØyÆê¸#î×Ê” -ôþ×z?Ý N°04!2dÆõÂ]G.wšjÜÒÐ +ÏÍ®p~c¢'jº°÷£ø¶ sGÛ£Úóâ °DƒžŸ³cϺÅSeå'¿þ{Ä֞ñ~ÌQi½¥ä?A€ @ ‚@_蓌خ‹÷/˜ H w­MΗה×ÂAÍç /ÜÅz}w{ÇúË}'nûœÙoãwaW²ùöMð]~ïç¬GyybZ}a¾ØiRh”ŸûHšb×·J.•ðÝ·<žó˜1oš~„áëO?TÃÁµïÎ^*ý?¨”ýt¡Öœuo‡þÅø÷¯òfèÂ/âLݲqɼ£;jäÒ¹oýÏd–ÆAr¶«Ï Öçs~ý]ݾcÈ‚†#RO<ªòÄE¢¸¬ò'^Ñî|d†<2AÝYÜ/ý*i~jVi¿°"L‚À¯¾ùÁ[Ÿ7–ïŠÅO2V×àÝ÷ ØwqqõºxiøóºwµÛ;à'è ;J`WÓP~i½g¨w¨Xs0¥¦éCnTÜëÔ7uæìâ)\¼4tÑëà×Úþ!29&Þø7Ë«‚ ‡Ú©µ÷¡Ê¶¦QíÕžÙ¶iëö’ûÏNœò:˜¦3B×IþžxÚçÓÅ5ø2JéþE Ø_ÞýkŠUåûrQÊãB™B›óP>™ ‡¢½Ó–ËVeUšu‚A€ @0"`â›{V«½|´T3ÂÛËI] »ÂC±äì^£L)·æ5ÕIïhiϸ#Cö°a\TSýÏC¹3†U8…cÃItÇ&ã‡ûŒC§ªó÷&s'ór³ ͆Øz¼ìliµö˜,@͵w)Ç›Ëwì$KØŒ¾¡ùŽbØ“ü_të+p·ùm-Z}ùOx À÷;E…wB£¶f4ZªÒל-jjû48—ËÏæ]¼åýÇ?{[~U…%ýÛÖÁþeÎäöÈ1…>´ºwÈ™„ŒÉ <ýo¶ÍqíÓ÷üCÓ‘0&>Ń[«¿ÍÞ·64q×Q%<÷·Ù\»W#6»¢+> [¿:lGÒÁFì?š>‹X¾ïü}4’qÓäÊ' àù7]È« ãI_ÕqàzÍ[!šÀi*Ê=ÑðÆtœÏС¼üVÔ;S=¯ŸÚµyuÈæ˜Í_•‚‡ÝyÑql[ú§B×äì;“ƒ™[Ã>ýNíÊA²ÂCåtdM×#ÄL=;—Az*½Þ Ø{¹^n¹Ü{¡¥³Ê ïå@)KTŸÜ¼0haÁ-“ËÑÎÆ>”vSCŠšé#ôm0a=)l{ lÓ¿éŸ‘‚A€ ðÛF ¯ïUV+Zj²²±³³e<@¦Q( Ëâr»N(Ð(ZZ­ìwMd:A%®?ãæaÇ’_übkn¹B´ù‹éÃ;2Ъ[ÕZdŶe3t2åÓƒ#­ŒÀ&hÁÆnméCBb ò^eK¨[yÿ_ΊHƒÞà„¼íëf¸ta%Ôø¡ªÌY¶l§÷º}ëfR¯ŽÓH“CÃ/ Üýá|àÖGAÒ³û7ý5(ë÷YØLZ0f»·i]Ü¢ë‰Aáé’¤¢–°±ÿB.ûE­ÑZÙÚó{äm?V…‰p‚À£@@ú¿Ø dV|=ßü¯°¿§›¼œ!ÙÎP—ï£œàØ›%QØñ ù`Á†€€xeÄ…JE¢©=æD•í»þRPzJú—!ÞØ­ƒcúQ»°íQBˆ]†­£-|ð|–Ýn sæS£æ{¥ ¨º~Sƒ¼ß8þâ²ÍñâËW³ó /¹Ùˆ¨Ó­!dm³F8 jG=Hk$|AÒmØI]YVò±XùžŸˆ3>"íTؤwi(Þ+‹š¶åcƒ4Ò+TX;êã¨ùp¥“-/>L9Áþy7¿žéЇ®ÓuÑü™e—æã¸qÈü×½‡M‹X¸þð¬ìù‚Hñ¹çÐ!âümÁàÓ±g„–z(¬îÜ+‰qâ®fÄ'}ÝmèäbE§&ùG ~»ô)?ø1ÁÆæñ‡ up$NðcŸˆ}ò¨);J¬x;Á¸8O˜¹¡-ôégÕ¹|hˆLXŠ`\xî#†Ñ5óÏ6êISu›ÒÐ5ò©V-Zu8¿XÖEÚ° œ`y½´´¸¸¸ò„$¯Ë \Š=“N04hZkáSçËöƳ®ª H#½ŒƒÕ¨êbNNVVNÖWÿÁHÞ–Q@(áb4íCëÙ‘8ôž¶@´!ùl)õö8DèÆ¹<øô¡`ª h¤%x`¾ôÉΠBâ<F±yz'¢Á7Š$0âêåX¡œìj„©/ßÀˆv1#6nÞ° Ä—%Läa)‚A€ @#ÀˆÎH§y­{I£^¤c‡ØM[g®5S99iûâ‘]›ùÉ’X¹ Z¼s!N È”|6ß[—§Ê ɬñË‚¢uY±t›ùuãh«sÙYÏŒ0 ì•!†Q]W@²‘öeÅA„µ\l¨u}6ÞŸ]Ü×2>H(0©â³0¸$¡¡ö§K,60R6Þ„ùøŽbÌ£;\+ÐáxŠÐŸ9C,Eš¶œN²ÐqRÃû~¯«iSÀ2 wâd“ A€ @ 0xãÁ õI• @0 píg£ïÛùîmjLUUÝd§h¾m¨[¬˜l¸Æ÷ŽÊn¿]v&!‚¼â‚ ùúŒ±òôe¾àÇŠ‹ZÚÚÛ•ˆJêC¾:*ʇ£ë†mÅõ zfˆžÚä¿}óâ vÆ£ý“êÚÛÛ åäR¾6“`¸ƒßûùmM’Óûp`8=|Yò%øOC]p¼™Åš‹wÈ‘\¿ÅØÉAÓ‚cÎH·_“×5rl˜ ï¶Ò¨²mÅXJ£ÎgD~óGpäÝ™W y“c‚A€ ðF€øÁ¿áÉ'¦ÿZà½ø v¿Ä%7un <w"8@ºdS3‡™ ;w(Åi ªÒã‰ã#ôÉÁ¦”pD{rLG•~‘¹³×¤u©â$ð„QI­¹ï©ºyģȥ¿ .˜¼žr´ÙTî±™ FC¯ 1ŽÓ1–çÄÆb±”CiìµTëZËuÌJU°çB¥ŠÅ(–8Ñm*,¾·ðýìºw¯þF.b£6–NÐkΡã׈Á—U·m~"^CûÓ®Tå¹YY¹FâÛhÌ"$€žH¨ƒŸÈ'ý˜°ôð§Âj‹ûË1±1ARñøø–¦h3zþ6PÍikÜ­yffB÷)¡-Õ„rV4¯ [ðhjVH;Ùö‰f›œz:9v •nd¤‰Ý}A¶‘ˆ…+cöņ{ØŽ§ O7Š…©#æ<•I V‡3³ö 2Ø´ü§;ŒRëq?H Ýéë"\›|útê¾Ø•~Aûš ~¶GyÖç<3ixìÁÔÓGc>Œ‚˜ßÙ/‚eÏy;©'<~¤µ4f_òÁ}1±¹rÂuýÝ‘4r\ÐÁÓ§“cþ2hÔ[ÿé{Œ#ÚÈN]–;yÍgð¡ÅÍs—.Ž9zúôу»ûùíËkýQûl¬±6u \‘_Úïî5ÒËýõì–¦Ñ|X,AH <ÖN¦ŸÂŸËëO'÷¤ÌŒÎV¼²°Ò¹y‡GŽÿð²6‹kE×ß‚$ J¬tˆýlïOWá×ö)ÿø/Þˆr‡µÐ˜ÄåѪb½ëÖfô¼{çÅm™•¶Å=ò\örÞ>L,SÛ烓;טzZ™ÿgÛöŽY@k² Û’VWí˜ïëîVY¿œ}L¹X_Ëã1.P©mM„µRÿ*pþ¿SÑGƄįYãø8µàç¿Manqcj0}Þß@Ó?¾~ÒaÞø |#˜Î`Qfݰ»…Bž•£/|±X s«û†íýò=7¦²å;{ÊÌûÏŸ‘2‡Ýë>…ùÜÞÙ™i>ÀkΚYcXò>ÛN~$5’ÁMœù’ÑËÎEÌ\³%$M7CŸaaKŸˆªà;ˆ&öݶÖ” FŠØGŠÚtË3¦ã @Hà±'0~ܘÎ>Gã±g„|Ðð9]HX^^±¼[ÐÞ$õƒŒ<¯dÖ\3ÑL.ƒ ®ÐÒRÀt«QÉåJˆ©àJ$ŒÂ2Ñ‚)ÒÈËe*¥%•Öªò9×Z"a»h©‰¾¼CQÉÊåb)±i_ßú1˜÷¶búær†É7jÝhC%—1T,%ÍèÓ]´.WÂÞïfhǶÑ¡ »ÂœaG‹¹¬\†Fa¾Ü0M|"š¢p/Ç5dýÍìÕFâºÅnq@Hàñ ð°Ÿ£ñxPÃY ǃ€¥M«Ê”¥|W€oöˆ¿¾êíjûs$vq(øR}¶Ö\kŽÂR"1.¤"¬Aƒïiœç›#°±kO]Æ-wjbK ØDq»ŠÚ¨}·B¥Å]-îhÑxûÍ?âæŸˆ<'aMŽï¹JÁ-’ÄH  ЯòBHàñ `NÒ~]‡»³ü#b‚š««Çc²Oæ,,Ý߯T.o×ו'Î $À褮).,%‚>öO[ý™<Õ·‹KîZØõ“4ZŸ´ãiË~JJÓ<ç3ÎͶVVRv—X÷·»¿ç3w²yÇMÇH ý,ßÚSÿjL¹¼Z¡Ôh„b[;Æö÷†5»%®%ó¨»ni…è6:·^„"Û†UÿçÞ¬¸z bCè÷Wk:KU]~ä‡C)Ùt ýk‡–D¬[rí~GÚÉæ¶Gm€Ÿ×íœQ·… ÷#$€ÀcK sþ`î@–Ixœø¨ -Ù ™°î£ÙMVÑ*ªªÕp· ¿´°ˆoçÐn‡®úĆ· 탷nÈ'|‡é ìí`Á¡­.+.“i8–öNvÌÝ&G†Bµ¬¼´ºJE,ÀŸÝ›NCh”!sO}ÿ)ëG'Ú^£¨®Rk —Ã%ZX©“+–X™˜¯úJÔ¢µEÖ¯mŽš ŒšC˜@H $€ºÎé`£éû$ê$™õšË¶'ȈHôÑŒV©; ŠìÄÚE7ü?Y:Ü8ýõ¿¶^¨„¥~†Î]¾Ø»¿Eþ÷«bNT88‰Š Þ!±cKâšub§¾•µ:®”kÀ¸Àwý¥œüÄÄBØ.ŽYôÆ´ÛÇsr¿Ûqbä’u}ÅÜ¢“ÑQûÏêìzoX6P\“ú2zò³¥ûÏÂÐï®\æõ4ÿJÂû1'ôþ^÷À˜`©±º•]:ºç(yÿ£bõÅ5K"˜{½Ù^E1;\«ššTöÃúT­ÊCKþzmÉÖ¹†æRúë¡/w$”BBûIsÿ>}„!¦MÒ™oH $€@ž@çâ"ŒìÓ(ªHeæí?¿à7MB©»SåÄbðX/¨"t}-xö(¾"ûŸë¶^L ûdÃhá…ÝëöTÀmzæ½ BQÕ K×Mt°0Õ 8d…£ƒÖmŒÙúæ‹}®¦ÇeÞÒˆì† ¥C‹&½·z¤_£½Sª,®Vk´å©TÛM\ûÍG‹^#Ê̘¸T-<^ª¢B–shÿ)2m‚Q^8t2ÛY»1ö›­_ÅN‚U…rÎ\7~dŒYuC)»¡‚Æ" 1Û7Ç~<Õ…Ži7énfÒÓÃF a¯ÐkîÒ€§ù ÍÂ÷SD IDATåy á[JûN[¾a’C屨ÐosoCE“&Ñþ1!$€@H <]¦ƒa}PÐŒo†oš>í—@Y i°Dßg©v´r6°ouIõé–üöSúÙ?èÜþ{“zc¡UŸÀx¸o®ÉNøý=¸×ï‰Ï¼NÜ®ª!"{Gº$¦õ@Ï!QƒK[]U¥}‡¿Ô—C$ƒ‡ö…²rhÃ,?juTÈ”™Ó¡}D€9÷Îñ­.úkÐ1|‡JÞf‰íš/²¨½–sÔ³×òU³a©æ&‰ìž³…æ—a®†[ë yÙå\(ž4{–ÃÓΓf¼ ù_/ëI“ @H $€ÀÃ!Ð…: ¶¶¡ëF4xVµêÚ†iÀºû¬ûÛÛ;xM[4÷½gtÑ»‚Æ«ß7éDóSÌÛQ[wÖ:z¾ü’ÓU§uL®é‹Æh8.+bõ­ûÒ‡)©©Ô>mAtXDê5›wWEÎ× ØÚiž´·N¯Ûtˆ—…›—90Ã&LÒj˜i×6“Ó ô›$ýPMLjR 7‘@H $€$®ÐÁ*ÒLüéLæXÐ{תn\+­®Ù9Óµø•ržd Ç°}zÂ]gí™YÍÅà]õÒ •7o@ƒ:9¬ ÁSU[ùûÕ…ÑØ";W¢ôðìòª‚ô4p? ]]­ŠjVß­†½Ï¹ö”ge@€†êNM Öh‹âVo…àÞ¾&õ¼}åJîÅ …)“øj‘ì÷Â[·,"ÖŽƒ¡øÔ'*·ûùgÈxÖ^’Á¤†"Ì!$€@H õ²Š=B—ÎëK.Ä…mÞŸ.á¿âíçu½éÇ.ß"8Ǻƒa;ÃWï2êBHÅc¡&ì0! ð®k¨¾Ë® WzbkÔ†µ1Ñá?þÎ5aÇá• C!"ùóÕËòhø†®¹døÜàYã€ÀÚàE»Ó‹=ýÂæŒ 4éGЙÄâ+@H $€ÀC!`V\n´ƒR­¨!>_÷ B\‘ˆF´3i5jŽ´`2|Û•V =ÁF3*3G_­å1¨a" °CQ]®ëæµÜ”µ¤©IZu¦Æo65jª†ÃïØ­Œþ8í*ºšennLJP(„WH°Éãñ¸\.‡Ã1c’V KÖÑtüøñ3f/´ $€@H k îŽØ @H $€À£Euð£õy¡µH $€@]C ]ë*tÍPØ x² ÄÅÅ=ÙpöH $ð¤ ìVÐÜ­>4 $€@Hà!@ðCà îö%?$€@O8ô?áN $€@O(ÔÁOèÓFH $€ÀN “q5Å…¥ZB¡õ3v–œöóT_<™X@\'÷¸Ï'kËÒ“Ž‘ç&s³mÿ¨X $€@H Îé`Eþ¶ ²}æ†ÿÓûévÊZM^â¡Tå4ŸûÖÁê’?VsCÜð ` $€@H }:§ƒ9\м’qKW¿ùÜoû?ÙžüT¾÷lYyiu•ŠXô±ºwËb‹‰k6{ ËöÊÖ*Jù(*ñ‚tÅ×3\øD4hñÚHÒ³¯®m8§ÕD`ÛßÁ²R¼#Cc]$ðp h 2N]“ÕšÛ’z:<Ü¡q4$€@OÎé`ß’ϱ<О¤çsî•„÷cN(tðÜc‚¥ … Nnûbº’ˆ¸?[~­tlHä’¶~É12mã¿ü-ÕW¾XI¤þŽeߥœ¯:M[ºÂ¿/)Ú½.4£„ö$q8Ờ‹ ‰`3uãÛÅ~ëB¤šO×…«Ç­Øä?LQxìã ;õži‘ߊO'¸Xû$ê$™õšË¶'ȈHôÑŒv:Ãð t²‚Œ#ÿɨPƒ5ª>Ãg¿5Ú y•‡LJäâ]™,éÖ¢H $€']pŸ\UÁùôc;"cÓËèçíÆ¬ÝûÍÖ¯b'æÌ9s]My ›AÛM\¾j@m©LYQ­Ñ@e\Û…<Æa¬©P*.Žû™Œ–º÷Q¦¤_ª"òÌØu›·/Ÿ;N–wü‡_Jßñw40uÑŒ—ì ‡±âñ)ÙOE°ý»ñ1Ÿ,u ŠÄqÅZ¢QT‘ÊÌÛ~Áoš„(Rw§Ê¡1&$ÐmȲb¬]FÎY¤Ðȳ¥Æ¦ñ{ouI^“±+jñÊÅ+cŽªº¤?ì $€À£L ³þ`@Pæ¥Èõuõælÿ—ûóÕåwR¶~™š“Ï`¹£Ò’Ùç!/}k¶óÓŽ3ƧlH0IL8"𣠩¶Ð<5'Š[¾ƒÇ³å§“÷Ü,¥]ݼÞ^;§gíHN¾“Û ö>¡.4B/ç õÛ½4Ô†Ë!nnv¤¨ä*ˆ ;Eo†ozùi ï¿))*VsÓV˜@w PøS*kFàúm£lÕ=‡õ7²Š7xnäúÉj+{ïÅõÐ<+ÿmwè–4B|œ–O†¯‘˜@H <É:«ƒA‹öºzõkCtµÑaEÂQﮚ¯ù"†oÄ£c)î胚Q·²} ÊÔÚZvOé©OÂwgö}qöô±OÝÌK`#~5u¬ ÜÉÍC€u wlmcE{m\ˆ[H [‰‰ë¹quP³ÈÁèw–nÓLJ¥á OdJ®!¦¥Ð—/fz‹…mölºt­äZZ6ª‚ʺ:ž¥¥ u­’«L¹J.'BËfÆBËæÅ¦‡ÇR$€@]H  â"ÔÆúS}·.¶Ï¹ö”geT€»öN¦¿Ç°8uGÌ‘”m+¶oÉúFýRu«¼¹£}^ê©ü´³º®hã‹{Aó›ùr¬Ð%QßÁÖqìXn‰,?ýgp ÛÑ LH {P  Zñi<µ/çhpPP@€_øÁ<º©Ê‹ €½4øE5‰a'‡ù,ŽÚu0v¥O(òÌü¢ ØBž»2 Å´ÔLê´/«œöIäÉ+aˆ7æ%1[IŸÎ§¬Ln;XH•Å<¸R ]‹a¼ä<];Y^jÔâj‡Ôµ™‡_l*3 ¢¢vB»)XãU„<¿Ô"öÛ,Q•d„x0-ÁZð}ºŒø‚@HàAhæÖéà€Ô+knÔFä8Ö]”˜³3<§çr>ÿÀ±‹Þþ3ú•îL<›rlè¤ ^ÇNd64Ð;šôav^“…'âlºŽr’¢ô½y¯â9Ùaÿ… "V”‡mEW« P•ôžñáêšMáÇ¢áÆ;B¬G- › ÞµJ?ltaÕÕ0:æÀŸC@yuo\<ܧKiñq¬@ÜÝÂVÃ[]ÕÞx£>ÒËÅ0ÜÊŒK¢r6~‹®9!IG+”Ë-‹Â_´¦¡[’–wûÅwßò´íõÃÆ#æÄDZõÜb>žn覅Œ"3ž§¯ä;(âzýÇpO_áñ˜H ýžœ¤ã“ÊN•­-ÐÛIwåÄ­Y «’´x÷™ìÕRUQ²·£¯‘±9kæŒsùDZÉGÂØZz'0lIOö¡…I‰Çaqf¶N'_»»Û¸ò¼“Ûéý~&5zã,ûKC¹Mì†O¦é7‹_¾ÿEô~_nÌ ·@Hà@üÀÐbÇHà¾äìœakk-¶v e5eÎزµîÝF©©.V–~2Ï«ŸØÌÃC*õpœÁÔ¶ù~íìû1…I¾îý¬i§†§‘7ê¹BñÓl͈)ý¤~~âA³ &‚m†8S½ÙDDÓòœ¸ñ.ÖÌÍ<[—‘¡[ŽÒð`LH $€ ÔÁ3‚Z!Ð8òÇg¥jÓîVFzvökö0 aŸÉþŒ—5''-U¤¾{37»Ýuæü›“"?p7ôíÔVƒ¡fÓG×P¯-×azþ‘H¶JZR’»/Ü…Ç$&.‚ „¢‹¼˜ÓÛ]-™Ý-¦9‰wðÍs{ýL¡{|ýúÞï>h{LH $€:BଛÖ°î“NàÉ\7í~êðÄ7¹R¥TÖñ„¶6’6ât»Ä•¼¤RÎã %÷3œFV^Fm „ð0º‡an—Ì;AH îH [¬›ÖÁ MHà !ÀXJàŸ¤ÝÓÕÈd-?TŽ+”˜zTr£Î–vv÷ÔË•ØØµßÖFãâ@H Î@÷Kçøak$ð¨gΰɆ"›˜Š{tev0êTd° $€}¨ƒýÏg€:C€g59Ðÿ9Qö‘5zR(ˆóŒ×mÄ7@Hà1"€:ø1ú0q*Hà>\—Çî¹vØ $€À£N ³ëEh%Ù§RÓO¥fþz±¢Õu’ ¤je%Å7J†íÆmùoG],‡¾ÔO&$ŸÌn¡×Ö÷6î´£[ÚªÒEÕ-ŒÜÑÞ:Z_}eûßßøâØ•&íäåÀ­ìO²©‰-¸‰@H Gž@§üÁÚòÓköÊô<ž7ÜJ¿ÕâûµCK>?Cc¾ñ0ñC,QßÎM9qøeén^â¡Tå4Ÿñt™¥¦IÓêÞ¦µMl«/F- /jØÑÇÛï™Óž£—¾ >N^ Ûú®GÃþ‡—Ó”(‰úN“Åa«‡-9MZäöð¬Ã‘@H $ðXè”ÎOMì½hëÜá½Õ²29ßÂ$­¢ªZÍ•Hø¥…E|;‡þSÖŽ N¦´-mÎ¥ÏV¥ÿ‰ÅÄ5›½‰E 7¢íÕÖȪU"Io"+*¾­±ur¶äÐöíK.³ù + ~L<”‘¸)ã1ÁRÑ€iÁ‹¼ö.¦{èàpÚê²â2™†ciïd×Ò¤›Ä·àuÙ•B™•s_1|LV¯¬Zí¦8™úòм9Q_‰Z´¶ÈúµÍQ³ÙAY3ßÒº·­¥¨SŸ»‰á° $€@Né!‹>½)Î9tàŠý¼6¶¬ÞRÜ8ýõ¿¶^¨$D8tîòÅÞý-ò¿_s¢ÂÁITT¨ð‰[vtÏQòþGÅuÆŽU»ÏShÖCß|ÿï/;»“kÒÖ/9F¦mü—eÊGQ‰„B‘@bÍWUöúþ4{Ã^εCnJéë>´4çíJ8qÝ¿ÞíCHÁÉm_ìOWÑ÷g˯•Ž ‰œàÒL©Ûyþ<Ÿ<ï=jXtðÚ«9ñ¿”¦º´ÿ»¾“ÏoßÜBEG†+:µÿ,µ ’Ð+xòšP“ò՞ijJØiçõæü…^ýuVeXšxÊ!ù­Ú>Á‰›—¶ÿèuûù«œø5™ Ÿï8‘ »Œ[4ß4hcõ­_vìÊ(¬€B¿u3êöPWwå¡%½¶dë‡V9;ÖÆ‡šþ4?7;<¾"$€@H [èT|°ýËÞÖDY’övTüiò«Èþ纭ÓÂ>Ù0Zxa÷º= Ë¸æ —IQÕ K×Mt°ÐTÝPÊn¨´P¦ô›°$"ö£U’Ê û¿Ï¤eF‰Ë5 yàÛµñ~saȺ¿‡Ì——V*j…ôY†½„KŸ³UšsgîªuÓ\ Q^úCAy ›AÛM\¾j@m©LYQ­iiÀŽT«Tä$rÉ{a3q_ššh*¯çËJòïj ´,]4ñjúÖýçˈâbôêM…ŠIA«—„„Œu°|zØHz›¿ÐkîÒ€§ùš¼³Tû­Ø¾õ«øo#LH $€xÒ tJ¾ÃÜ¨í³ÆÅ¢ô­ËbRå%y¥°QòÛOégÿ lÿ{“ªc”}?\àá:ù‰Ÿî`Ñ®/¸ÜøéÛï¾?5Hq‹7ωlœ‡¸ ¼s. |œ’q!ï@»hœF/Zíí4p°« Cç7²ÏCFúÖlç§'Î߸®É-n[»f;Z´°=髪 Ã¾Ã_êË!’ÁCûÂFY¹Ñ ‚5W~_¸½¯ß¨¾ýGùùåÅyE´ Ü '™ð)nÎ/¼D§ZUS º2tjl+ré¿§3rÿ%—¯ÜR”\2}'ücúˆ!În£¼ÝìDvÏÙÂ>‰Ë0Wá:ñ‚­Äï}¸iwI d1!$€@HàI'Ð9LéYxLZ°5b]i¿¸Dɺ\­ûÛÛ;xM[4÷½gØh "hþÄTí­cK–­:ðkíÐÑcYC{êúm)]<ôa\z±dÄ¢uþ£LVã AýMUÔF‰*î@sKÉ\ß[Qúá|Ðë.v ±­XØ®á4 _õ‰K-!¤N¿ÝðÎîhØfr|sãb­ìúÙÙ»Hç¾·(à%û&mé¦Vì,¡óvÛ_¶qUÈhw{YÞñ˜°OŠÒ&c@H $€ÒÁ¥ç8{±Tv»¨¸„‘Ÿ¼žvÎT+å<É@aûô=Ö"DuU9ìóëãl©(„xbRcä+mÔªôlôçT¤º¼6ñ™[…WŠnÝn´[·Ñh¤þ# 8uGÌ‘”m+¶Ò¨Ó©$ÿBÞ•+¿ûbyhu6¿ãa¿Ûª…m'²s¥‡d—W¤§§\èêjtÛŸ…Ãc.>ž~QQ]pö¿0A‘}_]|pijrö²‹G’© ÜÝ͸•ó{˜ËÝžó0/g{[®–ˆzSì¥'vžÈ+‘•Þ&|‡ì÷Â[·µtºc¿sÏúëûC)•º‘í´@H $€ž4ÆNÇϽ¦øçÄà ‰l;¸+îïÓDb‹ÐU_lŽÛ½1˜)¶Žñàaè_·)zfÄPaJÖþµY¡žN"YáñÿäΘÎ<½ªÁ,¨ ¹”*fBòwl¥ïÖ¯}5f˜½4£`Ѝ&¹ÎXèWº3ñlʱ¡“&xcî*c*6yÉܱ‰ÞpF„öÒ¹óýÆ „¬ÞCLZ±Rhc8±GèÒy[6íŒ ‚n%#ü?xûy:–>yø¯›Uqà@ø²PÔgZÈoX&‚Æ %Ä­cÚM\0˰@Á™½úͺOöŸØºö-ë;uÝמÿÇRÿÏ6Å'nZ‡pÂêMN_™0ôê‰ÌÏW_^óEù¯;ìßÉöàùf€³ÎIÏàëcE@#/¿YV Ç WhÝÏNÒp*uËYª~?ò÷/œßûçòé.í3P#+/«V(5®u¿~’æ?3Á·¿’¢J¥†+îç`cô¢}½"O_x€Ìú|õt£/ŸímüDÕ“å]±04.-‡÷° Ït}¢¦“EHàñ `V\ήIpŸÓQ+jjáÄb ƒ|„ð…~–çŠDm .ZS$'¨F^­mÔÉ}š¤ov;ûìÕ^ŽÎb®üÜ×Rò~k¿žÐ¿ {´ŠÛ2MOÍ•á±éfm™äÌÎ¥¶2CƒÃñMk­ºF­%|Q³¹kÕò¥˜/»U%²VZ½ätåÐå±:0ŒØV¾¿YÓhøøtÖZµZ­Õ4®¯Gõ§¾]Í277çóùB¡^!Á&Çãr¹ÇŒIZ­VäãÇϘ1ãOµ·;^žµÄ74¾ÁDŸÀ¤Ï7N§?KÜORåíšçÿEΞn÷Ó¾mîfm³ôzÜ–Ì´϶««rƒ„îqFõ£OFKÔnù® WæÅ2£É?úÔÎàѦÏ:¶†‰Wy¬T¼€l«L ºOj&ú|‹T¹B÷xâ6Sté Â/>öu<ŽøpNH <(gΜi¿¨HHHèà5¢™Ù Þà_³bPÀíìÙP“kIWÉíº¤®8¶=š®ƤS—JÛÁPQýû‘µ›R˜C' ©}¶6œ¡¦¿f/ MM/ ÌáƒOpêÇ‹R™o+~¯±"ú0Õªé@Æu8|¾ˆ:š1=¦4Eá^Žk¨ôÝ–ôOÕOŠYç;(.òÔÍå£íÚœ¶F–÷ÑsÄuêtO¶2m_­6žÞfoí­Àü°b‹ÔV;wŸÈÐ^qsª¹’¶vVH\ÈxÏ‰Ê WV «’Û΋#>a{?Ï9ù#CCÆqΞê3>XSÍÞÈÛ–1`¿,ïô‘s7ܦþŸü4Ô“üÚ™x8Ô¢wÆÃ˜ÕÝØR4 $Ðný§¶5ÃÛÜǸü«¯å²»j–ca-iŸ.¹¾±ñ“‰5*"¶µ5øYÛ –:»ŸáÚÑ/T±ðÛ;¶²†¬úHšåh_Xëq'õyÁîëó3V;3²ÐÓ[:Ösñ Y[BÇ„NQîq3òšš†Q|ÜwNˆOt¦A÷t[P_¿Àtå?¥Tà›ªÙÍí˽]æÄee]'®®P¨)JñÝB¿|ûñ[àÊu=˜SÀs›÷Ùò7bÛžûŸ2Sƒ_;'$-:óõn®ƒ-Ž©ù|}€˜©¹`@H ûèÔ}rÝ~z|KIï>6¶íÁÌt¸–Û¾OwPë@ÜÇpíBÈá[õyÚEp»`=™•4{B’`ê{¿[ÆŠ`ƒëÌõ;}!ÿÙwyð¦*: õ‹9š›u0œ 8ñð[yš¹ÇvÍt:iÛ—ø¬<(‡ú¿ òñYŸœÏö¯åYÉAR¶­4 ütÔb“ݼšÛ)Ï;è'•Fé'Bä¹p˜ø-ÞU®ï.#v±4 ¦ˆºys¶–©iêÛã;@H soÜ96Ø <"TEà %>‘ŒU05Þrê?"áíZE¼ÖÝ.ŠOK ™âî5k»¯¿¯;ÉIŠÓo>•O¦’¦âz\zzZa5»³äh¸­—/ÜõAä¶èõþiñkÆ8Š÷åéߺ””´fŠ­íȈ$âïïŠzÁ˜Ð\²”ñ]WÝo}tôú@tüôƒF65re•<ïô®ÌPáÀW³ºWu5û4ëogmh<`¬ò©?JŒ2òƒA‘³B“rÈë£#×àžvCaIšÓÏÖ«Cѳõ9o‹»¯ïàÞà)½z`Êš-9Òõ‘Ñ‘¸ç¤…ø:XÀiut#+! ØÇÌ‹‡hçmѾ$-dŠKÔiŒTܺš–´>ÏxâããÛ‡GÊOovŸšÖÛ?Pà[x£²qg†-Æ€9kÒÜý£wn ó͉ ÕÏ+œÕ£&çbhÙRƤ–½­ ÓÒBwœf’òó‰III[>ÍdE·&oÇ‚-i¤ÏSÜŽM³%° $ÐQo\DGI`}$ðȨSÔRÛo›X=AÐË ö¤%þ&öÖ=‹…øì<ÿŽ7D Çì 7'.>öûU±oM>xy'oÐ<ß…Ñ{‚t7<Ým¼[ôÉ”5xqàrÆL4ó%·~ãCç¬Ø7%‘ÞR¦‹=÷¾þM°ƒ€ºIDŽƧ]Šqó„–óË*—Û°‚5€Î:4çÌ 9±»äYR±u™2éHY¬§®“ºÊ ˆ ñÔlÓ%¸ETŸmú.ÏÚ7 T4ñ9rý‡É`.!˛ĸvt"úȓחKØñ<ܬ Ó­ÙáC²ÝCÓJª Ò_ÐâèÓW_Þyuмømñßé‚9Xì\ÎþÔ•à·½ý„#CãN~«ažäƒÌÊO<™¥ArwåÂÐaÆ,—íà&sb­‚Wy.3}ŸÈë©Ë©­ï¼=rå_|#Ö|œøVìLgýqBŒçbh çÉË;ÚÒ£e›áhiÁÎ=Sú’I‰—äïx[jÎ~é'çÔ/7'OwçüBØœqÒBó¦il æ‘@!€þàÎÐöH ;ÈQéÙ6a•a—ot4#‚¡ŽäÕ …ðöG]¹[YÇ6 ‚U%Ey¹¹ig ê´2ºþC¹L“¦è<õô“ÂsÉÉ&üîGꜿ)×í¦»Hä¹5¬†|_çð1~Fø®ä‚r7žVjœ®¥Ñé¯ÿÐ_'؉`â›s¡äÜÏ ÇI“¹4î éÑÒ²’ýüá(ù‘F§äØ’ãî?DΆÏþº}_²k¹yðÆÓl(Å@H sÐÜ9~Ø t<Öéceâ|f„•ÏäaàÔëU#y¨÷b¶9 åíë _ݽùp¶N„伇 +]û™°ú–Z:%”:`;›¸6Þ“'C'Óg¾óæ” ÷9qã?ù¡îÓé\Â3 Š“n”©¼-u®R }B¹éÄãÓyøŒ`ׄiVç~'"¶mt'kÑéØyc4è_ý8mŒ®¯ïÊÛlüHÒ<ß$£âFY¯ºÍèNF‰[3/ ¼÷ì<÷É;Þ »õíXøÌjíL¡à9w«ñÙ×á aë7™‹¾©é÷Vì|nôèøèWç[]އöU+Í!h;î\QôïáÖNÿPK¢¼Ö±iš6K‘@'€þàŽ3ÃH ›¸Œ “Ò>o¸3Mg¡&-v;dûÙ-Í×,X€ºÛJ<<ûä\½aäcÔT3-dµé^òö- Ë™åW*ëë«™[÷L×ìP©ÛëApa¤ø^=G#—Kôjœ¨?ÑÅ%^Þ¿y·ujZ-íjió]­”´=#á­)9êHEpàÉËeõõõ9;©yljst•ž©Ð ÂW@°GCu†tü=øVc”4FyKip¬²2?)ú(Ü2oäöÜ †j¬†MȨnæH%ÏõiÆFs1®i2ߊgo0%íè7{vï†xnoW‡áãÅáÝqûÀÕÍEVš glC%&s·$ïܹs¹¿ßm\lzK–ýÆGª{>#õ;’5q'tJ]“Ǭ¡áûÊ0ÝrÈÆ½8½,…Í´O3ôÓ1ÞÛR¾ý4ÕTdûFÿMêJ ¸s>XgŒêÌVFgªA‚r†S=›¶ýl ž,cHPf:ièg+8Oþ4“D]gø´Zô1|«É>üo(ñå©ó¥7ÔmW®U;_ ó!i[B"ÒÜÃ^|?úIå¬ ‡5 Š€ZmnÒMQnVFF–Ñ·“Õ° $ÐÔÁmÂÝHà‘ à½äË0­» ŸGоԌܬӻÂà>60~ý‘ho#©š1…ž|úôÁ¨€ñ dÃÞ{Ū ÝüámËê¨}É©MÕ×õoÔ£™4r\ÐÁÓ§“cþ2híüÓ÷%dÛHÛW/Ûµo×b©m(„9‰)&–©¸zàýQ£FÍùæ‚é¾T¹‹ý‚b¦ææå¥î‹7’Îîƒ&³“8¿~¤züœùQÉyy1ó»ÑÛýtº”xÎcü³ñ#­¥1û’ǴÔ}±+ý‚ö™ðñ2¶e}>Ó –%K>šzt×§{áÃ%bUÞM’Íè4¶;~Î_ÇžÎÊØ0’®»ç¿x†k“šíÝlÕN·)“Ù~æL¡ú[à@=Ä4ùÿEÐÔjs¦F“e’¿×È‘^ñ-.Š×¤>n"$€L`#ÁLïÃR$€\ç3ozF„ÎZ7g|œÎl÷À¤øÓÝÿŠîîïs力Oع„õÎìŸÛªañ³"Bç@¸Adeýr!:Åúg%¸½³3Ó|€×œ5³Æ°ýûl;ùeÔHߥ/¤îOÚµÛÿ-KˆHÚ2j­è#GÈ”)!kfyYeVŠ Á³²‡úNbsx5•ê “â¶$égGÜÃöÆ­ŸNE<“3con#S„úÆS… C}žì¾f¯–ïì)3ï?NDRȪÁ³=Å-}?¡á&–zVç:L:é?%4BuÁñ¹÷ä‘ ‹§DÄ-pwV¿Ü»¥ÑmFÏÛ¸w^Ü–Yi[Ü#Ïe/÷v˜þñõ“óÆ/ˆXàAí„gïeÞu‹tˆâƒ­ì“¤ˆyIð€VŒLJxG_£®‰îÍfyF¾UØü[¤±u}ÃÎ}¾žýÎÀã5Kã¶ìSGl@FZ±ÓfØX8¤’Hà”ŒoЄùl‰H[OWŠÐ¥Vš³k‘OÚˆ™Øt«ö= I?¾#$€š0+.W6-ëŠmmuÙ­*•­%ýkÙ­S­¬¤ì.±îogAÙ­ ~ÌŒ+ºšÕþG?~|ÆŒ®ŽF^^TV }r…ÖýtkvéFçÆŠÝøn»œä*+/׺ŒC“¯Â¹L;„––&acúQÉeJ Ñ¡ rhwÒÈÊeSÃ4’——¨¸–6#7uû:‚•ƒe•rER£Ú:ØY6±žé¤¼¨Hö‰llÚîŸÎ†¶âJ,Û®Ìtß±‰@ÿrÑq–Ëà¡%Ö€@ovK£Ëe²f‚JV.×p¹‚V>Æ>ˆÈ`>C"´lH·§Ù›JF§cÝÇgѬ3¶ ývšì “ÍMö‰…H ± $Ð".‰v™µhéÜ7_sVd$nZ“ª%ÄåÕ ­þ‹s "X[#“݆{AÔ²¢‚ü94h5w¹(ÿJAa‰áö‘V«›ØY”òÑ¢¿¾ñm>ÓúJÔ_ßX´<í­ÿ”u!ëœZõ[ËoäÉÕj…ì¶\¡‹œd­*ºQb(110!$€@H tKó³S²ó5üy>yÞ{Ô°èàµWsâ)Óïò‰ý)ů¼6Ή›±cÕî3Å´®õÐ7ßÿûËNVŠk‡>Ü”Ò×}hisCŒp⺽ Ë2œÜöÅþt% p¶üZéØÈ .E'££öŸÕÑzoX6Ð8zO]rd×ç)çói§ÙŸ¬z ¼ºÅgã·mO‘"tšöÁb{ÎÅ„D:PêÆ·‹ýÖM«ÛC}Ø•‡–üõÚ’­r/Ýs”¼ÿÑ@±æÊK#‰Ô߱컔óÐvé ÿ¾r%壦9ú¶Éߣâü޵±ÇÙòbØÖw=ty|CÝ•€¥[Pòm"h§[±»NíBH $ÐEºÄ\«ó犜GŽª(¾]£¾/«Ì¿­שFÐoÂ’ˆØVJ*/ìÿ>“VæÒ»+JsîÌ]µnš+,éQä%ll7qIøªµ¥2eEµF£-O¥"ØnâêØo>ZôQfÆÄQ³!UdÜwÂÒ›7þe0–ìÏKˆØž"ž°tÝÚE‚”ˆ=g ßñwô0`ê¢/Ù?=l$½ƒZè5wiÀÓ|¢©º¡”ÝPÑN5JÅ…Ãq?“ÑR÷>Ê”ôKU¤üô— ‚­Ç…mý棥³¡’½+E“w–Š`¿Û·~¿ñ ˜&$ðà ±©€µh"@H J Kt°ÁBn[ÃÍ㟓…ë .7~úö»ïÏе*‹Khp"“F/Zíí4p°« l´¼‘}2Ò·f;?íÅ¡KçmÙ´3.,êHFøðöóÆý×ý¸ãÀV¶¤ïˆy>.–ÄùÜÚíNÙ–BËí^ûÄÍÙÞs²Ãþ D¬(Ûê?ä• C¯žÈü|õå…1;DgÔ…° b´„?µ?d~ÈìÏâ²Ndö›¦NLaW™(ÿuçý;a?$Ï7h@&$€@H G‡@×?GC!+ÓŠ-®~ºãL…ßÚ¯'ô…¨Q(Ô"‘däÕj‘ØÂÑÔíì³W!ÆWÌ•ŸûzCJžBßjч/â›îZµü±Möš(¤pø|fx­ºFM¸"~›VStþìÝ>Îv½¸¿ÿ—xaÀ¬ÈItR­Z­Öj 6ž nµ—>G£½¤°@H $Ð*ö9ð( ¡P¯€§OÇÌÌ Zß»wOäÿûߦde«´¹óÆñ1'˜Ø§Ù#©†Äéž~ɵ·<¢ºâØöhÃS9L]*Õ57îé¯É (`Q39k¢Ð`múÕp“\“þoª¯~¿5±DW&t}mÎ+TCâðáÑ±ÍÆe÷á+@H $€ÀŸA žI02¼³¯ }{ôè:2¬Eì®–UéýÚ=pæIá|›Þ-ø}[èš?pùW_ËewÕ-ÇÂZÒ]o1aý7/Uß߯–kÑG^mLH $€@Ý‘€±öÕ«ÕjÁ … 6õ]¯ƒÁM*±±»_0|K ßø6¸ûí§‹Û‰Ä½Ûç<îâq±;$€@H ö •õZ—¾ƒO0$V"³»”?¸ý†bM$€@H $ÐU@òBüƒA³›¬†!ØÐ(dメäøƒ»j*Ø@H $€h7ðò‚Ìe}Àì+«}Yg0¼BOPŽ:¸ÝD±"@H $€À£@€Õ» …!c¬€A³ Êëêê@³³Að£ð©¢H $€@m€[âT*úT л¬?2° "˜õCt°\.·µµ…<ê`€€ $€@Hà‘'ÀårAƒ»—õƒüeÕ0»dlÖÖÖ* >ŸoiI×e@üÈä8$€@H  ª½7oÞ§/ŽTV"³»°ªèt\¯ºB¥r|eÞtO›GïcC‹‘@H t?µ •JüñÇòòrÖFˆž:uª±†òNéàÒó‡r5Ü\ûª‹?n#ýj1d¸Ë±’ü›¶=ßçÂéó„ØX©uXW ®¢&zŽõq¶¼þ}%„×€?)tI[–ñóïΣçþcp¿5ëv*oV¨÷êkáû#J$/|E3ˆ`vSöH…]BxF"¤GtŽMÌ®»}6$4ÔPè9¶ u°ªèèú-§ 8iʲ°Ñv:Á b $€À#A€‘f¬©`ÆŒ±±±ì&äa%5PɬÀ` ;u™¬)þ9ñpB"Û“pèÜ¿OÓ‰WÆóë<=د,*ñ|ú/ü‰R÷¬ÔªÖ`´ ,ã&zfÄPaJÖþµY¡žN"YáñÿäΘ.¤ýRû4òs»7íÞM7ALÏš+mÈl¾>Êàˆ™Ëú€ÙWVûÂaj8X¡üqÒÁ¼¾c·Eoã“¢OC"r ­eØÉ³îvQÄ–è¤×mÑú˜@H <)X·ša¶ÞÞÞéééÙÙÙðd矞UÀ‡1T3+.gVa0´è`F­¨Q¨U„#‹-šÄ*h« ~¹¢rpìËUî]·é*º<öC‡&•†Ó(j‘‚Ðȫբf½©Õ5ð쾨é( `îÑ$ð¿ËçḄ¥­aÕkx…k\C|0}8ó@pØ gÁ¿üò |Ÿ{4'ÚÌjMnÏ=žßèÌÄ`Ïf» <ÿ&ÎZ²w˜6® QÉ•D(p›~•Õäíâ š•·å(ƒÜ‚‘7om ºÖKA³¦J©¬ãñ„‚æ­\¦˜6æ6µ˜ÛBÃÖ Á}H $€:FàìÙ³°lp¿~ý@B€~€ôû￯X±"44ÔÅÅ<ÄPî6pÀÁ#6:µ^˜ÂT"é-i&[a—ævÎîØðð°Ek©MZز†ê\FÓŒ¥©Þø| ¨Ð¢Š†v˜M yá‘ß ^a¼ í ¯àH…TYY Çî£9ŬÖÔ™Þ!ËÛµÒÏà ~¾‹ÅBžYPTryCHˆ*c_¸ÔŒû„<ž‡‡tå®Óì΂äp¿€ y+>e»]àÿFPP_@xnê¦$Du4j­Œ‰Y] …f‹÷eékkrÆùIAS{„ûì‰'°*+@èÕÜ,ÏŠ{5Dë‹À$eìtpÑæî pŸŒ’{tev0@dEyx…BœE“ä~®:Û[÷`›&» ›òX©xAšaS—Ù›¯|ËÆ”ÅxX‡4íØ?³zÙéç’Դݼ¬Œu”ÄHû…4í60G{_~jSã`@H #ÍýÁ°³¬¬ ~muaøÍtÖq;²©'U–¶›Á>9JøšPWvùdäGÖO>xÞw—/çŸ;ÆR Üy*?ÿrNÎwƒ™P{¶°¥W¾˜Ýã}òrΑHvãÈékL†ë8'òÀ¹Ëee•ʺºë§¢™ÂøŸ®Éx|F_ûoË<ÉžÊ9âKwÿQUGJŽ~ÆŠà°½™ÊúºëçvºÓ]qQß¼Åt@ Ï“± IDATH ®"`ðø:É ×KC¹!%P‡½€*c ¿|¹k¦ÀÆÙÕ†¨êØMO¯aÎÎmøÙš ¯> ¥®•¤7 ’s–;„dùü÷ø>O͹MHïÞºêUwt‡ïø±ƒÎÑRß±#9²C‚µç™BB”µÿKÙ÷?b® “‰O<÷Å;®=uÝà@H .#¢ÂÐä!sÍ@È%$† ‚Q@aæÏ$À®7rB\DAAHáêêjøµ"N{õê5pàÀ@ŽÝ?Óʇ7¶ê`xV\Kãq}Þ=à³e©ñ t®áÈü–Óø&‚ŽÕu 1Å-u×¼š êëv²¥0/O ï7~Móš™JýØgÚÀB†ºTk\׿¦™4m™7k ›c_ «ªïÀ<@H NµÀj\¸Ëˆ`P†u¨X ²ê°ºýÁÂ;OŽE8"!j"@ï‚Ó|à ¯ØPžÎÒ­{à­›¦º”ÄŠ`÷°Ì#Ë<í$¹±~î bp-Ýf¦ÖWæžÎÈüõ|âö5Ià_M ý6{þroI“9òy÷{vóˆÎL®&ó?™žÝ·úîíQÎÜ›É^޾M£…›ŒM7-x¸“4¨è¾íȧϑZºh¸¹¹Ô™;tÐMm¢w,BH $М¨Û¢¢"³ù QÉ* ¬®`ïA‚jp/>4À÷É57K@c7òƒ%N@áÉþ~QSSyPÀì+¸†%NŽ?.‘HØ»èààfÝ`ûƒ<4oÜ7(g¥6삃ž]˜òÆm›´ÂM$€@¸ÒÁµ’U~‡Ôm'Â.Ù`-\âÁ`ö C ›˜ %Pn(d+Càr†ò63_}õÕýzŒÚì+ Ž€#{!Âp‡Ûš=+Œ{‚Ÿ9@4³'³áÜ`õ®¡2”CZ±¯pbÀ’Ù¿ÿv¶GÞ%ás9WXÇ7SZp4ü¦g—ñX˜GH $ðhß®åªëyÕÚwê{rTýœî ñªq¼ðGHL¸z.Ýd^p¥! †ÁÅòàÇ…7ÐýCìÕœ5ØøÊyc}Ì^ë¡<ÁêàŽÃú2†õ±›èàVlðåË—~_žÒ󪢗¼¿Åè×­Ýœ-zZrë9fN&¦Ç=bvÏŒKêïiëá\$ ¹°‹À7ÓzPÔf=@Só8õfZ¢Ñ‚¶Öb}äƒÇž/ø÷ÿvÏëEózm­ÑÜS+ë/_­>•~çâIEîÿ”3|ë_x‘Þ•j¸•‹æÃÜú••°0(¨XH …!ñ 7oÞSáÞ!ð ·iÛ 4‡pˆ6+7©ÐvïMà&øs À×DÁpz´Ç ˆ‚(..N;yáÄ««ÄæŽ#oü«OMpï)q=Ì8Ü uµZžtî½zõ½zøÛPßÃŒv _˜I=} ‡þC}­L ž„3c}äƒÇž/ø÷ÿvÛë…ö^=\ÔêµÄÎΜkË?˜\V]#¨M¯êÛ_=ÈÕâeY_R{.£´#ƒé £©†«.›à·_XE n gÃ&Ûc4…ОšÆuPÓÀüŸLà‡~øöÛoá”'.œ¥¦L™òÖ[oÁYa° ¾&±:Ø¸Ý '@jjê_þòvÎ+‡¸xñâ¹_{\1³«zF@$<ž÷^¸1Ôõ„CêÍ{˜©ézà¦Þ_¸´ÃšmRã®'=8ZøOU2uÃ/6f„þlƒõ‘x¾àßü{Ø-¯p¼§%u÷àÌz¹†ÔŠùÄŽ¯–ß;WÃùá|•‹sˆËvú’ WÞ”Ë4µÖ(Áu¶àõ£`)ÈÀMDPÂÚ:"€á©[ML‚ 3hPMÊÛÜDÜ&"¬ðÀ ÀáËŽ÷?þÏÎ`7!VxêÔ©Mô.lÂ2(Cܤ<##44_hÍáD‚ûí ýñÇï>Sõ´9±á1çw‰›ªÞª¾‡ˆ×bà;sÖL­í¡½§ÕÜlVwÏŒ§Û=Â1ëÁí¯¤Ñ7ƒ¯×pÓ5´ë#<ð|Á¿ø÷°›^/8õ=ê´Z¸´Õjëk4¤H®%V<¯'³s¥Ü@•н½É5”½ì>äW¸¬Bbe08ƒY0¼B!È_¸Ðƒ†U¤à¢Ú•Âp¡O–õöö6¶š@µû˜ê`cŒ˜ÿP©w÷Â7<8¸cccY; g܆ P?è€ß÷îÝ»p†ÀÉ » .~ÿþýW®\šPN!8©À£ "6!Z¨Ä¼›“^àßÃnz½ò¸Ê:­²V[¢ªûCuÔÕét0—ÜPXÂõ®›°"“ñ…•½æ>üW¸X®Ú s!U œëð<p]ÃÕ Ùp¸Ðƒ³ tBzzú›o¾éàà%àf× †:êàŽÃú]L€ý"hè¾áÁÁ ÑñÏ?ÿ<ú°‹¸l8%àT#¾#Â^{øòË/ Í!cXkÔ+œê ˜ëňˆ bžm/s{±°·€×þñàA~ÒSx<Áê:ø©‡Z{×ÃLߦy©ç@ 1½CŽ˜s8µõ¹¯­ƒ˜«{õXùàñ€ç þ}À¿‡ÝôzуÔÖs”ª:Qݽ^wUuµfUj³Ûæõ„ 7‚ƒ*®‰ ®¤Æ—Î?%®ïp±f=ÁpMg/÷° ‚Iàöb¥-d A 8¹XSA'@š?þ!C $˜Ñ}Ä{ þS>z´VìŠàÜ3g΄sƒÝe\Î 8Ðá á ÷ôô =xð`aa!Ûh_8`/œ`pŸœB½„eBkbÁë×Ó¼·¥°·_,àö4§—Ï!"Ÿª'ÚZ1 qÃðô XKÃ…èaBã"àò= ,˜h5<ø»>g¬|ðxÀóÿ>àßÃîy½€ÛÈÕuDÁç Tu ÔÕªb.\Ú4¥¤ÇSš»pa… (¤î ƒábÍJa¸d³‰êYFÃ+\Óá7a¸âÃ.ÈC d fƒ³ t‚££#”:y´D;3nÐÎ~±¸oð3|ÃŽxöà†£Û!œàL`U2d\\\–-[öË/¿@ØÄ±§ÛjZ[[÷+½Y&𬠇XhÞË‚kmŵä¡9áƒä定há~ ¢†eÑꩆàær„CÀÚ=xâààÇ­†@¾¦ë#<ð|Á¿ø÷°›^/zpéMrB%‡# —1%ÏŒKïh¸W«á ´”Á T3¾¤û¾LwUC¸²ÃE.ô¥ %l|0ø­Á“+¥Âu†ƒ ¬ €úpï„MÂ/Ƭ `uëQf+wÈ<ÔÁÂ…•8ÖÙŸ9 "F…BH£ýì 眰kôèÑpV>|öB!$h‘õð•Ñ5ïì ù•ž6Ãżb_$ =-ˆˆOÌyÄ~P] W7Ø2Þ_/2ëA̹vRg0¡wËQ7°–ªŸ:-ÖG>x<àù‚ðï!½@tÃëX:˜cNî)!×nî®S×ÕÖÙ+ÿ7ÎV §`ƒƒá*ù0®èmÁšq¸”C2ì¥t0D?8¬…>Ø]°V‘‚»áÁO % :t0$m Øt?êà¦Dpû!0Ćq!àÝp&@ƇšP¾Å6ÑÁp&°m!‚]d š°%°ËÃÃÖ ”fWþaα·¾À…3…Ç'BMmÕ4ð ¿órµŒ‡–T?1Œ^aè»ýc‹±@xU†p˜Ð¬|ðxÀóÿ>àßCn·¼^pèJ Ôa¯„0ÕœºDP™çn^ôüG‰D—Q†ka¯ï†ë5dØ :x‚!¸wïÞ 0–¶°·ÉUžJ&ÁŒ ÁÔ::Ž6Ð䥦ZŽ™Ø§ô¿§þè?Áë鎎×Åõ5·Nì=L†OõäæÉ®›0kêScºâÆ-9±qêoadŸ¦ô¿ß%_ynú¬á}›.SgT ³%°¡ öh†{àØ ûõŽl¨"˜ÕÁà†ö•Ý'ÔgOÃ+[ç<›qܸquu'.–üX}£ÂÁƒ÷ìP™¯ŽúwÁÙ Î`¸E¢© (Jêùô§®{ Žáx…áér° :|Åõô·`(ÇúÈ<_ðïþ=ìž×‹z sE«%µµänyµª8ÏìKÃø·Gvzæ™g`©%¸¤ÂåÕpåý3p¥6\ßÁ$¸ÊƒȸÊ4ü¾¬y-]å =@5ÈC«ŽN§c²ñöéõ¯Ìî•}ÃaÙ𱃎þþ⥯Žýûë›ÎǼ=®a67ž¼åïÞ«£vÜg}Õ¨¥—Äx­®Ý¼b)òêÔ§zÞOO¿0}#ùîºò#!¬.;¿dÕÒU#_E|?LÛ݆=ô~¸'.(ZH°òppCö¼eëÃ+[ÈVke4øvøÜsÏA…>¿þZ\|C~íRÍo5×Ôðô fY`½/¹•p@H GŽ\þÄBá3½zÁ#Ùœœ9:Rg0(E¸üAêÓ1¨X°~ fÜç¿îBL#ÜÞÃ^÷[1z`3'Nh¥~ó]ÓÁ%—ÿKÈù]ðŒ‘¢9q¦Ö€'Í(é´€ÍëW‹UDôô³ÏZQª¦ªBF«žà[Sݾ#ô²± Ù;5šž´°yR]î?â»—ÿUp诺ášôÙsÀ¢™d«œ<;a!ß¶Ç^s§\E„½{^n°ÇyöùïÆ‘Wã Å` KÁô ÀQ Ã*¿ á] 'øqá†W6ç-TcWKWˆ‚ÐÇ ~ëÖÁuàÞ;8£JJJ`U5øÁ ¡-û ÍÛì¤õ!p/@H nE®kp™ƒk(¸TÅb1ÜpÖ³gOˆµ½×¾nb*X‰5‰Á`üŠ wÂýp­olЉA'´§•¡ŽÙ/_Ãf@H $€À“@àƒÓÌþsæ·'aª8G$€@H $` PøÿÛ;ó¸Óö_­N‹ QRIY*%ËÈR¨0bŠiPM²„7¢,Yd—L1H Æ!k¯ì~ãûiR2ci?õœó¿ë~Nç´âÓ;3¯>Ÿûù|êÜ繗뺾×õÇuîç~îûÞ <]äS™W©E ”%@ P”%@ P”ÀßM@€+*þnt|J€ (J€ (JàS# À3F>5¨>”%@ P”%@ P”ÀßMóàOb¹¿Ûο$ïá+¾¹Uk²Á½ê# ).ækë‰êß§ïí³»eF6mõêoQßÐô>%@ P”%@ Pÿ̃\ÁôbûD´´äv̦çK¼”‡Ù}€ ïK«'.D¡÷´- üŒEe[¿Í1·±=î8ÏßÞÓDû£Èàä*8±0B/t³ º+7yfrïus--íõÙǺU®W´Äÿe·Ž\;k1Ÿ•ëZõ¶ƒÕ/ }u«MÝÿ~!f.q7¹&²˜ËËsj˜ßsSIöÏë’®bç5)«øbîu˜àa­ÇäœXœ+–x@ ¤nÆ÷’~º5höVWAúb³wèö%£ T.SÄ@9׸ZÔuûukä]x:ÏËyJôÉÍnUgÅ^ŽÛŽq;cÈó;CÜЏ5Õ‰æÙ÷ûÍúèïÞ~&mY>ÞXMJÍIÿQ”%@ P”@“%ðÁ<˜¼F§Êƒñ f6YÛ[,OŒv–¼-ã‘™yvç‰#g™Š{W“ÄÝcc·Åey~fñæä‚u™á»Nte}\Ê`ªJ»ÉŽmx”´â¿µ;À‹‚øóÆy`gãhBû‰¾´jùð÷å铽m™Š—7rXw`Cá¡°È C~þêæê©wlÜÝåÅÉÈ%©ïp¨¼ôÍk3ìbR–‹ó2&‡Žn‘p¶‡.ʹ•“™ùîñ‘ãà¹Æ\‡e%3d†er·ÍŒ´ýöÀB;þù¨Q§KÅ­çw5G)ƒ*¥„Ýþ[éäí£z ±VéiAK§ÍZ3×ýˆ¥Ö|æÕ팛í–Çìín(zyDUæ?ß6ui‡o̱Ӿ¶Û3xwÛͶâUi¿ìâtÿT\s~êfðàÂÅV}ƒ«ÿÐhí¿ý„¥Iéa¯QW3‡yv0/2Žœ€ˆ„”‡G­Íx–ìmþ1dš+ï6kߥpɹû}|J>òÞÚKÄýìaª»^i6fÆ*¯ñ ¬áéüÂVÊÅo/ÏEw'œèO¶L%Îež_Óü¤ÉŽW·$i͉90T,)Âó_–¼,ÁàaåRIIöU`À’qX|ì–œàÐg¼–Çîõø1 ðz¶Ç “?Ñe®ÛÓÂ5oúMX똲ɤvÔÅ;úL7?±uLìF-yaMV}G†C̲đ]LYö©"nó2êÆ Sp;íŒxNÌÞÄ3ã.fŽôQE‚(J€ (J ‰Èj=ö®eÎÂ{|¼­x¾-Çé`V¦oÑb#v›/õÚ_›Tarˆ2™ÏTž4¸£óÄšaË?žßƒžÖÍ…ЮƒHðøè*q2.£RÞae˜ Ë™L“$ÊØLÆ70m–uåô•;—ÀfÞa*JÌÆÅ ´n!ÍnmÞ3ùîÀÈ;Ë3íØbå2¶ø·”Óý| øïÁ쳉õª¨«˜ÅuËG·ædÃĘÔ6|"Q!Z’Ÿy¾ðµk¹¾U7Ç´2|Œ_G ËÓ73j‹xX«Â£gÖ6çιÔ8Ul ¨-àÇþý D¨XUY’}2¾Xo×{: ž!O´Fô‡¨ÿËŸdx'¿o?‹¼Ì¯uϧøzùWüdúæºÙ·Î½{ 'ÍŠ"ðݰÀZ_œcäh&Õ}$ýÊÜÎÌŦ¥ý9Ú6ë—ø¡ãàZbgM×+ —ñH¬ð‹ga—)±¼~|™¸[ÝmmϹ»$ûZ-óKüõ®\@m] D<WãÖ}Ü€2J×HþÎæB¦Â¿öï§'bÌ- ´¸¼B]ziû^2¹… J¯ub±4Óo¡«2¨Å ´uQ1=Cÿ½ŒQÄ­ú˜Ao.›3Ì@Ä4Çör•ë•(è'%@ P”%@ 4mžÆ„Sg„1g`ßäÜ-mÇʵ¬FÄl4=õâىÃWïŸi‚ë%0WÆ“ñ“¤Odn{‘¾Ò·€{ ™N9“£›J`佪;os΃å|#¶ r‚C–œ1»“=ä“ü›‰MòmVÎÍTËHÊ4€<|gI2$"U:"\ªLÆÆ?¾œH,ƒ®A¢Þ%xlØ{Îiþ-®ŠLr3¥ØKƒ¨‡ú*¯-­PÊUjŽŸ©ac®ØÏЯ‹Yò †3dæ8¯‰s¬œùŠ2Ë 9ºŠ]98턬¾õ6­\îîëÕüTâùcâôáÞÁ8Ký±d·êß6ó§÷2¨à¢ÕrgÖ5+Uýh2•9~ «2®uÉLïëdX© g–¹%1*Ó a¹´a^ßðD—)5/ÍÏýîV:·Žù Âì›{ÂPi/÷›„ eü€ÂÕ謟6(©J9¹ïË‹_ôµëÙËXÛ¾šF|5Q‡Á¦ìë°"Š‘çš¨§"nÕÆ `âMNn¸U¡ J€ (J€hÚp>“Àú/–§¿=|öÖ´ƒ¾ôuÖÐlÉë?4L» ÙôŸ€-RsL[XòNÉlÈ‹U•kЮ|qÉ=Þ(7e@€œÔ*…±8³X!)“1¢²¢'ǦFÀ°+Vú¦r7¿_‡aA½mÛÿv Š+p®—Ìâ¾Ç™C,0\¾‘µDÿ”¾jhËSsv‚]ˆŒµwuØ—þ/ûZE®eƒ‹_¡LY)ØøÄt I¾làd€ã$¤FóÎ!úäe׿9áñY§¨“‚â*Šr¤eÕ4(Ͻœ ¾î’Œ(Â\QVùcm'y0—`‘² µMg¹÷û'Sqæ­ øÌ“ÇØÑ[³÷xÀÆiFšŽÖ¯„a+‚pJY&S’•þÛ°Iá-НaJÇ!åÌÁ”ˆ>–ŒJ¤^÷inK¢¢ÚŽŒ2æ+5)Ǿˆ‘22nw´‚¬«÷Þ÷îÙ®Ã>ËR¯»Oq®xöëøWµ· :ö„oN>aßòÍ•=Ùà'g&u̇Ö6.wẳ…³fyaO_&yäÖÓ¡-R7ÇrNd¹5 MSØ(0µï±ùL¨cg}ü%$%ÜjGLÎÍY™HR—þ+áÞöDv\ÜÖ3Ä­J¹5¼¯Œ`úI P”%@ PMšÀ‡ö‹à™}æî›ÌYé¶Ã„Çæ^‹Œ'o9™z,4Æ e)æb\¸@æÍÉN XÀ÷É0©äµ´xú«„o¼&ºà;j,ƒ¹‰’Ë3‚£crß]WF»w%¹—Öà †VŸÃŽo&§‚“›ë‹}!íYÈAçÿHJÂs’æôýzç¦E¡ÆÞ~®p©B*cÛºÍò¹8Ãg ŽêݳŸSˆzZ–¾‹ü¬ÚÜ=n®›ÀI`–g6y弤ųõãåJÈàøp¾¦¶¥ã(˜7oòÓYÑsð=<î´ýÜ­Ýú@°uu2ÏZµåTtˆå{Ð&Rðù9ÉÙ”eåøEÎñÞAúø&®®®0¶ëÐÆº9Q±öl_ý÷öoŒ¨³çˆˆˆÑ©ààÒ¯]Ê71¶ Á¸™ÍAåyÚøSácÉTK½[9 0…sîý¬pT4÷ì†ÈøóXxø…ÏÊÜÚé¾»·g÷Þ!ŽûÌL\¦y_䃕í‚Ö­Ó&„Æý|úíZ6þVá-BXù¸ÐaƒË´°ÐTÒË?êƒÕ`ˆœt\< ›¸€äÁÊ@R’$–yfþ+gmZì›Bz÷^¼+¼UµÆŠ¨cµÐ;Yk=pð:¬Â:O±Â7/pë´þ•q[OÌ(<ÈòtÑt«ÊJ"˜^”%@ P”%ÐÔ `j¡»÷ç›!•”ábJ‘X[¨x³ äRœnM-UR[Ϭ¤°ô›‰¡üùþ)¡–kRú´i  îÏ&bŸž» Öïõ&ûJ ?Ê”–3|-\OZûªx÷š5×äCþ•‘ç{D/ äšHÉÓl‘Pñ¥v§êßÙâw%:†ú<ÜØæó«mlPÿ¶Õ««Êø œ¯©4_q¥…hS!­]UÕQQÂîRª3¡vKõßk“Aþ $@*ʵ^ø¯É¨×Cy—-+*áëè#ùº—´\Zâì՘Ϣæ<¡XA_‘“‚X³FŸ®<ü“IDATºW¿ÃT”³B-qÝP5RÅL]Vòr «]ÕþccFÕƒ(J€ (J  –¿úÐú`…uŸæD6¯ ½€Ç#opUMTr7Õý+¿°ï ©i3pZpï6UÖn­Æ^”µWSU»7B²†º® uZª»Q— È&ªGú_“Q§FÕ= Mn•¯:{xB²ô¶fM]ó5ØLå#ž¦@U®’Ò@ Tª>U1S—•PSWªÆXøè˜©Þ‰–)J€ (J ©Àù7Íñ‡›ªúToJ€ (J€ (J QtØ7|ß¾Q}i'J€ (J€ (J  à–ÀMX}ª:%@ P”%@ P”%иù®››[#:Ò.”%@ P”%@ P”@Ó%àçç÷ÿ„;Vž®7ÎRIEND®B`‚mock-1.0.1/html/_static/searchfield_leftcap.png0000644000076500001200000000152711532040043022215 0ustar michaeladmin00000000000000‰PNG  IHDRŒ-µgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe<éIDATxÚŒT]KbQÝ÷zÓ4?’Ô­¤$m*òm`æ-‘©‡C†`Þü!Ã0¯ó0à/0pþ@öAM ‰`e‘E%–³×fn˜ÙŒî=÷Ü}Î:kï½öVêõ:5ŽÕÕUåääÄÃÏl¥Rù|uu¾½½5©ªJŠ¢Ðÿ†¢f³YåòòÒ‘Ïç?2ЧÓv¹\šÝn§ÎÎN2 íf2åôô4P(~X,–·###šÛí&›Í&`š¦ X;€^öb±øÝëõ¾%ÇC]]]ÔÑÑApµ]wpeeE=::úÀŒÞ…B!êíí%fIì>-//Óîî.qÈï÷ì‘H„zzz^ŸÏ¯—"\o>¤ëR¿°ñb¥qÁ @B 4ËåèåDiÌÈÀÙo«ý`>·G—}È—ÁIEND®B`‚mock-1.0.1/html/_static/searchfield_repeat.png0000644000076500001200000000023611532040043022053 0ustar michaeladmin00000000000000‰PNG  IHDR5^KMgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe<0IDATxÚb,//g```<~ü8ˆúøñ#ˆúÿÿ?bbZP,Xnݺ¤ ¥<~áE§IEND®B`‚mock-1.0.1/html/_static/searchfield_rightcap.png0000644000076500001200000000102211532040043022366 0ustar michaeladmin00000000000000‰PNG  IHDR ©ëœîgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe<¤IDATxÚ|’ÏjÂ@Æ'ñ¢B<ˆz©xòÐs¡ø"ˆ·ÒsŸAJ£½õ E„ö =ØC…^r¨E‚ˆ‰hcŒM4Év&˜ µÍÀ²»ìo¿Ùù¸z½þ‹Å¤d2ù’J¥Z¹\î-“ɨ¥RɆƒàºÝ.3 V«•=ŸÏ—Ÿ‚ ´ …Â]¹\þòA<`–eÁš¦¢(l8:›Íæ9ŸÏ_Öj5ÍmÛfŽãÝnº®ƒ,Ë0 ìÙlöˆÊW•JEçÝØO@ê¨(Š–ªª·Åbñƽ -fq•Çã1ôz½e:>çáWp¡Pâñ8d³YÀw øÑ‹#ЃÃá0$ ÀrÑ?Nÿ½ˆD"€¥¢Ùü$Užçé \4U Þ+OAªÀv»µq~çƒ jvk‰ë@EÓ4ûßÂr©tó(P‰aJ6äf³yFêü_)©3‹ÅÂ$é×¢wà«Ð@±Édbu:§F£qBi¸î!×`*2ƒƒfPláþ-6õKÕï÷]ã®×k ðŠÀ=Ö¯]­VõÃ'ý0W5/$¥ª—ÄIEND®B`‚mock-1.0.1/html/_static/searchtools.js0000644000076500001200000003725312046030515020435 0ustar michaeladmin00000000000000/* * searchtools.js_t * ~~~~~~~~~~~~~~~~ * * Sphinx JavaScript utilties for the full-text search. * * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /** * helper function to return a node containing the * search summary for a given text. keywords is a list * of stemmed words, hlwords is the list of normal, unstemmed * words. the first one is used to find the occurance, the * latter for highlighting it. */ jQuery.makeSearchSummary = function(text, keywords, hlwords) { var textLower = text.toLowerCase(); var start = 0; $.each(keywords, function() { var i = textLower.indexOf(this.toLowerCase()); if (i > -1) start = i; }); start = Math.max(start - 120, 0); var excerpt = ((start > 0) ? '...' : '') + $.trim(text.substr(start, 240)) + ((start + 240 - text.length) ? '...' : ''); var rv = $('
').text(excerpt); $.each(hlwords, function() { rv = rv.highlightText(this, 'highlighted'); }); return rv; } /** * Porter Stemmer */ var Stemmer = function() { var step2list = { ational: 'ate', tional: 'tion', enci: 'ence', anci: 'ance', izer: 'ize', bli: 'ble', alli: 'al', entli: 'ent', eli: 'e', ousli: 'ous', ization: 'ize', ation: 'ate', ator: 'ate', alism: 'al', iveness: 'ive', fulness: 'ful', ousness: 'ous', aliti: 'al', iviti: 'ive', biliti: 'ble', logi: 'log' }; var step3list = { icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: '' }; var c = "[^aeiou]"; // consonant var v = "[aeiouy]"; // vowel var C = c + "[^aeiouy]*"; // consonant sequence var V = v + "[aeiou]*"; // vowel sequence var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 var s_v = "^(" + C + ")?" + v; // vowel in stem this.stemWord = function (w) { var stem; var suffix; var firstch; var origword = w; if (w.length < 3) return w; var re; var re2; var re3; var re4; firstch = w.substr(0,1); if (firstch == "y") w = firstch.toUpperCase() + w.substr(1); // Step 1a re = /^(.+?)(ss|i)es$/; re2 = /^(.+?)([^s])s$/; if (re.test(w)) w = w.replace(re,"$1$2"); else if (re2.test(w)) w = w.replace(re2,"$1$2"); // Step 1b re = /^(.+?)eed$/; re2 = /^(.+?)(ed|ing)$/; if (re.test(w)) { var fp = re.exec(w); re = new RegExp(mgr0); if (re.test(fp[1])) { re = /.$/; w = w.replace(re,""); } } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1]; re2 = new RegExp(s_v); if (re2.test(stem)) { w = stem; re2 = /(at|bl|iz)$/; re3 = new RegExp("([^aeiouylsz])\\1$"); re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re2.test(w)) w = w + "e"; else if (re3.test(w)) { re = /.$/; w = w.replace(re,""); } else if (re4.test(w)) w = w + "e"; } } // Step 1c re = /^(.+?)y$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(s_v); if (re.test(stem)) w = stem + "i"; } // Step 2 re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step2list[suffix]; } // Step 3 re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step3list[suffix]; } // Step 4 re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; re2 = /^(.+?)(s|t)(ion)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); if (re.test(stem)) w = stem; } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1] + fp[2]; re2 = new RegExp(mgr1); if (re2.test(stem)) w = stem; } // Step 5 re = /^(.+?)e$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); re2 = new RegExp(meq1); re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) w = stem; } re = /ll$/; re2 = new RegExp(mgr1); if (re.test(w) && re2.test(w)) { re = /.$/; w = w.replace(re,""); } // and turn initial Y back to y if (firstch == "y") w = firstch.toLowerCase() + w.substr(1); return w; } } /** * Search Module */ var Search = { _index : null, _queued_query : null, _pulse_status : -1, init : function() { var params = $.getQueryParameters(); if (params.q) { var query = params.q[0]; $('input[name="q"]')[0].value = query; this.performSearch(query); } }, loadIndex : function(url) { $.ajax({type: "GET", url: url, data: null, success: null, dataType: "script", cache: true}); }, setIndex : function(index) { var q; this._index = index; if ((q = this._queued_query) !== null) { this._queued_query = null; Search.query(q); } }, hasIndex : function() { return this._index !== null; }, deferQuery : function(query) { this._queued_query = query; }, stopPulse : function() { this._pulse_status = 0; }, startPulse : function() { if (this._pulse_status >= 0) return; function pulse() { Search._pulse_status = (Search._pulse_status + 1) % 4; var dotString = ''; for (var i = 0; i < Search._pulse_status; i++) dotString += '.'; Search.dots.text(dotString); if (Search._pulse_status > -1) window.setTimeout(pulse, 500); }; pulse(); }, /** * perform a search for something */ performSearch : function(query) { // create the required interface elements this.out = $('#search-results'); this.title = $('

' + _('Searching') + '

').appendTo(this.out); this.dots = $('').appendTo(this.title); this.status = $('

').appendTo(this.out); this.output = $('