def test_read_hyperlinks_read_only(datadir, Workbook, ReadOnlyWorksheet): datadir.join("reader").chdir() filename = 'bug328_hyperlinks.xml' wb = Workbook() wb._read_only = True wb._data_only = True ws = ReadOnlyWorksheet(wb, "Sheet", "", filename, ['SOMETEXT']) assert ws['F2'].value is None
def test_cannot_copy_readonly(self, Workbook): wb = Workbook() ws = wb.active wb._read_only = True with pytest.raises(ValueError): wb.copy_worksheet(ws)
def test_create_sheet_readonly(Workbook): wb = Workbook() wb._read_only = True with pytest.raises(ReadOnlyWorkbookException): wb.create_sheet()