def test_update_index(self): ws = Worksheet({}) ws.update_index(row=4, col=2, val=42) self.assertEqual(ws.size, [4, 2]) self.assertEqual(ws.index(4, 2), 42) self.assertEqual(ws.address('B4'), 42) self.assertEqual(ws.row(4)[1], 42) self.assertEqual(ws.col(2)[3], 42)
def test_ws_col(self): ws = Worksheet({'A1': {'v': 11}, 'A2': {'v': 21}, 'B1': {'v': 12}}) self.assertEqual(ws.col(col=1), [11, 21]) self.assertEqual(ws.col(2), [12, '']) self.assertEqual(ws.col(3), ['', ''])