Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: tools/telemetry/third_party/mock/mock.py

Issue 910093002: telemetry: Add python mock library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment from dtu. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/telemetry/third_party/mock/README.chromium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # mock.py 1 # mock.py
2 # Test tools for mocking and patching. 2 # Test tools for mocking and patching.
3 # Copyright (C) 2007-2012 Michael Foord & the mock team 3 # Copyright (C) 2007-2012 Michael Foord & the mock team
4 # E-mail: fuzzyman AT voidspace DOT org DOT uk 4 # E-mail: fuzzyman AT voidspace DOT org DOT uk
5 5
6 # mock 1.0 6 # mock 1.0
7 # http://www.voidspace.org.uk/python/mock/ 7 # http://www.voidspace.org.uk/python/mock/
8 8
9 # Released subject to the BSD License 9 # Released subject to the BSD License
10 # Please see http://www.voidspace.org.uk/python/license.shtml 10 # Please see http://www.voidspace.org.uk/python/license.shtml
(...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 Fetching a `PropertyMock` instance from an object calls the mock, with 2358 Fetching a `PropertyMock` instance from an object calls the mock, with
2359 no args. Setting it calls the mock with the value being set. 2359 no args. Setting it calls the mock with the value being set.
2360 """ 2360 """
2361 def _get_child_mock(self, **kwargs): 2361 def _get_child_mock(self, **kwargs):
2362 return MagicMock(**kwargs) 2362 return MagicMock(**kwargs)
2363 2363
2364 def __get__(self, obj, obj_type): 2364 def __get__(self, obj, obj_type):
2365 return self() 2365 return self()
2366 def __set__(self, obj, val): 2366 def __set__(self, obj, val):
2367 self(val) 2367 self(val)
OLDNEW
« no previous file with comments | « tools/telemetry/third_party/mock/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698