From a503ff2268fce01cae85d8cd4e3284c4c888c129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Fri, 23 Feb 2024 13:26:08 +0100 Subject: [PATCH] Add: Add test for update-header passing files and directories --- tests/updateheader/test_header.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/updateheader/test_header.py b/tests/updateheader/test_header.py index aaa9034a5..aec923471 100644 --- a/tests/updateheader/test_header.py +++ b/tests/updateheader/test_header.py @@ -430,6 +430,16 @@ def test_defaults(self): self.assertIsNone(args.exclude_file) self.assertFalse(args.cleanup) + def test_files_and_directories_mutual_exclusive(self): + args = ["--files", "foo", "--directories", "bar"] + with self.assertRaises(SystemExit) as cm: + args = parse_args(args) + + self.assertIn( + "argument -d/--directories: not allowed with argument -f/--file", + cm.msg, + ) + class GetExcludeListTestCase(TestCase): def test_get_exclude_list(self):