Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.

Commit

Permalink
A new test for split panes and a correction of the result for frozen …
Browse files Browse the repository at this point in the history
…panes that will pass once python-excel/xlwt#8 is resolved.
  • Loading branch information
cjw296 committed Apr 5, 2013
1 parent be526a3 commit d2ba7b8
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions xlutils/tests/test_filter.py
Expand Up @@ -1236,6 +1236,39 @@ def test_panes(self):
self.assertEqual(2,sheet.horz_split_pos)
self.assertEqual(3,sheet.vert_split_first_visible)
self.assertEqual(4,sheet.horz_split_first_visible)
# for splits, this is a magic value, and is computed
# by xlwt.
self.assertEqual(0,sheet.split_active_pane)

def test_splits(self):
r = TestReader()
r.formatting_info = True

r.setup(('sheet',[['S1R0C0']]))

book = tuple(r.get_workbooks())[0][0]
sheet = book.sheet_by_index(0)
sheet.panes_are_frozen = 0
sheet.has_pane_record = True
sheet.vert_split_pos = 1
sheet.horz_split_pos = 2
sheet.vert_split_first_visible = 3
sheet.horz_split_first_visible = 4
sheet.split_active_pane = 3

w = TestWriter()
r(w)

self.assertEqual(w.files.keys(),['test.xls'])
f = w.files['test.xls'].file
a = open_workbook(file_contents=f.read(),formatting_info=1)
sheet = a.sheet_by_index(0)
self.assertEqual(0,sheet.panes_are_frozen)
self.assertEqual(1,sheet.has_pane_record)
self.assertEqual(1,sheet.vert_split_pos)
self.assertEqual(2,sheet.horz_split_pos)
self.assertEqual(3,sheet.vert_split_first_visible)
self.assertEqual(4,sheet.horz_split_first_visible)
self.assertEqual(3,sheet.split_active_pane)

def test_zoom_factors(self):
Expand Down

0 comments on commit d2ba7b8

Please sign in to comment.