<commit_before>import os
import sys
import textwrap
from os.path import abspath, join, curdir, pardir

from nose import SkipTest
from pip.util import rmtree
from tests.lib import tests_data, reset_env, run_pip, pyversion, mkdir, pip_install_local, write_file, find_links
from tests.lib.local_repos import local_checkout
from tests.lib.path import Path


def test_pip_second_command_line_interface_works():
    """
    Check if ``pip-<PYVERSION>`` commands behaves equally
    """
    e = reset_env()

    args = ['pip-%s' % pyversion]
    args.extend(['install', 'INITools==0.2'])
    result = e.run(*args)
    egg_info_folder = e.site_packages / 'INITools-0.2-py%s.egg-info' % pyversion
    initools_folder = e.site_packages / 'initools'
    assert egg_info_folder in result.files_created, str(result)
    assert initools_folder in result.files_created, str(result)


#def test_distutils_configuration_setting():
#    """
#    Test the distutils-configuration-setting command (which is distinct from other commands).
#    """
    #print run_pip('-vv', '--distutils-cfg=easy_install:index_url:http://download.zope.org/ppix/', expect_error=True)
    #Script result: python ../../poacheggs.py -E .../poacheggs-tests/test-scratch -vv --distutils-cfg=easy_install:index_url:http://download.zope.org/ppix/
    #-- stdout: --------------------
    #Distutils config .../poacheggs-tests/test-scratch/lib/python.../distutils/distutils.cfg is writable
    #Replaced setting index_url
    #Updated .../poacheggs-tests/test-scratch/lib/python.../distutils/distutils.cfg
    #<BLANKLINE>
    #-- updated: -------------------
    #  lib/python2.4/distutils/distutils.cfg  (346 bytes)


def test_install_from_pypi():
    """
    Test installing a package from PyPI.
    """
    e = reset_env()
    result = run_pip('install', '-vvv', 'INITools==0.2')
    egg_info_folder = e.site_packages / 'INITools-0.2-py%s.egg-info' % pyversion
    initools_folder = e.site_packages / 'initools'
    assert egg_info_folder in result.files_created, str(result)
    assert initools_folder in result.files_created, str(result)


def test_editable_install():
    """
    Test editable installation.
    """
    reset_env()
    result = run_pip('install', '-e', 'INITools==0.2', expect_error=True)
    assert "INITools==0.2 should either by a path to a local project or a VCS url" in result.stdout
    assert len(result.files_created) == 1, result.files_created
    assert not result.files_updated, result.files_updated<commit_msg>remove old test that mistakenly resurfaced during merging<commit_after>import os
import sys
import textwrap
from os.path import abspath, join, curdir, pardir

from nose import SkipTest
from pip.util import rmtree
from tests.lib import tests_data, reset_env, run_pip, pyversion, mkdir, pip_install_local, write_file, find_links
from tests.lib.local_repos import local_checkout
from tests.lib.path import Path


def test_pip_second_command_line_interface_works():
    """
    Check if ``pip-<PYVERSION>`` commands behaves equally
    """
    e = reset_env()

    args = ['pip-%s' % pyversion]
    args.extend(['install', 'INITools==0.2'])
    result = e.run(*args)
    egg_info_folder = e.site_packages / 'INITools-0.2-py%s.egg-info' % pyversion
    initools_folder = e.site_packages / 'initools'
    assert egg_info_folder in result.files_created, str(result)
    assert initools_folder in result.files_created, str(result)


def test_install_from_pypi():
    """
    Test installing a package from PyPI.
    """
    e = reset_env()
    result = run_pip('install', '-vvv', 'INITools==0.2')
    egg_info_folder = e.site_packages / 'INITools-0.2-py%s.egg-info' % pyversion
    initools_folder = e.site_packages / 'initools'
    assert egg_info_folder in result.files_created, str(result)
    assert initools_folder in result.files_created, str(result)


def test_editable_install():
    """
    Test editable installation.
    """
    reset_env()
    result = run_pip('install', '-e', 'INITools==0.2', expect_error=True)
    assert "INITools==0.2 should either by a path to a local project or a VCS url" in result.stdout
    assert len(result.files_created) == 1, result.files_created
    assert not result.files_updated, result.files_updated
{'fraction_non_alphanumeric': 0.12741859367626238, 'fraction_numerical': 0.0073147711184521, 'mean_word_length': 3.8006795016987542, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5878810', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1365, 'n_words': 328}