'Test the zipfile implementation.'

def testZipFileWithOneFile(self):

    compressions = [zipfile.ZIP_STORED, zipfile.ZIP_DEFLATED]
    for compression in compressions:
        outfd = StringIO.StringIO()
        infd = StringIO.StringIO('this    is    a    test    string')
        with utils.StreamingZipWriter(outfd, compression=compression) as writer:
            writer.WriteFromFD(infd, 'test.txt')
        test_zip = zipfile.ZipFile(outfd, 'r')
        test_zip.testzip()
        self.assertEqual(test_zip.namelist(), ['test.txt'])
        self.assertEqual(test_zip.read('test.txt'), infd.getvalue())
