add re_match_include_parse() test with invalid rule name

... to increase test coverity of regex.py to 100%.
This commit is contained in:
Christian Boltz 2020-12-25 19:57:20 +01:00
parent 20234d240e
commit c3d3203a60
Failed to generate hash of commit

View file

@ -594,14 +594,15 @@ class Test_re_match_include_parse_abi(AATest):
def _run_test(self, params, expected):
self.assertEqual(re_match_include_parse(params, 'abi'), expected)
class Test_re_match_include_parse_empty_filename(AATest):
class Test_re_match_include_parse_errors(AATest):
tests = [
(('include <>', 'include'), AppArmorException),
(('include <>', 'include'), AppArmorException), # various rules with empty filename
(('include ""', 'include'), AppArmorException),
(('include ', 'include'), AppArmorException),
(('abi <>,', 'abi'), AppArmorException),
(('abi "",', 'abi'), AppArmorException),
(('abi ,', 'abi'), AppArmorException),
(('abi <foo>,', 'invalid'), AppArmorBug), # invalid rule name
]
def _run_test(self, params, expected):