Skip to content

Commit af067b3

Browse files
committed
make sure the --worker flag is interpreted correctly
1 parent bca066f commit af067b3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_cli.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,20 @@ def test_blank_start_no_files_in_cli_output(controller_instance, caplog):
4848
"en_US",
4949
)
5050
assert "No convertible media files" in caplog.text
51+
52+
53+
def test_cli_workers_flag_recognized(tmp_path):
54+
# Run CLI with --workers on an empty directory; should exit cleanly
55+
script_path = os.path.abspath(
56+
os.path.join(os.path.dirname(__file__), "..", "any_to_any.py")
57+
)
58+
result = subprocess.run(
59+
[sys.executable, script_path, "-i", str(tmp_path), "--workers", "2"],
60+
capture_output=True,
61+
text=True,
62+
)
63+
# Ensure argparse accepts the flag (no "unrecognized arguments"),
64+
# return code may be 0 or 1 depending on no-media condition and locale.
65+
combined = (result.stdout + "\n" + result.stderr).lower()
66+
assert "unrecognized arguments" not in combined
67+
assert result.returncode in (0, 1)

0 commit comments

Comments
 (0)