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): |