Commit 59b5b8ba authored by Steve Beattie's avatar Steve Beattie

Subject: utils tests: restructure DBUS parse tests

Convert the DBUS parse tests to use common AAParseTest super class in
common_test.py.
Signed-off-by: Steve Beattie's avatarSteve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz's avatarChristian Boltz <apparmor@cboltz.de>
parent 365b6d60
......@@ -11,20 +11,18 @@
import apparmor.aa as aa
import unittest
from common_test import AAParseTest, setup_regex_tests
class AAParseDBUSTest(unittest.TestCase):
class AAParseDBUSTest(AAParseTest):
def test_parse_plain_dbus_rule(self):
dstring = 'dbus,'
dbus = aa.parse_dbus_rule(dstring)
self.assertEqual(dstring, dbus.serialize(),
'dbus object returned "%s", expected "%s"' % (dbus.serialize(), dstring))
def setUp(self):
self.parse_function = aa.parse_dbus_rule
def test_parse_dbus_simple_send_rule(self):
dstring = 'dbus send,'
dbus = aa.parse_dbus_rule(dstring)
self.assertEqual(dstring, dbus.serialize(),
'dbus object returned "%s", expected "%s"' % (dbus.serialize(), dstring))
tests = [
('dbus,', 'dbus base keyword'),
('dbus send,', 'dbus simple send rule'),
]
if __name__ == '__main__':
setup_regex_tests(AAParseDBUSTest)
unittest.main(verbosity=2)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment