Skip to content

Commit

Permalink
Fix inconsistent error messages involving output-file (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
twiggler authored Sep 9, 2024
1 parent 16f8afa commit de0ab7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions acquire/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ def check_and_set_acquire_args(
if not args.upload:
# check output related configuration
if (args.children or len(args.targets) > 1) and args.output_file:
raise ValueError("--children can not be used with --output_file. Use --output instead")
raise ValueError("--children can not be used with --output-file. Use --output instead")
elif args.output_file and (not args.output_file.parent.is_dir() or args.output_file.is_dir()):
raise ValueError("--output_file must be a path to a file in an existing directory")
raise ValueError("--output-file must be a path to a file in an existing directory")
elif args.output and not args.output.is_dir():
raise ValueError(f"Output directory doesn't exist or is a file: {args.output}")

Expand Down
6 changes: 3 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,21 +229,21 @@ def test_check_and_set_acquire_args_output(children: bool, arg_name: str, output
True,
"output_file",
get_mock_path(is_dir=False),
"--children can not be used with --output_file. Use --output instead",
"--children can not be used with --output-file. Use --output instead",
),
# Output_file is a directory
(
False,
"output_file",
get_mock_path(),
"--output_file must be a path to a file in an existing directory",
"--output-file must be a path to a file in an existing directory",
),
# Output_file has a non-existing parent directory
(
False,
"output_file",
get_mock_path(is_dir=False, parent_is_dir=False),
"--output_file must be a path to a file in an existing directory",
"--output-file must be a path to a file in an existing directory",
),
# Output is a non-existing directory
(
Expand Down

0 comments on commit de0ab7e

Please sign in to comment.