mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 14:25:52 +00:00
Change abstract methods in BaseRule to use NotImplementedError
As Kshitij mentioned, abstract methods should use NotImplementedError instead of AppArmorBug. While changing this, I noticed that __repr__() needs to be robust against NotImplementedError because get_raw() is not available in BaseRule. Therefore the patch changes __repr__() to catch NotImplementedError. Of course the change to NotImplementedError also needs several adjustments in the tests. Acked-by: Kshitij Gupta <kgupta8592@gmail.com> (long before branching off 2.10, therefore I'll also commit to 2.10)
This commit is contained in:
@@ -441,7 +441,7 @@ class NetworkGlobTestAATest(AATest):
|
||||
# self.assertEqual(self.ruleset.get_glob('network inet raw,'), 'network inet,')
|
||||
|
||||
def test_glob_ext(self):
|
||||
with self.assertRaises(AppArmorBug):
|
||||
with self.assertRaises(NotImplementedError):
|
||||
# get_glob_ext is not available for network rules
|
||||
self.ruleset.get_glob_ext('network inet raw,')
|
||||
|
||||
|
Reference in New Issue
Block a user