Example #1
0
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
Example #2
0
 def test_cannot_copy_readonly(self, Workbook):
     wb = Workbook()
     ws = wb.active
     wb._read_only = True
     with pytest.raises(ValueError):
         wb.copy_worksheet(ws)
Example #3
0
def test_create_sheet_readonly(Workbook):
    wb = Workbook()
    wb._read_only = True
    with pytest.raises(ReadOnlyWorkbookException):
        wb.create_sheet()