Ejemplo n.º 1
0
 def test_run_suite_with_failures(self, mock_exit):
     tmp_file_path = os.path.join(self.tmp_dir, 'config.yml')
     with io.open(tmp_file_path, 'w', encoding='utf-8') as f:
         f.write(u"""
     TestBeds:
       # A test bed where adb will find Android devices.
       - Name: SampleTestBed
         Controllers:
           MagicDevice: '*'
   """)
     suite_runner.run_suite([integration_test.IntegrationTest],
                            argv=['-c', tmp_file_path])
     mock_exit.assert_called_once_with(1)
Ejemplo n.º 2
0
def _run_tests(supported_test_suites, tests_to_run, parsed_args):
    """Run the functional tests.

    Args:
        supported_test_suites (list): list of all test suite classes that can run on the device.
        tests_to_run (list): list of test names to run.
        parsed_args (Namespace): parsed CLI arguments.
    """
    if not tests_to_run:
        print("Nothing to run.")
        return

    suite_runner_args = _construct_mobly_args(parsed_args, tests_to_run)
    suite_runner.run_suite(supported_test_suites, argv=suite_runner_args)