def test_toxlsx_appendxlsx(xlsx_test_table): # setup f = NamedTemporaryFile(delete=True, suffix='.xlsx') f.close() # test toxlsx toxlsx(xlsx_test_table, f.name, 'Sheet1') actual = fromxlsx(f.name, 'Sheet1') ieq(xlsx_test_table, actual) # test appendxlsx appendxlsx(xlsx_test_table, f.name, 'Sheet1') expect = etl.cat(xlsx_test_table, xlsx_test_table) ieq(expect, actual)
def test_appendxlsx_with_non_str_header(xlsx_table_with_non_str_header, xlsx_test_table): f = NamedTemporaryFile(delete=True, suffix='.xlsx') f.close() # write first table toxlsx(xlsx_test_table, f.name, 'Sheet1') actual = fromxlsx(f.name, 'Sheet1') ieq(xlsx_test_table, actual) # test appendxlsx appendxlsx(xlsx_table_with_non_str_header, f.name, 'Sheet1') expect = etl.cat(xlsx_test_table, xlsx_table_with_non_str_header) ieq(expect, actual)
def test_toxlsx_appendxlsx(): # setup tbl = (('foo', 'bar'), ('A', 1), ('B', 2), ('C', 2), (u'é', datetime(2012, 1, 1))) f = NamedTemporaryFile(delete=True, suffix='.xlsx') f.close() # test toxlsx toxlsx(tbl, f.name, 'Sheet1') actual = fromxlsx(f.name, 'Sheet1') ieq(tbl, actual) # test appendxlsx appendxlsx(tbl, f.name, 'Sheet1') expect = etl.cat(tbl, tbl) ieq(expect, actual)