|
1 | 1 | import textwrap
|
2 | 2 | import sys
|
3 |
| -from os.path import join |
| 3 | +from os.path import join, abspath |
4 | 4 | from tempfile import mkdtemp
|
5 |
| -from tests.test_pip import reset_env, run_pip, assert_all_changes, write_file |
| 5 | +from tests.test_pip import here, reset_env, run_pip, assert_all_changes, write_file, pyversion |
6 | 6 | from tests.local_repos import local_repo, local_checkout
|
7 | 7 |
|
8 | 8 | from pip.util import rmtree
|
@@ -137,3 +137,21 @@ def test_uninstall_from_reqs_file():
|
137 | 137 | result2 = run_pip('uninstall', '-r', 'test-req.txt', '-y')
|
138 | 138 | assert_all_changes(
|
139 | 139 | result, result2, [env.venv/'build', env.venv/'src', env.scratch/'test-req.txt'])
|
| 140 | + |
| 141 | + |
| 142 | +def test_uninstall_as_egg(): |
| 143 | + """ |
| 144 | + Test uninstall package installed as egg. |
| 145 | +
|
| 146 | + """ |
| 147 | + env = reset_env() |
| 148 | + to_install = abspath(join(here, 'packages', 'FSPkg')) |
| 149 | + result = run_pip('install', to_install, '--egg', expect_error=False) |
| 150 | + fspkg_folder = env.site_packages/'fspkg' |
| 151 | + egg_folder = env.site_packages/'FSPkg-0.1dev-py%s.egg' % pyversion |
| 152 | + assert fspkg_folder not in result.files_created, str(result.stdout) |
| 153 | + assert egg_folder in result.files_created, str(result) |
| 154 | + |
| 155 | + result2 = run_pip('uninstall', 'FSPkg', '-y', expect_error=True) |
| 156 | + assert_all_changes(result, result2, [env.venv/'build', 'cache']) |
| 157 | + |
0 commit comments