Drop loadincludes() and mode_to_str() tests from aa_test.py

aa_test.py doesn't run in 'make check' because its filename doesn't
match the 'test-*.py' pattern.

mode_to_str() was dropped as part of the FileRule series, so it's
pointless to keep its tests. (The replacement is totally different and
has full test coverage already.)

loadincludes() still exists, but only testing if the function runs
without errors is not really helpful, so drop this test.

Also drop unused imports and add an explicit import for apparmor.aamode.


Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
Christian Boltz 2016-10-10 23:09:41 +02:00
parent 93d1539f4f
commit 304804addb

View file

@ -13,8 +13,7 @@
# ----------------------------------------------------------------------
import unittest
import apparmor.aa
import apparmor.logparser
import apparmor.aamode
class Test(unittest.TestCase):
@ -35,16 +34,6 @@ class Test(unittest.TestCase):
'C': apparmor.aamode.AA_EXEC_CHILD,
}
def test_loadinclude(self):
apparmor.aa.loadincludes()
def test_modes_to_string(self):
for string in self.MODE_TEST.keys():
mode = self.MODE_TEST[string]
self.assertEqual(apparmor.aamode.mode_to_str(mode), string, 'mode is %s and string is %s'%(mode, string))
def test_string_to_modes(self):
for string in self.MODE_TEST.keys():