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

Side by Side Diff: build/android/pylib/base/test_dispatcher_unittest.py

Issue 1315743004: [Android] Add a custom pylintrc for build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix appurify_sanitized import-errors 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 unified diff | Download patch
« no previous file with comments | « build/android/pylib/base/test_dispatcher.py ('k') | build/android/pylib/content_settings.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 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 """Unittests for test_dispatcher.py.""" 6 """Unittests for test_dispatcher.py."""
7 # pylint: disable=R0201 7 # pylint: disable=R0201
8 # pylint: disable=W0212 8 # pylint: disable=W0212
9 9
10 import os 10 import os
11 import sys 11 import sys
12 import unittest 12 import unittest
13 13
14 14
15 from devil.android import device_utils 15 from devil.android import device_utils
16 from devil.android.sdk import adb_wrapper 16 from devil.android.sdk import adb_wrapper
17 from devil.utils import watchdog_timer 17 from devil.utils import watchdog_timer
18 from pylib import constants 18 from pylib import constants
19 from pylib.base import base_test_result 19 from pylib.base import base_test_result
20 from pylib.base import test_collection 20 from pylib.base import test_collection
21 from pylib.base import test_dispatcher 21 from pylib.base import test_dispatcher
22 22
23 sys.path.append( 23 sys.path.append(
24 os.path.join(constants.DIR_SOURCE_ROOT, 'third_party', 'pymock')) 24 os.path.join(constants.DIR_SOURCE_ROOT, 'third_party', 'pymock'))
25 import mock 25 import mock # pylint: disable=import-error
26 26
27 27
28 class TestException(Exception): 28 class TestException(Exception):
29 pass 29 pass
30 30
31 31
32 def _MockDevice(serial): 32 def _MockDevice(serial):
33 d = mock.MagicMock(spec=device_utils.DeviceUtils) 33 d = mock.MagicMock(spec=device_utils.DeviceUtils)
34 d.__str__.return_value = serial 34 d.__str__.return_value = serial
35 d.adb = mock.MagicMock(spec=adb_wrapper.AdbWrapper) 35 d.adb = mock.MagicMock(spec=adb_wrapper.AdbWrapper)
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 def testNoTests(self): 233 def testNoTests(self):
234 results, exit_code = test_dispatcher.RunTests( 234 results, exit_code = test_dispatcher.RunTests(
235 [], MockRunner, [_MockDevice('0'), _MockDevice('1')], shard=False) 235 [], MockRunner, [_MockDevice('0'), _MockDevice('1')], shard=False)
236 self.assertEqual(len(results.GetAll()), 0) 236 self.assertEqual(len(results.GetAll()), 0)
237 self.assertEqual(exit_code, constants.ERROR_EXIT_CODE) 237 self.assertEqual(exit_code, constants.ERROR_EXIT_CODE)
238 238
239 239
240 if __name__ == '__main__': 240 if __name__ == '__main__':
241 unittest.main() 241 unittest.main()
OLDNEW
« no previous file with comments | « build/android/pylib/base/test_dispatcher.py ('k') | build/android/pylib/content_settings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698