[apparmor] [patch] Drop loadincludes() and mode_to_str() tests from aa_test.py

Christian Boltz apparmor at cboltz.de
Sun Oct 9 18:07:53 UTC 2016


Hello,

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.


[ 03-drop-old-tests-from-aa_test.diff ]

--- utils/test/aa_test.py       2016-10-09 19:48:36.501925539 +0200
+++ utils/test/aa_test.py       2016-10-09 20:02:03.205766858 +0200
@@ -13,8 +13,7 @@
 # ----------------------------------------------------------------------
 import unittest
 
-import apparmor.aa
-import apparmor.logparser
+import apparmor.aamode
 
 class Test(unittest.TestCase):
 
@@ -35,16 +34,6 @@
                   '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():


Regards,

Christian Boltz
-- 
Apropos an Weihnachten ist immer zur Heiligen Messe ganz gut mit
Umstellung. Da ist erfahrungsgemäß wenig los auf den Mailservern.
[Uwe Drießen in postfix-users]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20161009/635c56c1/attachment.pgp>


More information about the AppArmor mailing list