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


Python test_pip.assert_all_changes函数代码示例

本文整理汇总了Python中tests.test_pip.assert_all_changes函数的典型用法代码示例。如果您正苦于以下问题:Python assert_all_changes函数的具体用法?Python assert_all_changes怎么用?Python assert_all_changes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: _test_uninstall_editable_with_source_outside_venv

def _test_uninstall_editable_with_source_outside_venv(tmpdir):
    env = reset_env()
    result = env.run("git", "clone", local_repo("git+git://github.com/pypa/virtualenv"), tmpdir)
    result2 = run_pip("install", "-e", tmpdir)
    assert join(env.site_packages, "virtualenv.egg-link") in result2.files_created, list(result2.files_created.keys())
    result3 = run_pip("uninstall", "-y", "virtualenv", expect_error=True)
    assert_all_changes(result, result3, [env.venv / "build"])
开发者ID:rafaelcaricio,项目名称:pip,代码行数:7,代码来源:test_uninstall.py

示例2: _test_uninstall_editable_with_source_outside_venv

def _test_uninstall_editable_with_source_outside_venv(tmpdir):
    env = reset_env()
    result = env.run('git', 'clone', local_repo('git+git://github.com/pypa/virtualenv'), tmpdir)
    result2 = run_pip('install', '-e', tmpdir)
    assert (join(env.site_packages, 'virtualenv.egg-link') in result2.files_created), list(result2.files_created.keys())
    result3 = run_pip('uninstall', '-y', 'virtualenv', expect_error=True)
    assert_all_changes(result, result3, [env.venv/'build'])
开发者ID:AndreaCrotti,项目名称:pip,代码行数:7,代码来源:test_uninstall.py

示例3: test_upgrade_from_reqs_file

def test_upgrade_from_reqs_file():
    """
    Upgrade from a requirements file.

    """
    env = reset_env()
    write_file(
        "test-req.txt",
        textwrap.dedent(
            """\
        PyLogo<0.4
        # and something else to test out:
        INITools==0.3
        """
        ),
    )
    install_result = run_pip("install", "-r", env.scratch_path / "test-req.txt")
    write_file(
        "test-req.txt",
        textwrap.dedent(
            """\
        PyLogo
        # and something else to test out:
        INITools
        """
        ),
    )
    run_pip("install", "--upgrade", "-r", env.scratch_path / "test-req.txt")
    uninstall_result = run_pip("uninstall", "-r", env.scratch_path / "test-req.txt", "-y")
    assert_all_changes(install_result, uninstall_result, [env.venv / "build", "cache", env.scratch / "test-req.txt"])
开发者ID:none-da,项目名称:pip,代码行数:30,代码来源:test_upgrade.py

示例4: test_uninstall_from_reqs_file

def test_uninstall_from_reqs_file():
    """
    Test uninstall from a requirements file.

    """
    env = reset_env()
    write_file('test-req.txt', textwrap.dedent("""\
        -e %s#egg=initools-dev
        # and something else to test out:
        PyLogo<0.4
        """ % local_checkout('svn+http://svn.colorstudy.com/INITools/trunk')))
    result = run_pip('install', '-r', 'test-req.txt')
    write_file('test-req.txt', textwrap.dedent("""\
        # -f, -i, and --extra-index-url should all be ignored by uninstall
        -f http://www.example.com
        -i http://www.example.com
        --extra-index-url http://www.example.com

        -e %s#egg=initools-dev
        # and something else to test out:
        PyLogo<0.4
        """ % local_checkout('svn+http://svn.colorstudy.com/INITools/trunk')))
    result2 = run_pip('uninstall', '-r', 'test-req.txt', '-y')
    assert_all_changes(
        result, result2, [env.venv/'build', env.venv/'src', env.scratch/'test-req.txt'])
开发者ID:AndreaCrotti,项目名称:pip,代码行数:25,代码来源:test_uninstall.py

示例5: test_uninstall_overlapping_package

def test_uninstall_overlapping_package():
    """
    Uninstalling a distribution that adds modules to a pre-existing package
    should only remove those added modules, not the rest of the existing
    package.

    See: GitHub issue #355 (pip uninstall removes things it didn't install)
    """
    parent_pkg = abspath(join(here, 'packages', 'parent-0.1.tar.gz'))
    child_pkg = abspath(join(here, 'packages', 'child-0.1.tar.gz'))
    env = reset_env()
    result1 = run_pip('install', parent_pkg, expect_error=False)
    assert join(env.site_packages, 'parent') in result1.files_created, sorted(result1.files_created.keys())
    result2 = run_pip('install', child_pkg, expect_error=False)
    assert join(env.site_packages, 'child') in result2.files_created, sorted(result2.files_created.keys())
    assert normpath(join(env.site_packages, 'parent/plugins/child_plugin.py')) in result2.files_created, sorted(result2.files_created.keys())
    #the import forces the generation of __pycache__ if the version of python supports it
    env.run('python', '-c', "import parent.plugins.child_plugin, child")
    result3 = run_pip('uninstall', '-y', 'child', expect_error=False)
    assert join(env.site_packages, 'child') in result3.files_deleted, sorted(result3.files_created.keys())
    assert normpath(join(env.site_packages, 'parent/plugins/child_plugin.py')) in result3.files_deleted, sorted(result3.files_deleted.keys())
    assert join(env.site_packages, 'parent') not in result3.files_deleted, sorted(result3.files_deleted.keys())
    # Additional check: uninstalling 'child' should return things to the
    # previous state, without unintended side effects.
    assert_all_changes(result2, result3, [])
开发者ID:AndreaCrotti,项目名称:pip,代码行数:25,代码来源:test_uninstall.py

示例6: test_uninstall_from_usersite

 def test_uninstall_from_usersite(self):
     """
     Test uninstall from usersite
     """
     env = reset_env(system_site_packages=True)
     result1 = run_pip('install', '--user', 'INITools==0.3')
     result2 = run_pip('uninstall', '-y', 'INITools')
     assert_all_changes(result1, result2, [env.venv/'build', 'cache'])
开发者ID:OldBao,项目名称:pip,代码行数:8,代码来源:test_user_site.py

示例7: test_simple_uninstall

def test_simple_uninstall():
    """
    Test simple install and uninstall.

    """
    env = reset_env()
    result = run_pip('install', 'INITools==0.2', expect_error=True)
    assert join(env.site_packages, 'initools') in result.files_created, sorted(result.files_created.keys())
    result2 = run_pip('uninstall', 'INITools', '-y', expect_error=True)
    assert_all_changes(result, result2, [env.venv/'build', 'cache'])
开发者ID:B-Rich,项目名称:heroku-buildpack-python,代码行数:10,代码来源:test_uninstall.py

示例8: test_simple_uninstall

def test_simple_uninstall():
    """
    Test simple install and uninstall.

    """
    env = reset_env()
    result = run_pip("install", "INITools==0.2", expect_error=True)
    assert join(env.site_packages, "initools") in result.files_created, sorted(result.files_created.keys())
    result2 = run_pip("uninstall", "INITools", "-y", expect_error=True)
    assert_all_changes(result, result2, [env.venv / "build", "cache"])
开发者ID:none-da,项目名称:pip,代码行数:10,代码来源:test_uninstall.py

示例9: test_uninstall_easy_install_after_import

def test_uninstall_easy_install_after_import():
    """
    Uninstall an easy_installed package after it's been imported

    """
    env = reset_env()
    result = env.run('easy_install', 'INITools==0.2', expect_stderr=True)
    #the import forces the generation of __pycache__ if the version of python supports it
    env.run('python', '-c', "import initools")
    result2 = run_pip('uninstall', 'INITools', '-y')
    assert_all_changes(result, result2, [env.venv/'build', 'cache'])
开发者ID:AndreaCrotti,项目名称:pip,代码行数:11,代码来源:test_uninstall.py

示例10: test_uninstall_easy_install_after_import

def test_uninstall_easy_install_after_import():
    """
    Uninstall an easy_installed package after it's been imported

    """
    env = reset_env()
    result = env.run("easy_install", "INITools==0.2", expect_stderr=True)
    # the import forces the generation of __pycache__ if the version of python supports it
    env.run("python", "-c", "import initools")
    result2 = run_pip("uninstall", "INITools", "-y")
    assert_all_changes(result, result2, [env.venv / "build", "cache"])
开发者ID:rafaelcaricio,项目名称:pip,代码行数:11,代码来源:test_uninstall.py

示例11: test_simple_uninstall

def test_simple_uninstall():
    """
    Test simple install and uninstall.

    """
    env = reset_env()
    result = run_pip("install", "INITools==0.2")
    assert join(env.site_packages, "initools") in result.files_created, sorted(result.files_created.keys())
    # the import forces the generation of __pycache__ if the version of python supports it
    env.run("python", "-c", "import initools")
    result2 = run_pip("uninstall", "INITools", "-y")
    assert_all_changes(result, result2, [env.venv / "build", "cache"])
开发者ID:rafaelcaricio,项目名称:pip,代码行数:12,代码来源:test_uninstall.py

示例12: test_uninstall_easy_installed_console_scripts

def test_uninstall_easy_installed_console_scripts():
    """
    Test uninstalling package with console_scripts that is easy_installed.

    """
    env = reset_env()
    args = ["easy_install"]
    args.append("discover")
    result = env.run(*args, **{"expect_stderr": True})
    assert env.bin / "discover" + env.exe in result.files_created, sorted(result.files_created.keys())
    result2 = run_pip("uninstall", "discover", "-y")
    assert_all_changes(result, result2, [env.venv / "build", "cache"])
开发者ID:rafaelcaricio,项目名称:pip,代码行数:12,代码来源:test_uninstall.py

示例13: test_uninstall_before_upgrade_from_url

def test_uninstall_before_upgrade_from_url():
    """
    Automatic uninstall-before-upgrade from URL.

    """
    env = reset_env()
    result = run_pip('install', 'INITools==0.2', expect_error=True)
    assert env.site_packages/ 'initools' in result.files_created, sorted(result.files_created.keys())
    result2 = run_pip('install', 'http://pypi.python.org/packages/source/I/INITools/INITools-0.3.tar.gz', expect_error=True)
    assert result2.files_created, 'upgrade to INITools 0.3 failed'
    result3 = run_pip('uninstall', 'initools', '-y', expect_error=True)
    assert_all_changes(result, result3, [env.venv/'build', 'cache'])
开发者ID:AndreaCrotti,项目名称:pip,代码行数:12,代码来源:test_upgrade.py

示例14: test_uninstall_before_upgrade

def test_uninstall_before_upgrade():
    """
    Automatic uninstall-before-upgrade.

    """
    env = reset_env()
    result = run_pip('install', 'INITools==0.2', expect_error=True)
    assert env.site_packages/ 'initools' in result.files_created, sorted(result.files_created.keys())
    result2 = run_pip('install', 'INITools==0.3', expect_error=True)
    assert result2.files_created, 'upgrade to INITools 0.3 failed'
    result3 = run_pip('uninstall', 'initools', '-y', expect_error=True)
    assert_all_changes(result, result3, [env.venv/'build', 'cache'])
开发者ID:AndreaCrotti,项目名称:pip,代码行数:12,代码来源:test_upgrade.py

示例15: test_uninstall_before_upgrade

def test_uninstall_before_upgrade():
    """
    Automatic uninstall-before-upgrade.

    """
    env = reset_env()
    result = run_pip("install", "INITools==0.2", expect_error=True)
    assert env.site_packages / "initools" in result.files_created, sorted(result.files_created.keys())
    result2 = run_pip("install", "INITools==0.3", expect_error=True)
    assert result2.files_created, "upgrade to INITools 0.3 failed"
    result3 = run_pip("uninstall", "initools", "-y", expect_error=True)
    assert_all_changes(result, result3, [env.venv / "build", "cache"])
开发者ID:none-da,项目名称:pip,代码行数:12,代码来源:test_upgrade.py


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