def test_allow_not_quoted_file_with_whitespaces_win(self): test_utils.set_win() file = test_utils.create_file('my script.py') command_split = process_utils.split_command('my script.py', test_utils.temp_folder) self.assertEqual(command_split, [os.path.abspath(file)])
def test_regex_only_search_user_home_win(self): test_utils.set_win() files = file_download_feature.find_matching_files('##any_path#', 'found files: ' '~\\text.txt') self.assertEqual(files, ['~\\text.txt'])
def test_unwrap_single_and_quotes_same_arg_win(self): test_utils.set_win() command_split = process_utils.split_command( '\'"my script.py"\' "\'param 1\'"') self.assertEqual(command_split, ['"my script.py"', "'param 1'"])
def test_unwrap_single_and_quotes_separate_args_win(self): test_utils.set_win() command_split = process_utils.split_command( '"my script.py" \'param 1\'') self.assertEqual(command_split, ['my script.py', 'param 1'])
def test_values_from_script_win_newline(self): test_utils.set_win() parameter_model = _create_parameter_model({ 'name': 'def_param', 'type': 'list', 'values': {'script': 'echo "123\r\n" "456"'}}) self.assertEqual(['123', ' 456'], parameter_model.values)
def test_complex_command_win(self): test_utils.set_win() command_split = process_utils.split_command( '"c:\program files\python\python.exe" test.py') self.assertEqual(command_split, ['c:\program files\python\python.exe', 'test.py'])
def test_regex_only_any_path_win_3_matches(self): test_utils.set_win() files = file_download_feature.find_matching_files('##any_path#', 'found files: ' 'C:\\Users\\username\\text.txt, ' 'D:\\windows\\System32, ' 'C:\\Program\ Files\\script\ server\\read_me.md') self.assertEqual(files, ['C:\\Users\\username\\text.txt', 'D:\\windows\\System32', 'C:\\Program\ Files\\script\ server\\read_me.md'])
def test_init_when_windows_and_python_3_8(self): test_utils.set_win() try: self.start_server(12345, '127.0.0.1') self.check_server_running() except AttributeError: # Linux/Mac doesn't support windows specific classes if not self.windows: return raise
def test_init_when_windows_and_python_3_7(self): test_utils.set_win() try: self.start_server(12345, '127.0.0.1') if self.requires_explicit_ioloop_factory: self.fail( 'Server should NOT be startable on current environment') else: self.check_server_running() except NotImplementedError as e: if self.requires_explicit_ioloop_factory and is_unsupported_ioloop_exception( e): return raise
def test_unwrap_single_and_quotes_same_arg_win(self): test_utils.set_win() command_split = process_utils.split_command('\'"my script.py"\' "\'param 1\'"') self.assertEqual(command_split, ['my script.py', "param 1"])
def test_unwrap_single_and_quotes_separate_args_win(self): test_utils.set_win() command_split = process_utils.split_command('"my script.py" \'param 1\'') self.assertEqual(command_split, ['my script.py', 'param 1'])
def test_unwrap_single_quotes_win(self): test_utils.set_win() command_split = process_utils.split_command("'my script.py' 'param 1'") self.assertEqual(command_split, ['my script.py', 'param 1'])
def test_unwrap_double_quotes_win(self): test_utils.set_win() command_split = process_utils.split_command('"my script.py" "param 1"') self.assertEqual(command_split, ['my script.py', 'param 1'])
def test_complex_command_win(self): test_utils.set_win() command_split = process_utils.split_command('"c:\program files\python\python.exe" test.py') self.assertEqual(command_split, ['c:\program files\python\python.exe', 'test.py'])