File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,23 @@ def test_system_exit_propagation(self):
128128 with self .assertRaises (SystemExit ):
129129 main ()
130130
131+ def test_verbose_and_quiet_conflict (self ):
132+ """Ensure --verbose and --quiet together trigger a parser error."""
133+ mock_args = MagicMock ()
134+ mock_args .pdfs = [Path ("file1.pdf" )]
135+ mock_args .dpi = 300
136+ mock_args .lang = "eng"
137+ mock_args .verbose = True
138+ mock_args .quiet = True
139+ self .mock_args .return_value = mock_args
140+
141+ with patch (
142+ "argparse.ArgumentParser.error" , side_effect = SystemExit (2 )
143+ ) as mock_error :
144+ with self .assertRaises (SystemExit ):
145+ main ()
146+ mock_error .assert_called_once ()
147+
131148
132149if __name__ == "__main__" :
133150 unittest .main ()
You can’t perform that action at this time.
0 commit comments