Hello,

Am Dienstag, 14. April 2015 schrieb Christian Boltz:
...
> So basically super() is (more or less) useless with py2 :-(  - and in
> case it isn't, it has an annoying syntax.

Since nobody objected to the proposal in my previous mail, here's the
updated patch that avoids the super() dance:


AATest: don't limit diff length

Add setUp() to AATest that sets "self.maxDiff = None" (unlimited).
This gives us unlimited array diffs everywhere where AATest is used.

Also rename several setUp() functions in test-regex_matches.py to
AASetup() to avoid that the shiny new AATest setUp() gets overwritten.


[ 39-aatest-maxdiff.diff ]

=== modified file utils/test/common_test.py
--- utils/test/common_test.py   2015-04-27 22:20:41.902858944 +0200
+++ utils/test/common_test.py   2015-04-27 22:23:05.644235000 +0200
@@ -39,6 +39,14 @@
 
 
 class AATest(unittest.TestCase):
+    def setUp(self):
+        self.maxDiff = None
+        self.AASetup()
+
+    def AASetup(self):
+        '''override this function if a test needs additional setup steps 
(instead of overriding setUp())'''
+        pass
+
     tests = []
 
 class AAParseTest(unittest.TestCase):
=== modified file utils/test/test-regex_matches.py
--- utils/test/test-regex_matches.py    2015-04-27 22:20:41.911858404 +0200
+++ utils/test/test-regex_matches.py    2015-04-27 22:23:41.937060954 +0200
@@ -203,7 +203,7 @@
 class AARegexCapability(AARegexTest):
     '''Tests for RE_PROFILE_CAP'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = RE_PROFILE_CAP
 
     tests = [
@@ -218,7 +218,7 @@
 class AARegexPath(AARegexTest):
     '''Tests for RE_PROFILE_PATH_ENTRY'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = aa.RE_PROFILE_PATH_ENTRY
 
     tests = [
@@ -237,7 +237,7 @@
 class AARegexBareFile(AARegexTest):
     '''Tests for RE_PROFILE_BARE_FILE_ENTRY'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = aa.RE_PROFILE_BARE_FILE_ENTRY
 
     tests = [
@@ -255,7 +255,7 @@
 class AARegexDbus(AARegexTest):
     '''Tests for RE_PROFILE_DBUS'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = aa.RE_PROFILE_DBUS
 
     tests = [
@@ -271,7 +271,7 @@
 class AARegexMount(AARegexTest):
     '''Tests for RE_PROFILE_MOUNT'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = aa.RE_PROFILE_MOUNT
 
     tests = [
@@ -295,7 +295,7 @@
 class AARegexSignal(AARegexTest):
     '''Tests for RE_PROFILE_SIGNAL'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = aa.RE_PROFILE_SIGNAL
 
     tests = [
@@ -321,7 +321,7 @@
 class AARegexPtrace(AARegexTest):
     '''Tests for RE_PROFILE_PTRACE'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = aa.RE_PROFILE_PTRACE
 
     tests = [
@@ -343,7 +343,7 @@
 class AARegexPivotRoot(AARegexTest):
     '''Tests for RE_PROFILE_PIVOT_ROOT'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = aa.RE_PROFILE_PIVOT_ROOT
 
     tests = [
@@ -370,7 +370,7 @@
 class AARegexUnix(AARegexTest):
     '''Tests for RE_PROFILE_UNIX'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = aa.RE_PROFILE_UNIX
 
     tests = [
@@ -395,7 +395,7 @@
 class AANamedRegexProfileStart_2(AANamedRegexTest):
     '''Tests for RE_PROFILE_START'''
 
-    def setUp(self):
+    def AASetup(self):
         self.regex = RE_PROFILE_START
 
     tests = [



Regards,

Christian Boltz
-- 
> [zerkratzte CD mit Zahnpasta polieren]
> Und der Bonus dabei: Deine CD duftet angenehm nach Minze... ;-))
...und die CD ist zukünftig gegen Karies und Paradonthose geschützt  
[> Martin Kropfinger und Lars Zimmermann in suse-linux]


-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to