Commit 7d9d9233 authored by Mun Yong Jang's avatar Mun Yong Jang Committed by Commit Bot

[depot_tools] Add mock lib

Bug:
Change-Id: I1c02188625a42af974744d0c27905f879963b0d2
Reviewed-on: https://chromium-review.googlesource.com/783878Reviewed-by: 's avatarNodir Turakulov <nodir@chromium.org>
Commit-Queue: Mun Yong Jang <myjang@google.com>
parent 049f076a
Copyright (c) 2003-2012, Michael Foord
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
Name: mock
URL: http://www.voidspace.org.uk/python/mock/
Version: 1.0.0
License: BSD
License File: LICENSE.txt
Description:
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 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 patch() decorator that handles patching module and
class level attributes within the scope of a test, along with sentinel for
creating unique objects. 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.
Modifications:
None.
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment