def run_test_app_locally(self, app_name, arg_list): ''' :param app_name: name of app to run :param arg_list: list of command line arguments given to an app Runs an app locally, with a given set of command line arguments ''' path = os.path.join(os.path.dirname(__file__), "file_load") args = ['dx-run-app-locally', os.path.join(path, app_name)] args.extend(arg_list) check_output(args)
def run(command, **kwargs): try: if isinstance(command, list) or isinstance(command, tuple): print("$ %s" % ' '.join(pipes.quote(f) for f in command)) output = check_output(command, **kwargs) else: print("$ %s" % (command, )) output = check_output(command, shell=True, **kwargs) except testutil.DXCalledProcessError as e: print('== stdout ==') print(e.output) print('== stderr ==') print(e.stderr) raise print(output) return output
def run(command, **kwargs): try: if isinstance(command, list) or isinstance(command, tuple): print("$ %s" % ' '.join(pipes.quote(f) for f in command)) output = check_output(command, **kwargs) else: print("$ %s" % (command,)) output = check_output(command, shell=True, **kwargs) except testutil.DXCalledProcessError as e: print('== stdout ==') print(e.output) print('== stderr ==') print(e.stderr) raise print(output) return output
def test_dx_run_app_locally(self): appdir = create_app_dir() output = check_output(['dx-run-app-locally', appdir, '-iin1=8']) print(output) self.assertIn("App finished successfully", output) self.assertIn("Final output: out1 = 140", output) return appdir
def run(command, **kwargs): print("$ %s" % (command,)) output = check_output(command, shell=True, **kwargs) print(output) return output
def test_invalid_arguments(self): with self.assertRaises(testutil.DXCalledProcessError): check_output(['dx-app-wizard', '--template=par'])
def run(command, **kwargs): print("$ %s" % (command, )) output = check_output(command, shell=True, **kwargs) print(output) return output
def test_dx_run_app_locally_noninteractively(self): appdir = create_app_dir() output = check_output(['dx-run-app-locally', appdir, '-iin1=8']) print(output) self.assertIn("App finished successfully", output) self.assertIn("Final output: out1 = 140", output)