From 2771c8a15069709c78698de0987ba132ce4facdd Mon Sep 17 00:00:00 2001 From: Nico von Geyso Date: Mon, 4 Mar 2013 15:44:17 +0100 Subject: [PATCH] added assertAll and assertAny for test cases --- test/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/utils.py b/test/utils.py index f034b94..0cf41d5 100644 --- a/test/utils.py +++ b/test/utils.py @@ -83,6 +83,11 @@ class NoRepoTestCase(unittest.TestCase): except: self.assertEqual(exc_class, sys.exc_info()[0]) + def assertAll(self, func, entries): + return self.assertTrue(all(func(x) for x in entries)) + + def assertAny(self, func, entries): + return self.assertTrue(any(func(x) for x in entries)) def assertRaisesWithArg(self, exc_class, arg, func, *args, **kwargs): try: