def test_cannot_copy_readonly(self): wb = Workbook() ws = wb.active wb._read_only = True with pytest.raises(ValueError): wb.copy_worksheet(ws)
def test_create_sheet_readonly(): wb = Workbook() wb._read_only = True with pytest.raises(ReadOnlyWorkbookException): wb.create_sheet()