def __init__(self, parent_workbook, title, worksheet_path, xml_source, string_table, style_table): Worksheet.__init__(self, parent_workbook, title) self.worksheet_path = worksheet_path ReadOnlyCell.set_string_table(string_table) ReadOnlyCell.set_style_table(style_table) ReadOnlyCell.set_base_date(parent_workbook.excel_base_date) dimensions = read_dimension(self.xml_source) if dimensions is not None: self.min_col, self.min_row, self.max_col, self.max_row = dimensions
def DummyCell(): class DummyNumberFormat: format_code = 'd-mmm-yy' class DummyStyle(object): number_format = DummyNumberFormat() style_table = {1: DummyStyle()} cell = ReadOnlyCell(None, None, "23596", 'n', '1') cell.set_style_table(style_table) return cell
def DummyCell(): class DummyNumberFormat: format_code = 'd-mmm-yy' class DummyStyle(object): number_format = DummyNumberFormat() style_table = {1:DummyStyle()} cell = ReadOnlyCell(None, None, "23596", 'n', '1') cell.set_style_table(style_table) return cell
def test_style_table(): ReadOnlyCell.set_style_table({}) cell = ReadOnlyCell(None, None, 10, 'n') assert cell.style_table == {}
def test_style_table(): ReadOnlyCell.set_style_table({}) cell = ReadOnlyCell(None, None, 10, 'n') assert cell.style_table == {}