def test03_dump_multi_file_max_size(self):
        rl=ResourceList()
        for letter in map(chr,range(ord('a'),ord('l')+1)):
            uri='http://ex.org/%s' % (letter)
            fname='tests/testdata/a_to_z/%s' % (letter)
            rl.add( Resource(uri, path=fname) )
        self.assertEqual( len(rl), 12 )
        #d=Dump(rl) 
        #tmpdir=tempfile.mkdtemp()
        #tmpbase=os.path.join(tmpdir,'base')
        #d.max_size=2000 # start new zip after size exceeds 2000 bytes
        #n=d.write(tmpbase)
        #self.assertEqual( n, 2, 'expect to write 2 dump files' )
        # 
        # Now repeat with large size limit but small number of files limit
        d2=Dump(rl) 
        tmpbase=os.path.join(self.tmpdir,'test03_')
        d2.max_files=4
        n=d2.write(tmpbase)
        self.assertEqual( n, 3, 'expect to write 3 dump files' )
        self.assertTrue( os.path.isfile(tmpbase+'00000.zip') )
        self.assertTrue( os.path.isfile(tmpbase+'00001.zip') )
        self.assertTrue( os.path.isfile(tmpbase+'00002.zip') )
        # Look at the first file in detail
        zipf=tmpbase+'00000.zip'
        zo=zipfile.ZipFile(zipf,'r')
        self.assertEqual( zo.namelist(), ['manifest.xml','a','b','c','d'] )
        #self.assertEqual( zo.getinfo('manifest.xml').file_size, 470 )
        self.assertEqual( zo.getinfo('a').file_size, 9 )
        self.assertEqual( zo.getinfo('b').file_size, 1116 )
        self.assertEqual( zo.getinfo('c').file_size, 32 )
        self.assertEqual( zo.getinfo('d').file_size, 13 )
        zo.close()
        os.unlink(zipf)
        # Check second and third files have expected contents
        zipf=tmpbase+'00001.zip'
        zo=zipfile.ZipFile(zipf,'r')
        self.assertEqual( zo.namelist(), ['manifest.xml','e','f','g','h'] )
        zo.close()
        os.unlink(zipf)
        zipf=tmpbase+'00002.zip'
        zo=zipfile.ZipFile(zipf,'r')
        self.assertEqual( zo.namelist(), ['manifest.xml','i','j','k','l'] )
        zo.close()
        os.unlink(zipf)
dataset/ETHPy150Open resync/resync/tests/test_dump.py/TestDump.test03_dump_multi_file_max_size/original