Beispiel #1
0
 def test_invalid_cell(self, Worksheet):
     wb = Workbook()
     ws = Worksheet(wb)
     with pytest.raises(ValueError):
         cell = ws.cell(row=0, column=0)
Beispiel #2
0
 def test_get_cell(self, Worksheet):
     ws = Worksheet(Workbook())
     cell = ws.cell(row=1, column=1)
     assert cell.coordinate == 'A1'
Beispiel #3
0
 def test_get_row(self, Worksheet, key):
     ws = Worksheet(Workbook())
     a2 = ws.cell(row=2, column=1)
     b2 = ws.cell(row=2, column=2)
     c2 = ws.cell(row=2, column=3, value=5)
     assert ws[key] == (a2, b2, c2)
Beispiel #4
0
 def test_get_single__column(self, Worksheet, key):
     ws = Worksheet(Workbook())
     c1 = ws.cell(row=1, column=3)
     c2 = ws.cell(row=2, column=3, value=5)
     assert ws["C"] == (c1, c2)
Beispiel #5
0
 def test_cell_insufficient_coordinates(self, Worksheet):
     ws = Worksheet(Workbook())
     with pytest.raises(TypeError):
         ws.cell(row=8)
Beispiel #6
0
 def test_cell_alternate_coordinates(self, Worksheet):
     ws = Worksheet(Workbook())
     cell = ws.cell(row=8, column=4)
     assert 'D8' == cell.coordinate