OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 | 6 |
7 """Unit tests for instrumentation.TestRunner.""" | 7 """Unit tests for instrumentation.TestRunner.""" |
8 | 8 |
9 # pylint: disable=W0212 | 9 # pylint: disable=W0212 |
10 | 10 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 def test_RunTest_verifyAdbShellCommand(self): | 254 def test_RunTest_verifyAdbShellCommand(self): |
255 self.instance.options.test_runner = 'MyTestRunner' | 255 self.instance.options.test_runner = 'MyTestRunner' |
256 self.instance.device.RunShellCommand = mock.Mock() | 256 self.instance.device.RunShellCommand = mock.Mock() |
257 self.instance.test_pkg.GetPackageName = mock.Mock( | 257 self.instance.test_pkg.GetPackageName = mock.Mock( |
258 return_value='test.package') | 258 return_value='test.package') |
259 self.instance._GetInstrumentationArgs = mock.Mock( | 259 self.instance._GetInstrumentationArgs = mock.Mock( |
260 return_value={'test_arg_key': 'test_arg_value'}) | 260 return_value={'test_arg_key': 'test_arg_value'}) |
261 self.instance._RunTest('test.package.TestClass#testMethod', 100) | 261 self.instance._RunTest('test.package.TestClass#testMethod', 100) |
262 self.instance.device.RunShellCommand.assert_called_with( | 262 self.instance.device.RunShellCommand.assert_called_with( |
263 ['am', 'instrument', '-r', | 263 ['am', 'instrument', '-r', |
264 '-e', 'test_arg_key', "'test_arg_value'", | 264 '-e', 'test_arg_key', 'test_arg_value', |
265 '-e', 'class', "'test.package.TestClass#testMethod'", | 265 '-e', 'class', 'test.package.TestClass#testMethod', |
266 '-w', 'test.package/MyTestRunner'], | 266 '-w', 'test.package/MyTestRunner'], |
267 timeout=100, retries=0) | 267 timeout=100, retries=0) |
268 | 268 |
269 if __name__ == '__main__': | 269 if __name__ == '__main__': |
270 unittest.main(verbosity=2) | 270 unittest.main(verbosity=2) |
271 | 271 |
OLD | NEW |