-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_requirements.txt
38 lines (32 loc) · 1.19 KB
/
test_requirements.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Basic setup::
>>> import os
>>> from __main__ import base_path, reset_env, run_pip, pyversion, lib_py, write_file
Some tests of requirement files::
>>> reset_env()
>>> write_file('initools-req.txt', '''\
... INITools==0.2
... # and something else to test out:
... simplejson<=1.7.4
... ''')
>>> result = run_pip('install', '-r', 'initools-req.txt')
>>> len(result.wildcard_matches('lib/python*/site-packages/INITools-0.2-py*.egg-info'))
1
>>> len(result.wildcard_matches('lib/python*/site-packages/initools'))
1
>>> dirs = result.wildcard_matches('lib/python*/site-packages/simplejson*')
>>> len(dirs)
2
>>> dirs[0].dir, dirs[1].dir
(True, True)
Now with more than one file::
>>> reset_env()
>>> write_file('initools-req.txt', '''\
... -e svn+http://svn.colorstudy.com/INITools/trunk@3139#egg=INITools-dev
... -r simplejson-req.txt''')
>>> write_file('simplejson-req.txt', '''\
... simplejson<=1.7.4
... ''')
>>> result = run_pip('install', '-r', 'initools-req.txt')
>>> len(result.wildcard_matches('lib/python*/site-packages/simplejson*'))
2
>>> assert 'src/initools' in result.files_created