mirror of https://github.com/pypa/pip
add test for --egg option
This commit is contained in:
parent
93cd6b1620
commit
66ff8e0568
|
@ -302,6 +302,20 @@ def test_install_from_local_directory_with_no_setup_py():
|
|||
assert "is not installable. File 'setup.py' not found." in result.stdout
|
||||
|
||||
|
||||
def test_install_as_egg():
|
||||
"""
|
||||
Test installing as egg, instead of flat install.
|
||||
"""
|
||||
env = reset_env()
|
||||
to_install = abspath(join(here, 'packages', 'FSPkg'))
|
||||
result = run_pip('install', to_install, '--egg', expect_error=False)
|
||||
fspkg_folder = env.site_packages/'fspkg'
|
||||
egg_folder = env.site_packages/'FSPkg-0.1dev-py%s.egg' % pyversion
|
||||
assert fspkg_folder not in result.files_created, str(result.stdout)
|
||||
assert egg_folder in result.files_created, str(result)
|
||||
assert join(egg_folder, 'fspkg') in result.files_created, str(result)
|
||||
|
||||
|
||||
def test_install_curdir():
|
||||
"""
|
||||
Test installing current directory ('.').
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import textwrap
|
||||
import sys
|
||||
from os.path import join
|
||||
from os.path import join, abspath
|
||||
from tempfile import mkdtemp
|
||||
from tests.test_pip import reset_env, run_pip, assert_all_changes, write_file
|
||||
from tests.test_pip import here, reset_env, run_pip, assert_all_changes, write_file, pyversion
|
||||
from tests.local_repos import local_repo, local_checkout
|
||||
|
||||
from pip.util import rmtree
|
||||
|
@ -137,3 +137,21 @@ def test_uninstall_from_reqs_file():
|
|||
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'])
|
||||
|
||||
|
||||
def test_uninstall_as_egg():
|
||||
"""
|
||||
Test uninstall package installed as egg.
|
||||
|
||||
"""
|
||||
env = reset_env()
|
||||
to_install = abspath(join(here, 'packages', 'FSPkg'))
|
||||
result = run_pip('install', to_install, '--egg', expect_error=False)
|
||||
fspkg_folder = env.site_packages/'fspkg'
|
||||
egg_folder = env.site_packages/'FSPkg-0.1dev-py%s.egg' % pyversion
|
||||
assert fspkg_folder not in result.files_created, str(result.stdout)
|
||||
assert egg_folder in result.files_created, str(result)
|
||||
|
||||
result2 = run_pip('uninstall', 'FSPkg', '-y', expect_error=True)
|
||||
assert_all_changes(result, result2, [env.venv/'build', 'cache'])
|
||||
|
||||
|
|
Loading…
Reference in New Issue