2010-03-06 15:42:17 +01:00
|
|
|
from os import makedirs
|
|
|
|
from os.path import join
|
|
|
|
import textwrap
|
2010-04-13 01:40:56 +02:00
|
|
|
from test_pip import here, reset_env, run_pip, pyversion, diff_states, write_file
|
|
|
|
from path import Path
|
2010-03-06 15:42:17 +01:00
|
|
|
|
|
|
|
def test_download_if_requested():
|
|
|
|
"""
|
2010-04-13 01:40:56 +02:00
|
|
|
It should download (in the scratch path) and not install if requested.
|
2010-03-06 15:42:17 +01:00
|
|
|
|
|
|
|
"""
|
2010-04-13 01:40:56 +02:00
|
|
|
env = reset_env()
|
2010-03-06 15:42:17 +01:00
|
|
|
result = run_pip('install', 'INITools==0.1', '-d', '.', expect_error=True)
|
2010-04-13 01:20:02 +02:00
|
|
|
assert Path('scratch')/ 'INITools-0.1.tar.gz' in result.files_created
|
|
|
|
assert env.site_packages/ 'initools' not in result.files_created
|
2010-03-06 15:42:17 +01:00
|
|
|
|
|
|
|
def test_single_download_from_requirements_file():
|
|
|
|
"""
|
2010-04-13 01:40:56 +02:00
|
|
|
It should support download (in the scratch path) from PyPi from a requirements file
|
2010-03-06 15:42:17 +01:00
|
|
|
"""
|
2010-04-13 01:40:56 +02:00
|
|
|
env = reset_env()
|
2010-03-06 15:42:17 +01:00
|
|
|
write_file('test-req.txt', textwrap.dedent("""
|
|
|
|
INITools==0.1
|
|
|
|
"""))
|
2010-04-13 01:20:02 +02:00
|
|
|
result = run_pip('install', '-r', env.base_path/ 'test-req.txt', '-d', '.', expect_error=True)
|
|
|
|
assert Path('scratch')/ 'INITools-0.1.tar.gz' in result.files_created
|
|
|
|
assert env.site_packages/ 'initools' not in result.files_created
|