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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 ['/', 'another', 'fake', 'device', 'path'], | 42 ['/', 'another', 'fake', 'device', 'path'], |
43 '/fake/device/root')) | 43 '/fake/device/root')) |
44 | 44 |
45 | 45 |
46 class TestLocalDeviceTestRun(local_device_test_run.LocalDeviceTestRun): | 46 class TestLocalDeviceTestRun(local_device_test_run.LocalDeviceTestRun): |
47 | 47 |
48 # pylint: disable=abstract-method | 48 # pylint: disable=abstract-method |
49 | 49 |
50 def __init__(self): | 50 def __init__(self): |
51 super(TestLocalDeviceTestRun, self).__init__( | 51 super(TestLocalDeviceTestRun, self).__init__( |
52 mock.MagicMock(), mock.MagicMock()) | 52 mock.MagicMock(), mock.MagicMock(), mock.MagicMock()) |
53 | 53 |
54 | 54 |
55 class TestLocalDeviceNonStringTestRun( | 55 class TestLocalDeviceNonStringTestRun( |
56 local_device_test_run.LocalDeviceTestRun): | 56 local_device_test_run.LocalDeviceTestRun): |
57 | 57 |
58 # pylint: disable=abstract-method | 58 # pylint: disable=abstract-method |
59 | 59 |
60 def __init__(self): | 60 def __init__(self): |
61 super(TestLocalDeviceNonStringTestRun, self).__init__( | 61 super(TestLocalDeviceNonStringTestRun, self).__init__( |
62 mock.MagicMock(), mock.MagicMock()) | 62 mock.MagicMock(), mock.MagicMock(), mock.MagicMock()) |
63 | 63 |
64 def _GetUniqueTestName(self, test): | 64 def _GetUniqueTestName(self, test): |
65 return test['name'] | 65 return test['name'] |
66 | 66 |
67 | 67 |
68 class LocalDeviceTestRunTest(unittest.TestCase): | 68 class LocalDeviceTestRunTest(unittest.TestCase): |
69 | 69 |
70 def testGetTestsToRetry_allTestsPassed(self): | 70 def testGetTestsToRetry_allTestsPassed(self): |
71 results = [ | 71 results = [ |
72 base_test_result.BaseTestResult( | 72 base_test_result.BaseTestResult( |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 test_run = TestLocalDeviceNonStringTestRun() | 166 test_run = TestLocalDeviceNonStringTestRun() |
167 tests_to_retry = test_run._GetTestsToRetry(tests, try_results) | 167 tests_to_retry = test_run._GetTestsToRetry(tests, try_results) |
168 self.assertEquals(1, len(tests_to_retry)) | 168 self.assertEquals(1, len(tests_to_retry)) |
169 self.assertIsInstance(tests_to_retry[0], dict) | 169 self.assertIsInstance(tests_to_retry[0], dict) |
170 self.assertEquals(tests[1], tests_to_retry[0]) | 170 self.assertEquals(tests[1], tests_to_retry[0]) |
171 | 171 |
172 | 172 |
173 if __name__ == '__main__': | 173 if __name__ == '__main__': |
174 unittest.main(verbosity=2) | 174 unittest.main(verbosity=2) |
OLD | NEW |