'Check that zipfiles with missing bytes at the end raise BadZipFile.'

def test_damaged_zipfile(self):

    fp = io.BytesIO()
    with zipfile.ZipFile(fp, mode='w') as zipf:
        zipf.writestr('foo.txt', 'O,    for    a    Muse    of    Fire!')
    zipfiledata = fp.getvalue()
    for N in range(len(zipfiledata)):
        fp = io.BytesIO(zipfiledata[:N])
        self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, fp)
