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

Unified Diff: build/android/pylib/utils/mock_calls_test.py

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/utils/mock_calls.py ('k') | build/android/setup.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/utils/mock_calls_test.py
diff --git a/build/android/pylib/utils/mock_calls_test.py b/build/android/pylib/utils/mock_calls_test.py
index 1b474afd1ea1707910b1716170ec0f65c1c87e17..4dbafd4715d1a55d8aa98d6bdb333755a1c89c62 100755
--- a/build/android/pylib/utils/mock_calls_test.py
+++ b/build/android/pylib/utils/mock_calls_test.py
@@ -38,6 +38,11 @@ class _DummyAdb(object):
def Reboot(self):
logging.debug('(device %s) rebooted!', self)
+ @property
+ def build_version_sdk(self):
+ logging.debug('(device %s) getting build_version_sdk', self)
+ return constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP
+
class TestCaseWithAssertCallsTest(mock_calls.TestCase):
def setUp(self):
@@ -91,6 +96,17 @@ class TestCaseWithAssertCallsTest(mock_calls.TestCase):
with self.assertRaises(ValueError):
self.adb.Shell('echo hello')
+ def testPatchCall_property(self):
+ self.assertEquals(constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP,
+ self.adb.build_version_sdk)
+ with self.patch_call(
+ self.call.adb.build_version_sdk,
+ return_value=constants.ANDROID_SDK_VERSION_CODES.KITKAT):
+ self.assertEquals(constants.ANDROID_SDK_VERSION_CODES.KITKAT,
+ self.adb.build_version_sdk)
+ self.assertEquals(constants.ANDROID_SDK_VERSION_CODES.LOLLIPOP,
+ self.adb.build_version_sdk)
+
def testAssertCalls_succeeds_simple(self):
self.assertEquals(42, self.get_answer())
with self.assertCall(self.call.get_answer(), 123):
« no previous file with comments | « build/android/pylib/utils/mock_calls.py ('k') | build/android/setup.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698