def test_xlsx_types(self, open_workbook, ext): with open_workbook(get_file('types', ext)) as workbook: self.assert_workbooks_equal( workbook, Workbook(worksheets=[ make_worksheet(title='Sheet1', rows=[ ['String', 'Danny'], ['Date', date(1988, 7, 7)], ['Date Time', datetime(2016, 1, 1, 12, 0)], ['Time', time(12, 0)], [ 'Midnight', date(1899, 12, 30) if ext == 'xlsx' else time(0, 0) ], ['Int', 28], ['Int.0', 5], ['Float', 5.1], ['Bool-F', False], ['Bool-T', True], ['Empty', None], ['Percent', 0.49], ['Calculation', 2], ['Styled', 'Styled'], ['Empty Date', None], ]), ]))
def test_csv_types(self, open_workbook, ext): with open_workbook(get_file('types', ext)) as workbook: self.assert_workbooks_equal( workbook, Workbook( worksheets=[ make_worksheet(title='Sheet1', rows=[ ['String', 'Danny'], ['Date', '7/7/1988'], ['Date Time', '1/1/2016 12:00'], ['Time', '12:00 PM'], ['Midnight', '12:00 AM'], ['Int', '28'], ['Int.0', '5.0'], ['Float', '5.1'], ['Bool-F', 'FALSE'], ['Bool-T', 'TRUE'], ['Empty', ''], ['Percent', '49%'], ['Calculation', '2'], ['Styled', 'Sطαйλד tэξţ'], ['Empty Date', ''], ]), ] ) )
def to_workbook(self): rows = [] # Loop through the rows, and add each row's contents to rows. for row in csv.reader(self._file, delimiter=","): rows.append(row) return Workbook(worksheets=[make_worksheet(rows, title='Sheet1')])
def to_workbook(self): return Workbook(worksheets=[ _XLSXWorksheetAdaptor(worksheet).to_worksheet() for worksheet in self._workbook.worksheets ])
def to_workbook(self): return Workbook(worksheets=[ _XLSWorksheetAdaptor(worksheet).to_worksheet() for worksheet in self._book.sheets() ])