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

Unified Diff: build/android/pylib/instrumentation/instrumentation_test_instance_test.py

Issue 2124043002: [Android] Fix support for multiple instances of value annotation filters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +test Created 4 years, 5 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/instrumentation/instrumentation_test_instance.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/instrumentation_test_instance_test.py
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py b/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
index 85d4e41feb2461b83cae2f0fa18effe93dce258c..666e89239897dadfba8156fe4ee80925f1062192 100755
--- a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
@@ -287,7 +287,7 @@ class InstrumentationTestInstanceTest(unittest.TestCase):
},
]
- o._annotations = {'SmallTest': None}
+ o._annotations = [('SmallTest', None)]
with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle',
return_value=raw_tests):
actual_tests = o.GetTests()
@@ -334,7 +334,7 @@ class InstrumentationTestInstanceTest(unittest.TestCase):
},
]
- o._excluded_annotations = {'SmallTest': None}
+ o._excluded_annotations = [('SmallTest', None)]
with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle',
return_value=raw_tests):
actual_tests = o.GetTests()
@@ -391,7 +391,7 @@ class InstrumentationTestInstanceTest(unittest.TestCase):
},
]
- o._annotations = {'TestValue': '1'}
+ o._annotations = [('TestValue', '1')]
with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle',
return_value=raw_tests):
actual_tests = o.GetTests()
@@ -438,7 +438,65 @@ class InstrumentationTestInstanceTest(unittest.TestCase):
},
]
- o._annotations = {'Feature': 'Bar'}
+ o._annotations = [('Feature', 'Bar')]
+ with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle',
+ return_value=raw_tests):
+ actual_tests = o.GetTests()
+
+ self.assertEquals(actual_tests, expected_tests)
+
+ def testGetTests_multipleAnnotationValuesRequested(self):
+ o = self.createTestInstance()
+ raw_tests = [
+ {
+ 'annotations': {'Feature': {'value': ['Foo']}},
+ 'class': 'org.chromium.test.SampleTest',
+ 'methods': [
+ {
+ 'annotations': {'SmallTest': None},
+ 'method': 'testMethod1',
+ },
+ {
+ 'annotations': {
+ 'Feature': {'value': ['Baz']},
+ 'MediumTest': None,
+ },
+ 'method': 'testMethod2',
+ },
+ ],
+ },
+ {
+ 'annotations': {'Feature': {'value': ['Bar']}},
+ 'class': 'org.chromium.test.SampleTest2',
+ 'methods': [
+ {
+ 'annotations': {'SmallTest': None},
+ 'method': 'testMethod1',
+ },
+ ],
+ }
+ ]
+
+ expected_tests = [
+ {
+ 'annotations': {
+ 'Feature': {'value': ['Baz']},
+ 'MediumTest': None,
+ },
+ 'class': 'org.chromium.test.SampleTest',
+ 'method': 'testMethod2',
+ },
+ {
+ 'annotations': {
+ 'Feature': {'value': ['Bar']},
+ 'SmallTest': None,
+ },
+ 'class': 'org.chromium.test.SampleTest2',
+ 'method': 'testMethod1',
+ },
+ ]
+
+ o._annotations = [('Feature', 'Bar'), ('Feature', 'Baz')]
with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle',
return_value=raw_tests):
actual_tests = o.GetTests()
« no previous file with comments | « build/android/pylib/instrumentation/instrumentation_test_instance.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698