예제 #1
0
 def _test_create_scripts(self, executable, r_list):
     res = create_scripts({"foo": executable}, self.build_node)
     nodes = res["foo"]
     self.assertEqual(set(self.build_node.listdir()), set(r_list))
     self.assertEqual(
         set([node.path_from(self.build_node) for node in nodes]),
         set(r_list))
예제 #2
0
        create_scripts

if __name__ == "__main__":
    import tempfile

    TMPDIR = tempfile.mkdtemp()
    try:
        EGG_PATH = sys.argv[1]

        zid = zipfile.ZipFile(EGG_PATH)
        try:
            zid.extractall(path=TMPDIR)
        finally:
            zid.close()
        ipkg = InstalledPkgDescription.from_egg(EGG_PATH)

        # Build executables
        bdir = os.path.join(TMPDIR, "SCRIPTS")
        os.makedirs(bdir)
        create_scripts(ipkg.executables, bdir)
        # XXX: use internal API
        for k in ipkg.files["executables"]:
            ipkg.files["executables"][k].source_dir = bdir

        meta = PackageMetadata.from_ipkg(ipkg)
        wininst = wininst_filename(meta.fullname)
        create_wininst(ipkg, src_root_dir=TMPDIR, wininst=wininst)
    finally:
        #shutil.rmtree(TMPDIR)
        pass
예제 #3
0
 def _test_create_scripts(self, executable, r_list):
     res = create_scripts({"foo": executable}, self.build_node)
     nodes = res["foo"]
     self.assertEqual(set(self.build_node.listdir()), set(r_list))
     self.assertEqual(set([node.path_from(self.build_node) for node in nodes]), set(r_list))