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

Unified Diff: build/android/devil/android/decorators_test.py

Issue 1340603002: DeviceUtils: Make Install and PushChangedFiles respect instance retries / timeout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: min->max Created 5 years, 3 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/devil/android/decorators.py ('k') | build/android/devil/android/device_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil/android/decorators_test.py
diff --git a/build/android/devil/android/decorators_test.py b/build/android/devil/android/decorators_test.py
index 66f6d927fc84026dc279bdb7742d1a2ad72d0ba9..1b6179e640883db22c029a4099685703c2c3ff0b 100644
--- a/build/android/devil/android/decorators_test.py
+++ b/build/android/devil/android/decorators_test.py
@@ -223,6 +223,11 @@ class DecoratorsTest(unittest.TestCase):
return timeout
@decorators.WithTimeoutAndRetriesFromInstance(
+ 'default_timeout', 'default_retries', min_default_timeout=100)
+ def alwaysReturnsTimeoutWithMin(self, timeout=None, retries=None):
+ return timeout
+
+ @decorators.WithTimeoutAndRetriesFromInstance(
'default_timeout', 'default_retries')
def alwaysReturnsRetries(self, timeout=None, retries=None):
return retries
@@ -271,6 +276,12 @@ class DecoratorsTest(unittest.TestCase):
self.assertEquals(31, test_obj.alwaysReturnsRetries())
self.assertEquals(32, test_obj.alwaysReturnsRetries(retries=32))
+ def testMethodDecoratorUsesMiniumumTimeout(self):
+ test_obj = self._MethodDecoratorTestObject(
+ self, default_timeout=42, default_retries=31)
+ self.assertEquals(100, test_obj.alwaysReturnsTimeoutWithMin())
+ self.assertEquals(41, test_obj.alwaysReturnsTimeoutWithMin(timeout=41))
+
def testMethodDecoratorTranslatesReraiserExceptions(self):
test_obj = self._MethodDecoratorTestObject(self)
« no previous file with comments | « build/android/devil/android/decorators.py ('k') | build/android/devil/android/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698