'Verify that testzip() doesn\'t swallow inappropriate exceptions.'

def test_closed_zip_raises_RuntimeError(self):

    data = StringIO()
    with zipfile.ZipFile(data, mode='w') as zipf:
        zipf.writestr('foo.txt', 'O,    for    a    Muse    of    Fire!')
    self.assertRaises(RuntimeError, zipf.read, 'foo.txt')
    self.assertRaises(RuntimeError, zipf.open, 'foo.txt')
    self.assertRaises(RuntimeError, zipf.testzip)
    self.assertRaises(RuntimeError, zipf.writestr, 'bogus.txt', 'bogus')
    open(TESTFN, 'w').write('zipfile    test    data')
    self.assertRaises(RuntimeError, zipf.write, TESTFN)
