Exemplo n.º 1
0
    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_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'])
Exemplo n.º 4
0
    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'"])
Exemplo n.º 5
0
    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'])
Exemplo n.º 6
0
    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)
Exemplo n.º 7
0
    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_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'])
Exemplo n.º 10
0
    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
Exemplo n.º 11
0
    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
Exemplo n.º 12
0
    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"])
Exemplo n.º 13
0
    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'])
Exemplo n.º 14
0
    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'])
Exemplo n.º 15
0
    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'])
Exemplo n.º 16
0
    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'])