[csw-devel] SF.net SVN: gar:[13205] csw/mgar/gar/v2/lib/python/package_checks_test.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Feb 5 20:39:43 CET 2011


Revision: 13205
          http://gar.svn.sourceforge.net/gar/?rev=13205&view=rev
Author:   wahwah
Date:     2011-02-05 19:39:43 +0000 (Sat, 05 Feb 2011)

Log Message:
-----------
checkpkg: Allow to run more than 1 test per class

When writing tests for checkpkg checks, it would be nice to be able to
write more than one test in one class, instead of creating a new class
for every check.  Adding a level of indirection, a function with takes
a callback function as an argument, allows to do that.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/package_checks_test.py

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-02-05 19:39:15 UTC (rev 13204)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-02-05 19:39:43 UTC (rev 13205)
@@ -51,10 +51,13 @@
           checkpkg_lib.IndividualCheckInterface)
 
   def testDefault(self):
+    self.RunCheckpkgTest(self.CheckpkgTest)
+
+  def RunCheckpkgTest(self, callback):
     self.logger_mock = stubs.LoggerStub()
     self.SetMessenger()
     self.SetErrorManagerMock()
-    self.CheckpkgTest()
+    callback()
     self.mox.ReplayAll()
     getattr(pc, self.FUNCTION_NAME)(self.pkg_data,
                                     self.error_mgr_mock,


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list