[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone4-368-g700ab82

Michael 'Mickey' Lauer mickey at vanille-media.de
Mon Feb 2 18:51:23 UTC 2009


The following commit has been merged in the master branch:
commit 00e4b767053220c3eae2c6d56c9a01abc99aeb0e
Merge: 1f2c56f2b9309465f9c03a0cb498e889a9e795c3 1178441afcb0a9a6772aaabb35599bf8177c36ab
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Tue Nov 25 00:59:22 2008 +0100

    Merge commit 'origin/stabilization/milestone4'

diff --combined tests/test.py
index 06ff657,527f601..011f882
--- a/tests/test.py
+++ b/tests/test.py
@@@ -1,6 -1,6 +1,6 @@@
  #!/usr/bin/python -N
  """
- framework tests
+ Framework Test Framework (sic!)
  
  (C) 2008 Guillaume 'Charlie' Chereau <charlie at openmoko.org>
  (C) 2008 Michael 'Mickey' Lauer <mlauer at vanille-media.de>
@@@ -24,10 -24,12 +24,12 @@@ from framework.patterns.tasklet import 
  config = ConfigParser.ConfigParser()
  config.readfp(open('tests.conf'))
  
+ #=========================================================================#
  def taskletTest(func):
+ #=========================================================================#
      """decorator that turn a test into a tasklet
-     
-     The decorator will also take care of starting and stopping the mainloop 
+ 
+     The decorator will also take care of starting and stopping the mainloop
      """
      def ret(*args):
          loop = gobject.MainLoop()
@@@ -50,12 -52,14 +52,14 @@@
      ret.__name__ = func.__name__
      ret.__doc__ = func.__doc__
      return ret
-     
+ 
+ #=========================================================================#
  def request(*conds):
+ #=========================================================================#
      """This decorator can be used to skip some tests if a test condition if not satisfy
-     
+ 
      It is useful for testing without sim card, or operator to answer questions, etc...
-     
+ 
      You can call it with two arguments :
       option : string of the form <section>.<option>
       value  : the value of the config option
@@@ -69,7 -73,7 +73,7 @@@
      # If we call with a single condition, turn it into a list of conditions
      if isinstance(conds[0], str):
          conds = (conds,)
-         
+ 
      # Now we check all the conditions one bye one
      # I a single condition fails, then we skip the test
      skipped = False
@@@ -102,28 -106,30 +106,30 @@@
          ret.__doc__ = "%s : SKIPPED (need %s)" % (func.__doc__ or func.__name__, conds)
          return ret
      return _request
-     
-     
-     
+ 
+ #=========================================================================#
  class TestTest(unittest.TestCase):
+ #=========================================================================#
      """Test the test system itself"""
      def setUp(self):
          self.setup =True
-         
+ 
      def tearDown(self):
          pass
-     
+ 
      def test_setup(self):
          """Test that we did set up the test"""
          assert self.setup
-         
+ 
      @taskletTest
      def test_tasklet(self):
          """Test a tasklet test"""
          yield Sleep(1)
          yield True
-         
+ 
+ #=========================================================================#
  def check_debug_mode():
+ #=========================================================================#
      """Exit the program if we are not in debug mode"""
      try:
          assert False
@@@ -133,8 -139,10 +139,10 @@@
          print 'You need to run this in debug mode (-N option on neo)'
          import sys
          sys.exit(-1)
-         
+ 
+ #=========================================================================#
  class Operator(object):
+ #=========================================================================#
      """Class used to communicate with the test operator during the tests"""
      def query(self, question):
          """Ask a y/n question to the operator"""
@@@ -150,14 -158,15 +158,15 @@@
  
  operator = Operator()
  
-     
  # We check for the debug mode
  check_debug_mode()
-         
+ 
+ #=========================================================================#
  if __name__ == '__main__':
+ #=========================================================================#
      # This list all the modules containing the tests we want to run
      # TODO: provide command line arguments like in Mikey ogsmd test script
 -    modules = ['test', 'opreferencesd', 'sim', 'opimd', 'ogsmd2']
 +    modules = ['test', 'opreferencesd', 'sim', 'opimd', 'ogsmd2', 'oevents']
  
      for module in modules:
          module = __import__(module)

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list