Ejemplo n.º 1
0
def test_excel_change_geometry():

    start_state = read_text("""\
# Meal #0
3
2

1
0

# Meal #1
3
2

1
0
# Meal #2
2
1

0
""")

    assert dump(start_state) == """\
# Meal #0
   [2 3]
   [0 1]
# Meal #1
   [2 3]
   [0 1]
# Meal #2
   [1 2]
   [0]
"""

    rb = open_workbook(file_contents=(write_excel(start_state)))

    assert int(rb.sheet_by_index(1).cell(0, 1).value) == 2

    wb = copy(rb)
    wb.get_sheet(1).write(0, 1, 3)
    result = BytesIO()
    wb.save(result)
    new_state = read_excel(result.getvalue())

    assert dump(new_state) == """\
Ejemplo n.º 2
0
 def excel(self):
     return write_excel(self.state_keeper.get_current_state())
Ejemplo n.º 3
0
def test_excel(initial):
    excel_content = write_excel(initial)
    actual = read_excel(excel_content)
    _assert_same_state(initial, actual)
Ejemplo n.º 4
0
 def excel(self):
     return write_excel(self.state_keeper.get_current_state())