当前位置: 首页>>代码示例>>Python>>正文


Python EggInst.arcnames方法代码示例

本文整理汇总了Python中egginst.main.EggInst.arcnames方法的典型用法代码示例。如果您正苦于以下问题:Python EggInst.arcnames方法的具体用法?Python EggInst.arcnames怎么用?Python EggInst.arcnames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在egginst.main.EggInst的用法示例。


在下文中一共展示了EggInst.arcnames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_proxy_directory

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import arcnames [as 别名]
    def test_proxy_directory(self):
        """
        Test we handle correctly entries of the form 'path some_directory'.
        """
        with mkdtemp() as prefix:
            with mock.patch("sys.executable", op.join(prefix, "python.exe")):
                egginst = EggInst(DUMMY_EGG_WITH_PROXY_SCRIPTS, prefix)
                with zipfile.ZipFile(egginst.path) as zp:
                    egginst.z = zp
                    egginst.arcnames = zp.namelist()
                    create_proxies(egginst)

                    proxied_files = [op.join(prefix, "Scripts", "dummy.dll"), op.join(prefix, "Scripts", "dummy.lib")]
                    for proxied_file in proxied_files:
                        self.assertTrue(op.exists(proxied_file))
开发者ID:cournape,项目名称:enstaller,代码行数:17,代码来源:test_scripts.py

示例2: test_proxy

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import arcnames [as 别名]
    def test_proxy(self):
        """
        Test we handle correctly entries of the form 'path PROXY'.
        """
        r_python_proxy_data_template = """\
#!"%(executable)s"
# This proxy was created by egginst from an egg with special instructions
#
import sys
import subprocess

src = %(src)r

sys.exit(subprocess.call([src] + sys.argv[1:]))
"""

        with mkdtemp() as prefix:
            pythonexe = os.path.join(prefix, "python.exe")

            proxy_path = os.path.join(
                prefix, "EGG-INFO", "dummy_with_proxy", "usr", "swig.exe"
            )
            if PY2:
                proxy_path = proxy_path.decode("utf8")
            r_python_proxy_data = r_python_proxy_data_template % \
                {'executable': pythonexe, 'src': proxy_path}

            runtime_info = self._runtime_info_factory(prefix)
            egginst = EggInst(DUMMY_EGG_WITH_PROXY, runtime_info=runtime_info)

            with ZipFile(egginst.path) as zp:
                egginst.z = zp
                egginst.arcnames = zp.namelist()
                create_proxies(egginst, pythonexe)

                python_proxy = os.path.join(prefix, "Scripts", "swig-script.py")
                coff_proxy = os.path.join(prefix, "Scripts", "swig.exe")

                self.assertTrue(os.path.exists(python_proxy))
                self.assertTrue(os.path.exists(coff_proxy))

                self.assertTrue(compute_md5(coff_proxy),
                                hashlib.md5(exe_data.cli).hexdigest())

                with open(python_proxy, "rt") as fp:
                    python_proxy_data = fp.read()
                    self.assertMultiLineEqual(python_proxy_data,
                                              r_python_proxy_data)
开发者ID:enthought,项目名称:enstaller,代码行数:50,代码来源:test_scripts.py

示例3: test_proxy

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import arcnames [as 别名]
    def test_proxy(self):
        """
        Test we handle correctly entries of the form 'path PROXY'.
        """
        r_python_proxy_data_template = """\
#!"{executable}"
# This proxy was created by egginst from an egg with special instructions
#
import sys
import subprocess

src = '{src}'

sys.exit(subprocess.call([src] + sys.argv[1:]))
"""

        with mkdtemp() as prefix:
            with mock.patch("sys.executable", os.path.join(prefix, "python.exe")):
                proxy_path = os.path.join(prefix, "EGG-INFO", "dummy_with_proxy", "usr", "swig.exe")
                r_python_proxy_data = r_python_proxy_data_template.format(
                        executable=os.path.join(prefix, "python.exe"),
                        src=escape_win32_path(proxy_path))

                egginst = EggInst(DUMMY_EGG_WITH_PROXY, prefix)
                with ZipFile(egginst.path) as zp:
                    egginst.z = zp
                    egginst.arcnames = zp.namelist()
                    create_proxies(egginst)

                    python_proxy = os.path.join(prefix, "Scripts", "swig-script.py")
                    coff_proxy = os.path.join(prefix, "Scripts", "swig.exe")

                    self.assertTrue(os.path.exists(python_proxy))
                    self.assertTrue(os.path.exists(coff_proxy))

                    self.assertTrue(md5_file(coff_proxy),
                                    hashlib.md5(exe_data.cli).hexdigest())

                    with open(python_proxy) as fp:
                        python_proxy_data = fp.read()
                        self.assertMultiLineEqual(
                                python_proxy_data,
                                r_python_proxy_data)
开发者ID:dmsurti,项目名称:enstaller,代码行数:45,代码来源:test_scripts.py


注:本文中的egginst.main.EggInst.arcnames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。