'Check that is_zipfile() correctly identifies zip files.'

def test_is_zip_valid_file(self):

    with zipfile.ZipFile(TESTFN, mode='w') as zipf:
        zipf.writestr('foo.txt', 'O,    for    a    Muse    of    Fire!')
    self.assertTrue(zipfile.is_zipfile(TESTFN))
    with open(TESTFN, 'rb') as fp:
        self.assertTrue(zipfile.is_zipfile(fp))
        fp.seek(0, 0)
        zip_contents = fp.read()
    fp = io.BytesIO()
    fp.write(zip_contents)
    self.assertTrue(zipfile.is_zipfile(fp))
    fp.seek(0, 0)
    self.assertTrue(zipfile.is_zipfile(fp))
