[Python-apps-commits] r8115 - in packages/pyspread/trunk/debian/patches (tests_bugfix.path)

anoteng-guest at users.alioth.debian.org anoteng-guest at users.alioth.debian.org
Thu Jan 26 06:22:50 UTC 2012


    Date: Thursday, January 26, 2012 @ 06:22:48
  Author: anoteng-guest
Revision: 8115

Fix wrong signatures in test data.

Modified:
  packages/pyspread/trunk/debian/patches/tests_bugfix.path

Modified: packages/pyspread/trunk/debian/patches/tests_bugfix.path
===================================================================
--- packages/pyspread/trunk/debian/patches/tests_bugfix.path	2012-01-25 17:04:30 UTC (rev 8114)
+++ packages/pyspread/trunk/debian/patches/tests_bugfix.path	2012-01-26 06:22:48 UTC (rev 8115)
@@ -366,15 +366,38 @@
          grid.actions.refresh_selected_frozen_cells(selection=selection)
 --- a/pyspread/src/run_tests.py
 +++ b/pyspread/src/run_tests.py
-@@ -32,11 +32,16 @@
+@@ -32,11 +32,39 @@
  
  from sysvars import get_program_path
  
 +import wx
 +app = wx.App()
 +
-+from src.lib.gpg import genkey
++from src.lib.gpg import genkey, sign
 +
++
++def create_valid_signatures():
++    """Createsb all valid signatures for test files"""
++    source_path = get_program_path() + "src/"
++
++    valid_test_filepaths = [ \
++        source_path + "actions/test/test1.pys",
++        source_path + "actions/test/test4.pys",
++        source_path + "lib/test/test1.pys",
++    ]
++
++    for filepath in valid_test_filepaths:
++        try:
++            os.remove(filepath + ".sig")
++        except OSError:
++            pass
++
++        signature = sign(filepath)
++        signfile = open(filepath + '.sig','wb')
++        signfile.write(signature)
++        signfile.close()
++
++
  def run_tests():
      """Looks for py.test files and runs py.test"""
 -    
@@ -385,11 +408,13 @@
      for root, dirs, files in os.walk(source_path):
          if root[-4:] == "test":
              for __file in files:
-@@ -48,4 +53,7 @@
+@@ -48,4 +76,9 @@
                      os.system(sys_cmd)
  
  if __name__ == "__main__":
 +
 +    genkey()
 +
++    create_valid_signatures()
++
      run_tests()




More information about the Python-apps-commits mailing list