[apparmor] [patch] AATest: don't limit diff length
Christian Boltz
apparmor at cboltz.de
Tue Apr 28 21:46:41 UTC 2015
Hello,
Am Dienstag, 28. April 2015 schrieb Steve Beattie:
> On Mon, Apr 27, 2015 at 10:29:44PM +0200, Christian Boltz wrote:
> > 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.
> As you might suspect, I'm not crazy about this, mostly because
indeed, I expected this ;-)
> potential contributors who are used to writing python unittest code
> will likely be expecting to create setUp() (and tearDown()) and not
> our custom AASetup() method. And while overriding setUp() currently
> would just drop the maxdiff setting (so no big loss), if we do more
> complex and/or essential stuff in AATest:setUp(), it could become a
> problem.
Well, I could argue that "potential contributors who are used to writing
python unittest code" will have a look at our AATest class and spot the
difference to unittest.TestCase ;-)
> That said, in the desire to move things along,
> Acked-by: Steve Beattie <steve at nxnw.org>, with the proviso that you
> add some AASetup() stubs in test-example.py, so that people looking
> at it as an example will have clues available (the stub methods don't
> need to do more than 'pass' with a suitable comment).
Good idea, I added:
=== modified file 'utils/test/test-example.py'
--- utils/test/test-example.py 2015-04-22 20:01:34 +0000
+++ utils/test/test-example.py 2015-04-28 21:30:34 +0000
@@ -35,6 +35,10 @@
self.assertEqual(1, 1)
class TestBaz(AATest):
+ def AASetup(self):
+ # called by setUp() - use AASetup() to avoid the need for using super(...)
+ pass
+
def test_Baz_only_one_test(self):
self.assertEqual("baz", "baz")
Since this is a trivial addition, I just commited it with the patch.
If you disagree with the comment wording, feel free to change it ;-)
BTW: You just won a patch counter reset - this was the last pending
patch from my long series of python patches ;-)
Regards,
Christian Boltz
PS: If you want to reach the "no pending patches" state, you just need
to review the aa-notify patch I sent yesterday ;-)
--
You could just randomly throw darts at the list of packages on the
DVD and not on the CD and any of them can be removed with little or
no end-user visibility. [Greg Freemyer in opensuse-factory]
More information about the AppArmor
mailing list