def test_append_2d_list(self): ws = Worksheet(self.wb) ws.append(['This is A1', 'This is B1']) ws.append(['This is A2', 'This is B2']) vals = ws.range('A1:B2') eq_((('This is A1', 'This is B1'), ('This is A2', 'This is B2'),), flatten(vals))
def test_append_2d_list(self, Worksheet): ws = Worksheet(Workbook()) ws.append(['This is A1', 'This is B1']) ws.append(['This is A2', 'This is B2']) vals = ws.iter_rows('A1:B2') expected = ( ('This is A1', 'This is B1'), ('This is A2', 'This is B2'), ) for e, v in zip(expected, flatten(vals)): assert e == tuple(v)
def test_append_2d_list(self): ws = Worksheet(self.wb) ws.append(['This is A1', 'This is B1']) ws.append(['This is A2', 'This is B2']) vals = ws.iter_rows('A1:B2') expected = ( ('This is A1', 'This is B1'), ('This is A2', 'This is B2'), ) for e, v in zip(expected, flatten(vals)): assert e == tuple(v)
def test_append_2d_list(self): ws = Worksheet(self.wb) ws.append(['This is A1', 'This is B1']) ws.append(['This is A2', 'This is B2']) vals = ws.range('A1:B2') expected = ( ('This is A1', 'This is B1'), ('This is A2', 'This is B2'), ) for e, v in zip(expected, flatten(vals)): assert e == tuple(v)
def extract_data(self, worksheet): return flatten(worksheet.rows)