diff --git a/tests/bash_tests/utils.py b/tests/bash_tests/utils.py index f2410c7e..037d0fae 100644 --- a/tests/bash_tests/utils.py +++ b/tests/bash_tests/utils.py @@ -365,14 +365,24 @@ def execute(cmd: str, >>> execute('echo Hello') >>> execute('exiv2 --help') """ - # Check the input - args = shlex.split(cmd.format(**vars_dict), posix=os.name=='posix') - encoding = encoding or Config.encoding + # Check args + cmd = cmd.format(**vars_dict) + args = cmd.split(' ', maxsplit=1) if args[0] in Config.bin_files: args[0] = os.path.join(Config.bin_dir, args[0]) + Config.exiv2_ext + args = ' '.join(args) + if Config.system_name == 'Windows': + args = args.replace('\'', '\"') + else: + args = shlex.split(args, posix=os.name == 'posix') + + # Check stdin + encoding = encoding or Config.encoding if stdin: if not isinstance(stdin, bytes): stdin = str(stdin).encode(encoding) + + # Check stdout if redirect_stderr_to_stdout: stderr_to = subprocess.STDOUT else: diff --git a/tests/system_tests.py b/tests/system_tests.py index b3de4e6a..4f99f0de 100644 --- a/tests/system_tests.py +++ b/tests/system_tests.py @@ -206,11 +206,11 @@ def configure_suite(config_file): # Configure the parameters for bash tests BT.Config.bin_dir = os.path.abspath(config['ENV']['exiv2_path']) + BT.Config.data_dir = os.path.abspath(config['paths']['data_path']) + BT.Config.tmp_dir = os.path.abspath(config['paths']['tmp_path']) BT.Config.exiv2_ext = config['ENV']['binary_extension'] BT.Config.exiv2_http = config['ENV']['exiv2_http'] BT.Config.exiv2_port = int(config['ENV']['exiv2_port']) - BT.Config.data_dir = os.path.abspath(config['paths']['data_path']) - BT.Config.tmp_dir = os.path.abspath(config['paths']['tmp_path']) # print(dict(config['ENV'])); exit(1) # for debug