[Python-apps-commits] r8110 - in packages/pyspread/trunk/debian (4 files)
anoteng-guest at users.alioth.debian.org
anoteng-guest at users.alioth.debian.org
Tue Jan 24 23:04:06 UTC 2012
Date: Tuesday, January 24, 2012 @ 23:04:01
Author: anoteng-guest
Revision: 8110
Add missing python-pyme dependency.
Add some minor bug fixes from upstream to the tests.
Added:
packages/pyspread/trunk/debian/patches/tests_bugfix.path
Modified:
packages/pyspread/trunk/debian/control
packages/pyspread/trunk/debian/patches/series
packages/pyspread/trunk/debian/rules
Modified: packages/pyspread/trunk/debian/control
===================================================================
--- packages/pyspread/trunk/debian/control 2012-01-24 22:19:25 UTC (rev 8109)
+++ packages/pyspread/trunk/debian/control 2012-01-24 23:04:01 UTC (rev 8110)
@@ -14,9 +14,8 @@
Package: pyspread
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, python-numpy (>= 1.1.0),
- python-wxgtk2.8 (>= 2.8.10.1)
-Recommends: python-pyme (>= 0.8.1), python-gmpy (>= 1.1.0),
- python-rpy (>= 1.0.3)
+ python-wxgtk2.8 (>= 2.8.10.1), python-pyme (>= 0.8.1)
+Recommends: python-gmpy (>= 1.1.0), python-rpy (>= 1.0.3)
Description: cross-platform Python spreadsheet application
Pyspread is a cross-platform Python spreadsheet application. Instead of
spreadsheet formulas, Python expressions are entered into the spreadsheet
Modified: packages/pyspread/trunk/debian/patches/series
===================================================================
--- packages/pyspread/trunk/debian/patches/series 2012-01-24 22:19:25 UTC (rev 8109)
+++ packages/pyspread/trunk/debian/patches/series 2012-01-24 23:04:01 UTC (rev 8110)
@@ -1 +1,2 @@
about_dialog_license.patch
+tests_bugfix.path
Added: packages/pyspread/trunk/debian/patches/tests_bugfix.path
===================================================================
--- packages/pyspread/trunk/debian/patches/tests_bugfix.path (rev 0)
+++ packages/pyspread/trunk/debian/patches/tests_bugfix.path 2012-01-24 23:04:01 UTC (rev 8110)
@@ -0,0 +1,395 @@
+Description: Fix test case for frozen cells and adjust run_tests so that gpg key
+ is created if not present.
+Origin: upstream, commit: 4b6e8f188af43cc89bf05263358907a0dc97fc93, commit: 96db0e78ebc4bbf692b5662a620d98bc4aaf0284
+Last-Update:2012-01-25
+
+--- a/pyspread/src/actions/test/test_grid_cell_actions.py
++++ b/pyspread/src/actions/test/test_grid_cell_actions.py
+@@ -45,8 +45,8 @@
+
+ class TestCellActions(object):
+ """Cell actions test class"""
+-
+-
++
++
+ param_set_code = [ \
+ {'key': (0, 0, 0), 'code': "'Test'", 'result': "'Test'"},
+ {'key': (0, 0, 0), 'code': "", 'result': None},
+@@ -57,30 +57,30 @@
+ @params(param_set_code)
+ def test_set_code(self, key, code, result):
+ """Unit test for set_code"""
+-
++
+ main_window.changed_since_save = False
+-
++
+ grid.actions.set_code(key, code)
+-
++
+ assert grid.code_array(key) == result
+-
++
+ wx.Yield()
+-
++
+ if code is None or not code:
+ assert not main_window.changed_since_save
+ else:
+ assert main_window.changed_since_save
+-
+-
++
++
+ @params(param_set_code)
+ def test_delete_cell(self, key, code, result):
+ """Unit test for delete_cell"""
+-
++
+ grid.actions.set_code(key, code)
+ grid.actions.delete_cell(key)
+-
++
+ assert grid.code_array(key) is None
+-
++
+ param_get_reference = [ \
+ {'cursor': (0, 0, 0), 'ref_key': (0, 0, 0), 'abs_ref': "S[0, 0, 0]",
+ 'rel_ref': "S[X, Y, Z]"},
+@@ -93,61 +93,61 @@
+ {'cursor': (23, 2, 1), 'ref_key': (2, 2, 2), 'abs_ref': "S[2, 2, 2]",
+ 'rel_ref': "S[X-21, Y, Z+1]"},
+ ]
+-
++
+ @params(param_get_reference)
+ def test_get_absolute_reference(self, cursor, ref_key, abs_ref, rel_ref):
+ """Unit test for _get_absolute_reference"""
+-
++
+ reference = grid.actions._get_absolute_reference(ref_key)
+-
++
+ assert reference == abs_ref
+-
++
+ @params(param_get_reference)
+ def test_get_relative_reference(self, cursor, ref_key, abs_ref, rel_ref):
+ """Unit test for _get_relative_reference"""
+-
++
+ reference = grid.actions._get_relative_reference(cursor, ref_key)
+-
++
+ assert reference == rel_ref
+-
++
+ @params(param_get_reference)
+ def test_append_reference_code(self, cursor, ref_key, abs_ref, rel_ref):
+ """Unit test for append_reference_code"""
+-
++
+ params = [
+ # Normal initial code, absolute reference
+- {'initial_code': "3 + ", 'ref_type': "absolute",
++ {'initial_code': "3 + ", 'ref_type': "absolute",
+ "res": grid.actions._get_absolute_reference(ref_key)},
+ # Normal initial code, relative reference
+- {'initial_code': "3 + ", 'ref_type': "relative",
++ {'initial_code': "3 + ", 'ref_type': "relative",
+ "res": grid.actions._get_relative_reference(cursor, ref_key)},
+ # Initial code with reference, absolute reference
+- {'initial_code': "3 + S[2, 3, 1]", 'ref_type': "absolute",
++ {'initial_code': "3 + S[2, 3, 1]", 'ref_type': "absolute",
+ "res": grid.actions._get_absolute_reference(ref_key)},
+ # Initial code with reference, relative reference
+- {'initial_code': "3 + S[2, 3, 1]", 'ref_type': "relative",
++ {'initial_code': "3 + S[2, 3, 1]", 'ref_type': "relative",
+ "res": grid.actions._get_relative_reference(cursor, ref_key)},
+ ]
+-
++
+ for param in params:
+- initial_code = param['initial_code']
++ initial_code = param['initial_code']
+ ref_type = param['ref_type']
+ res = param['res']
+-
++
+ grid.actions.set_code(cursor, initial_code)
+-
++
+ grid.actions.append_reference_code(cursor, ref_key, ref_type)
+-
++
+ wx.Yield()
+-
++
+ result_code = main_window.entry_line.GetValue()
+-
++
+ if "S[" in initial_code:
+ assert result_code == initial_code[:4] + res
+-
++
+ else:
+ assert result_code == initial_code + res
+-
++
+ param_set_cell_attr = [ \
+ {'selection': Selection([], [], [], [], [(2, 5)]), 'tab': 1,
+ 'attr': ('bordercolor_right', wx.RED), 'testcell': (2, 5, 1)},
+@@ -160,110 +160,110 @@
+ {'selection': Selection([], [], [], [], [(2, 5)]), 'tab': 2,
+ 'attr': ('pointsize', 24), 'testcell': (2, 5, 2)},
+ ]
+-
++
+ @params(param_set_cell_attr)
+ def test_set_cell_attr(self, selection, tab, attr, testcell):
+ """Unit test for _set_cell_attr"""
+-
++
+ main_window.changed_since_save = False
+-
++
+ attr = {attr[0]: attr[1]}
+-
++
+ grid.actions._set_cell_attr(selection, tab, attr)
+-
++
+ color = grid.code_array.cell_attributes[testcell][attr.keys()[0]]
+-
++
+ assert color == attr[attr.keys()[0]]
+-
++
+ wx.Yield()
+ assert main_window.changed_since_save
+-
++
+ def test_set_border_attr(self):
+ """Unit test for set_border_attr"""
+-
++
+ grid.SelectBlock(10, 10, 20, 20)
+-
++
+ attr = "borderwidth"
+ value = 5
+ borders = ["top", "inner"]
+ tests = { \
+ (13, 14, 0): 5,
+ (53, 14, 0): 1,
+- }
+-
++ }
++
+ grid.actions.set_border_attr(attr, value, borders)
+-
++
+ for cell in tests:
+ res = grid.code_array.cell_attributes[cell]["borderwidth_bottom"]
+ assert res == tests[cell]
+-
++
+ def test_toggle_attr(self):
+ """Unit test for toggle_attr"""
+-
++
+ grid.SelectBlock(10, 10, 20, 20)
+-
++
+ grid.actions.toggle_attr("underline")
+-
++
+ tests = {(13, 14, 0): True, (53, 14, 0): False}
+-
++
+ for cell in tests:
+ res = grid.code_array.cell_attributes[cell]["underline"]
+ assert res == tests[cell]
+-
+-
++
++
+ param_change_frozen_attr = [ \
+- {'cell': (0, 0, 0), 'code': None, 'result': ''},
++ {'cell': (0, 0, 0), 'code': None, 'result': None},
+ {'cell': (0, 0, 0), 'code': "'Test'", 'result': 'Test'},
+ {'cell': (2, 1, 1), 'code': "'Test'", 'result': 'Test'},
+ {'cell': (2, 1, 1), 'code': "32", 'result': 32},
+ ]
+-
++
+ @params(param_change_frozen_attr)
+ def test_change_frozen_attr(self, cell, code, result):
+ """Unit test for change_frozen_attr"""
+-
++
+ grid.actions.cursor = cell
+ grid.current_table = cell[2]
+ grid.code_array[cell] = code
+-
++
+ grid.actions.change_frozen_attr()
+-
+- res = eval(grid.code_array.cell_attributes[cell]["frozen"])
+-
++
++ res = grid.code_array.frozen_cache[repr(cell)]
++
+ assert res == result
+-
++
+ grid.actions.change_frozen_attr()
+-
++
+ res2 = grid.code_array.cell_attributes[cell]["frozen"]
+-
++
+ assert res2 == False
+-
+-
++
++
+ param_get_new_cell_attr_state = [ \
+- {'cell': (0, 0, 0), 'attr': "fontweight",
++ {'cell': (0, 0, 0), 'attr': "fontweight",
+ 'before': wx.NORMAL, 'next': wx.BOLD},
+- {'cell': (2, 1, 3), 'attr': "fontweight",
++ {'cell': (2, 1, 3), 'attr': "fontweight",
+ 'before': wx.NORMAL, 'next': wx.BOLD},
+- {'cell': (2, 1, 3), 'attr': "fontweight",
++ {'cell': (2, 1, 3), 'attr': "fontweight",
+ 'before': wx.BOLD, 'next': wx.NORMAL},
+- {'cell': (2, 1, 3), 'attr': "vertical_align",
++ {'cell': (2, 1, 3), 'attr': "vertical_align",
+ 'before': "top", 'next': "middle"},
+ ]
+-
++
+ @params(param_get_new_cell_attr_state)
+ def test_get_new_cell_attr_state(self, cell, attr, before, next):
+ """Unit test for get_new_cell_attr_state"""
+-
++
+ grid.actions.cursor = cell
+ grid.current_table = cell[2]
+-
++
+ selection = Selection([], [], [], [], [cell[:2]])
+ grid.actions.set_attr(attr, before, selection)
+-
++
+ res = grid.actions.get_new_cell_attr_state(cell, attr)
+-
++
+ assert res == next
+-
++
+ param_get_new_selection_attr_state = [ \
+ {'selection': Selection([], [], [], [], [(0, 0)]), 'cell': (0, 0, 0),
+ 'attr': "fontweight", 'before': wx.NORMAL, 'next': wx.BOLD},
+@@ -273,52 +273,52 @@
+ 'attr': "fontweight", 'before': wx.BOLD, 'next': wx.NORMAL},
+ {'selection': Selection([], [], [], [], [(2, 1)]), 'cell': (2, 1, 2),
+ 'attr': "vertical_align", 'before': "top", 'next': "middle"},
+- {'selection': Selection([(1, 0)], [(23, 2)], [], [], []),
++ {'selection': Selection([(1, 0)], [(23, 2)], [], [], []),
+ 'cell': (2, 1, 2),
+ 'attr': "vertical_align", 'before': "top", 'next': "middle"},
+ ]
+-
++
+ @params(param_get_new_selection_attr_state)
+- def test_get_new_selection_attr_state(self, cell, selection, attr,
++ def test_get_new_selection_attr_state(self, cell, selection, attr,
+ before, next):
+ """Unit test for get_new_selection_attr_state"""
+-
++
+ grid.actions.cursor = cell
+ grid.current_table = cell[2]
+-
++
+ grid.actions.set_attr(attr, before, selection)
+-
++
+ res = grid.actions.get_new_selection_attr_state(selection, attr)
+-
++
+ assert res == next
+-
++
+ def test_refresh_selected_frozen_cells(self):
+ """Unit test for refresh_selected_frozen_cells"""
+-
++
+ cell = (0, 0, 0)
+-
++
+ code1 = "1"
+ code2 = "2"
+-
++
+ grid.actions.cursor = cell
+-
++
+ # Fill cell
+ grid.code_array[cell] = code1
+-
++
+ assert grid.code_array[cell] == 1
+-
++
+ # Freeze cell
+ grid.actions.cursor = cell
+ grid.current_table = cell[2]
+ grid.actions.change_frozen_attr()
+-
+- res = eval(grid.code_array.cell_attributes[cell]["frozen"])
++
++ res = grid.code_array.frozen_cache[repr(cell)]
+ assert res == eval(code1)
+-
++
+ # Change cell code
+ grid.code_array[cell] = code2
+ assert grid.code_array[cell] == 1
+-
++
+ # Refresh cell
+ selection = Selection([], [], [], [], [cell[:2]])
+ grid.actions.refresh_selected_frozen_cells(selection=selection)
+--- a/pyspread/src/run_tests.py
++++ b/pyspread/src/run_tests.py
+@@ -32,11 +32,16 @@
+
+ from sysvars import get_program_path
+
++import wx
++app = wx.App()
++
++from src.lib.gpg import genkey
++
+ def run_tests():
+ """Looks for py.test files and runs py.test"""
+-
++
+ source_path = get_program_path() + "src/"
+-
++
+ for root, dirs, files in os.walk(source_path):
+ if root[-4:] == "test":
+ for __file in files:
+@@ -48,4 +53,7 @@
+ os.system(sys_cmd)
+
+ if __name__ == "__main__":
++
++ genkey()
++
+ run_tests()
Modified: packages/pyspread/trunk/debian/rules
===================================================================
--- packages/pyspread/trunk/debian/rules 2012-01-24 22:19:25 UTC (rev 8109)
+++ packages/pyspread/trunk/debian/rules 2012-01-24 23:04:01 UTC (rev 8110)
@@ -1,5 +1,6 @@
#!/usr/bin/make -f
PYVERS := $(shell pyversions -i)
+PYTHONPATH := $(shell pwd)/pyspread
override_dh_auto_install:
python setup.py install --root=debian/pyspread --install-layout=deb --install-lib=/usr/share/pyspread --install-scripts=/usr/share/pyspread
@@ -9,7 +10,7 @@
tests:
set -e; \
for py in $(PYVERS); do \
- PYTHONPATH=./pyspread/ $$py /usr/bin/py.test; \
+ PYTHONPATH=$(PYTHONPATH) $$py pyspread/src/run_tests.py; \
done
%:
dh $@ --with python2
More information about the Python-apps-commits
mailing list