Example #1
0
def test_freeze_bazaar_clone():
    """
    Test freezing a Bazaar clone.

    """

    checkout_path = local_checkout('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1')
    #bzr internally stores windows drives as uppercase; we'll match that.
    checkout_pathC = checkout_path.replace('c:', 'C:')

    reset_env()
    env = get_env()
    result = env.run('bzr', 'checkout', '-r', '174',
                     local_repo('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'),
                     'django-wikiapp')
    result = env.run('python', 'setup.py', 'develop',
            cwd=env.scratch_path/'django-wikiapp')
    result = run_pip('freeze', expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze
        -- stdout: --------------------
        ...-e %s@...#egg=django_wikiapp-...
        ...""" % checkout_pathC)
    _check_output(result, expected)

    result = run_pip('freeze', '-f',
                     '%s/#egg=django-wikiapp' % checkout_path,
                     expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze -f %(repo)s/#egg=django-wikiapp
        -- stdout: --------------------
        -f %(repo)s/#egg=django-wikiapp
        ...-e %(repoC)s@...#egg=django_wikiapp-...
        ...""" % {'repoC': checkout_pathC, 'repo': checkout_path})
    _check_output(result, expected)
Example #2
0
def test_freeze_mercurial_clone():
    """
    Test freezing a Mercurial clone.

    """
    reset_env()
    env = get_env()
    result = env.run('hg', 'clone',
                     '-r', 'c9963c111e7c',
                     local_repo('hg+http://bitbucket.org/pypa/pip-test-package'),
                     'pip-test-package')
    result = env.run('python', 'setup.py', 'develop',
            cwd=env.scratch_path/'pip-test-package', expect_stderr=True)
    result = run_pip('freeze', expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze
        -- stdout: --------------------
        ...-e %s@...#egg=pip_test_package-...
        ...""" % local_checkout('hg+http://bitbucket.org/pypa/pip-test-package'))
    _check_output(result, expected)

    result = run_pip('freeze', '-f',
                     '%s#egg=pip_test_package' % local_checkout('hg+http://bitbucket.org/pypa/pip-test-package'),
                     expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze -f %(repo)s#egg=pip_test_package
        -- stdout: --------------------
        -f %(repo)s#egg=pip_test_package
        ...-e %(repo)s@...#egg=pip_test_package-dev
        ...""" % {'repo': local_checkout('hg+http://bitbucket.org/pypa/pip-test-package')})
    _check_output(result, expected)
Example #3
0
def setup_completion(words, cword):
    environ = os.environ.copy()
    reset_env(environ)
    environ['PIP_AUTO_COMPLETE'] = '1'
    environ['COMP_WORDS'] = words
    environ['COMP_CWORD'] = cword
    env = get_env()

    # expect_error is True because autocomplete exists with 1 status code
    result = env.run('python', '-c', 'import pip;pip.autocomplete()',
            expect_error=True)

    return result, env
Example #4
0
def test_freeze_bazaar_clone():
    """
    Test freezing a Bazaar clone.

    """

    checkout_path = local_checkout(
        'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'
    )
    #bzr internally stores windows drives as uppercase; we'll match that.
    checkout_pathC = checkout_path.replace('c:', 'C:')

    reset_env()
    env = get_env()
    result = env.run(
        'bzr', 'checkout', '-r', '174',
        local_repo(
            'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'
        ), 'django-wikiapp')
    result = env.run('python',
                     'setup.py',
                     'develop',
                     cwd=env.scratch_path / 'django-wikiapp')
    result = run_pip('freeze', expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze
        -- stdout: --------------------
        ...-e %s@...#egg=django_wikiapp-...
        ...""" % checkout_pathC)
    _check_output(result, expected)

    result = run_pip('freeze',
                     '-f',
                     '%s/#egg=django-wikiapp' % checkout_path,
                     expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze -f %(repo)s/#egg=django-wikiapp
        -- stdout: --------------------
        -f %(repo)s/#egg=django-wikiapp
        ...-e %(repoC)s@...#egg=django_wikiapp-...
        ...""" % {
        'repoC': checkout_pathC,
        'repo': checkout_path
    })
    _check_output(result, expected)
Example #5
0
def test_freeze_mercurial_clone():
    """
    Test freezing a Mercurial clone.

    """
    reset_env()
    env = get_env()
    result = env.run(
        'hg', 'clone', '-r', 'c9963c111e7c',
        local_repo('hg+http://bitbucket.org/pypa/pip-test-package'),
        'pip-test-package')
    result = env.run('python',
                     'setup.py',
                     'develop',
                     cwd=env.scratch_path / 'pip-test-package',
                     expect_stderr=True)
    result = run_pip('freeze', expect_stderr=True)
    expected = textwrap.dedent(
        """\
        Script result: ...pip freeze
        -- stdout: --------------------
        ...-e %s@...#egg=pip_test_package-...
        ...""" %
        local_checkout('hg+http://bitbucket.org/pypa/pip-test-package'))
    _check_output(result, expected)

    result = run_pip(
        'freeze',
        '-f',
        '%s#egg=pip_test_package' %
        local_checkout('hg+http://bitbucket.org/pypa/pip-test-package'),
        expect_stderr=True)
    expected = textwrap.dedent("""\
        Script result: ...pip freeze -f %(repo)s#egg=pip_test_package
        -- stdout: --------------------
        -f %(repo)s#egg=pip_test_package
        ...-e %(repo)s@...#egg=pip_test_package-dev
        ...""" % {
        'repo':
        local_checkout('hg+http://bitbucket.org/pypa/pip-test-package')
    })
    _check_output(result, expected)