'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!')
    chk = zipfile.is_zipfile(TESTFN)
    self.assertTrue(chk)
    with open(TESTFN, 'rb') as fp:
        chk = zipfile.is_zipfile(fp)
        self.assertTrue(chk)
        fp.seek(0, 0)
        zip_contents = fp.read()
    fp = StringIO()
    fp.write(zip_contents)
    chk = zipfile.is_zipfile(fp)
    self.assertTrue(chk)
    fp.seek(0, 0)
    chk = zipfile.is_zipfile(fp)
    self.assertTrue(chk)
