OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # pylint: disable=protected-access | 6 # pylint: disable=protected-access |
7 | 7 |
8 import unittest | 8 import unittest |
9 | 9 |
10 from pylib.base import base_test_result | 10 from pylib.base import base_test_result |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 class TestLocalDeviceNonStringTestRun( | 27 class TestLocalDeviceNonStringTestRun( |
28 local_device_test_run.LocalDeviceTestRun): | 28 local_device_test_run.LocalDeviceTestRun): |
29 | 29 |
30 # pylint: disable=abstract-method | 30 # pylint: disable=abstract-method |
31 | 31 |
32 def __init__(self): | 32 def __init__(self): |
33 super(TestLocalDeviceNonStringTestRun, self).__init__( | 33 super(TestLocalDeviceNonStringTestRun, self).__init__( |
34 mock.MagicMock(), mock.MagicMock()) | 34 mock.MagicMock(), mock.MagicMock()) |
35 | 35 |
36 def _GetTestName(self, test): | 36 def _GetUniqueTestName(self, test): |
37 return test['name'] | 37 return test['name'] |
38 | 38 |
39 | 39 |
40 class LocalDeviceTestRunTest(unittest.TestCase): | 40 class LocalDeviceTestRunTest(unittest.TestCase): |
41 | 41 |
42 def testGetTestsToRetry_allTestsPassed(self): | 42 def testGetTestsToRetry_allTestsPassed(self): |
43 results = [ | 43 results = [ |
44 base_test_result.BaseTestResult( | 44 base_test_result.BaseTestResult( |
45 'Test1', base_test_result.ResultType.PASS), | 45 'Test1', base_test_result.ResultType.PASS), |
46 base_test_result.BaseTestResult( | 46 base_test_result.BaseTestResult( |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 test_run = TestLocalDeviceNonStringTestRun() | 138 test_run = TestLocalDeviceNonStringTestRun() |
139 tests_to_retry = test_run._GetTestsToRetry(tests, try_results) | 139 tests_to_retry = test_run._GetTestsToRetry(tests, try_results) |
140 self.assertEquals(1, len(tests_to_retry)) | 140 self.assertEquals(1, len(tests_to_retry)) |
141 self.assertIsInstance(tests_to_retry[0], dict) | 141 self.assertIsInstance(tests_to_retry[0], dict) |
142 self.assertEquals(tests[1], tests_to_retry[0]) | 142 self.assertEquals(tests[1], tests_to_retry[0]) |
143 | 143 |
144 | 144 |
145 if __name__ == '__main__': | 145 if __name__ == '__main__': |
146 unittest.main(verbosity=2) | 146 unittest.main(verbosity=2) |
OLD | NEW |