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