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


Python PEX.site_libs方法代码示例

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


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

示例1: test_site_libs

# 需要导入模块: from pex.pex import PEX [as 别名]
# 或者: from pex.pex.PEX import site_libs [as 别名]
def test_site_libs():
  with nested(mock.patch.object(PEX, '_get_site_packages'), temporary_dir()) as (
          mock_site_packages, tempdir):
    site_packages = os.path.join(tempdir, 'site-packages')
    os.mkdir(site_packages)
    mock_site_packages.return_value = set([site_packages])
    site_libs = PEX.site_libs()
    assert site_packages in site_libs
开发者ID:clam-gpsw,项目名称:pex,代码行数:10,代码来源:test_pex.py

示例2: test_site_libs_excludes_prefix

# 需要导入模块: from pex.pex import PEX [as 别名]
# 或者: from pex.pex.PEX import site_libs [as 别名]
def test_site_libs_excludes_prefix():
  """Windows returns sys.prefix as part of getsitepackages(). Make sure to exclude it."""

  with nested(mock.patch.object(PEX, '_get_site_packages'), temporary_dir()) as (
          mock_site_packages, tempdir):
    site_packages = os.path.join(tempdir, 'site-packages')
    os.mkdir(site_packages)
    mock_site_packages.return_value = set([site_packages, sys.prefix])
    site_libs = PEX.site_libs()
    assert site_packages in site_libs
    assert sys.prefix not in site_libs
开发者ID:clam-gpsw,项目名称:pex,代码行数:13,代码来源:test_pex.py

示例3: test_site_libs_symlink

# 需要导入模块: from pex.pex import PEX [as 别名]
# 或者: from pex.pex.PEX import site_libs [as 别名]
def test_site_libs_symlink():
  with nested(mock.patch.object(PEX, '_get_site_packages'), temporary_dir()) as (
          mock_site_packages, tempdir):
    site_packages = os.path.join(tempdir, 'site-packages')
    os.mkdir(site_packages)
    site_packages_link = os.path.join(tempdir, 'site-packages-link')
    os.symlink(site_packages, site_packages_link)
    mock_site_packages.return_value = set([site_packages_link])

    site_libs = PEX.site_libs()
    assert os.path.realpath(site_packages) in site_libs
    assert site_packages_link in site_libs
开发者ID:clam-gpsw,项目名称:pex,代码行数:14,代码来源:test_pex.py


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