'Regression test 2 for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/154
Manually adding an END card to a header should simply result in a
ValueError (as was the case in PyFITS 3.0 and earlier).'

def test_append_end_card(self):

    header = fits.Header([('A', 'B', 'C'), ('D', 'E', 'F')])
    def setitem(k, v):
        header[k] = v
    pytest.raises(ValueError, setitem, 'END', '')
    pytest.raises(ValueError, header.append, 'END')
    pytest.raises(ValueError, header.append, 'END', end=True)
    pytest.raises(ValueError, header.insert, len(header), 'END')
    pytest.raises(ValueError, header.set, 'END')
