@@ -322,3 +322,33 @@ def test_argparse_rejects_missing_and_unknown_options(self):
322322
323323 self .assertNotEqual (missing .returncode , 0 )
324324 self .assertNotEqual (unknown .returncode , 0 )
325+
326+ def test_argparse_rejects_abbreviated_long_options (self ):
327+ with tempfile .TemporaryDirectory () as directory :
328+ directory = Path (directory )
329+ input_path = directory / "raw.jsonl"
330+ inventory_path = directory / "inventory.jsonl"
331+ diagnostics_path = directory / "diagnostics.jsonl"
332+ input_path .write_text ("" , encoding = "utf-8" )
333+ option_cases = (
334+ ("--inp" , "--inventory" , "--diagnostics" ),
335+ ("--input" , "--invent" , "--diagnostics" ),
336+ ("--input" , "--inventory" , "--diag" ),
337+ )
338+
339+ for input_option , inventory_option , diagnostics_option in option_cases :
340+ with self .subTest (
341+ input_option = input_option ,
342+ inventory_option = inventory_option ,
343+ diagnostics_option = diagnostics_option ,
344+ ):
345+ result = self .run_cli (
346+ input_option ,
347+ input_path ,
348+ inventory_option ,
349+ inventory_path ,
350+ diagnostics_option ,
351+ diagnostics_path ,
352+ )
353+
354+ self .assertNotEqual (result .returncode , 0 )
0 commit comments