2
2
from os .path import abspath , join , dirname , pardir
3
3
from test_pip import here , reset_env , run_pip , pyversion , lib_py
4
4
5
- def test_0 ():
6
- '''
7
- Check we are running proper version of pip in run_pip::
8
- '''
5
+ def test_correct_pip_version ():
6
+ """
7
+ Check we are running proper version of pip in run_pip.
8
+
9
+ """
9
10
reset_env ()
10
11
base = abspath (join (dirname (__file__ ), pardir ))
11
12
result = run_pip ('--version' )
12
13
assert base in result .stdout , result .stdout
13
14
14
- def test_1 ():
15
- '''
16
- First a test of the distutils-configuration-setting command (which is distinct from other commands)::
17
- '''
15
+ def test_distutils_configuration_setting ():
16
+ """
17
+ Test the distutils-configuration-setting command (which is distinct from other commands).
18
+
19
+ """
18
20
#print run_pip('-vv', '--distutils-cfg=easy_install:index_url:http://download.zope.org/ppix/', expect_error=True)
19
21
#Script result: python ../../poacheggs.py -E .../poacheggs-tests/test-scratch -vv --distutils-cfg=easy_install:index_url:http://download.zope.org/ppix/
20
22
#-- stdout: --------------------
@@ -25,29 +27,32 @@ def test_1():
25
27
#-- updated: -------------------
26
28
# lib/python2.4/distutils/distutils.cfg (346 bytes)
27
29
28
- def test_2 ():
29
- '''
30
- Next, a simple test::
31
- '''
30
+ def test_install_from_pypi ():
31
+ """
32
+ Test installing a package from PyPI.
33
+
34
+ """
32
35
reset_env ()
33
36
result = run_pip ('install' , '-vvv' , 'INITools==0.2' , expect_error = True )
34
- assert (lib_py + 'site-packages/INITools-0.2-py%s.egg-info' % pyversion ) in result .files_created , str (result ) #sorted(result.files_created.keys())
37
+ assert (lib_py + 'site-packages/INITools-0.2-py%s.egg-info' % pyversion ) in result .files_created , str (result )
35
38
assert (lib_py + 'site-packages/initools' ) in result .files_created , sorted (result .files_created .keys ())
36
39
37
- def test_3 ():
38
- '''
39
- Let's try that again, editable::
40
- '''
40
+ def test_editable_install ():
41
+ """
42
+ Test editable installation.
43
+
44
+ """
41
45
reset_env ()
42
46
result = run_pip ('install' , '-e' , 'INITools==0.2' , expect_error = True )
43
47
assert "--editable=INITools==0.2 should be formatted with svn+URL" in result .stdout
44
48
assert len (result .files_created ) == 1 , result .files_created
45
49
assert not result .files_updated , result .files_updated
46
50
47
- def test_4 ():
48
- '''
49
- Now, checking out from svn::
50
- '''
51
+ def test_install_editable_from_svn ():
52
+ """
53
+ Test checking out from svn.
54
+
55
+ """
51
56
reset_env ()
52
57
result = run_pip ('install' , '-e' , 'svn+http://svn.colorstudy.com/INITools/trunk#egg=initools-dev' , expect_error = True )
53
58
egg_link = result .files_created [lib_py + 'site-packages/INITools.egg-link' ]
@@ -58,18 +63,20 @@ def test_4():
58
63
assert 'src/initools/.svn' in result .files_created
59
64
60
65
61
- def test_5 ():
62
- '''
63
- Using package==dev::
64
- '''
66
+ def test_install_dev_version_from_pypi ():
67
+ """
68
+ Test using package==dev.
69
+
70
+ """
65
71
reset_env ()
66
72
result = run_pip ('install' , 'INITools==dev' , expect_error = True )
67
73
assert (lib_py + 'site-packages/initools' ) in result .files_created , str (result .stdout )
68
74
69
- def test_6 ():
70
- '''
71
- Cloning from Git::
72
- '''
75
+ def test_install_editable_from_git ():
76
+ """
77
+ Test cloning from Git.
78
+
79
+ """
73
80
reset_env ()
74
81
result = run_pip ('install' , '-e' , 'git://github.com/jezdez/django-feedutil.git#egg=django-feedutil' , expect_error = True )
75
82
egg_link = result .files_created [lib_py + 'site-packages/django-feedutil.egg-link' ]
@@ -79,10 +86,11 @@ def test_6():
79
86
assert 'src/django-feedutil' in result .files_created
80
87
assert 'src/django-feedutil/.git' in result .files_created
81
88
82
- def test_7 ():
83
- '''
84
- Cloning from Mercurial::
85
- '''
89
+ def test_install_editable_from_hg ():
90
+ """
91
+ Test cloning from Mercurial.
92
+
93
+ """
86
94
reset_env ()
87
95
result = run_pip ('install' , '-e' , 'hg+http://bitbucket.org/ubernostrum/django-registration/#egg=django-registration' , expect_error = True )
88
96
egg_link = result .files_created [lib_py + 'site-packages/django-registration.egg-link' ]
@@ -92,18 +100,20 @@ def test_7():
92
100
assert 'src/django-registration' in result .files_created
93
101
assert 'src/django-registration/.hg' in result .files_created
94
102
95
- def test_8 ():
96
- '''
97
- Presence or absence of final slash is also normalized::
98
- '''
103
+ def test_vcs_url_final_slash_normalization ():
104
+ """
105
+ Test that presence or absence of final slash in VCS URL is normalized.
106
+
107
+ """
99
108
reset_env ()
100
109
result = run_pip ('install' , '-e' , 'hg+http://bitbucket.org/ubernostrum/django-registration#egg=django-registration' , expect_error = True )
101
110
assert 'pip-log.txt' not in result .files_created , result .files_created ['pip-log.txt' ].bytes
102
111
103
- def test_9 ():
104
- '''
105
- Checking out from Bazaar::
106
- '''
112
+ def test_install_editable_from_bazaar ():
113
+ """
114
+ Test checking out from Bazaar.
115
+
116
+ """
107
117
reset_env ()
108
118
result = run_pip ('install' , '-e' , 'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1/@174#egg=django-wikiapp' , expect_error = True )
109
119
egg_link = result .files_created [lib_py + 'site-packages/django-wikiapp.egg-link' ]
@@ -113,10 +123,11 @@ def test_9():
113
123
assert 'src/django-wikiapp' in result .files_created
114
124
assert 'src/django-wikiapp/.bzr' in result .files_created
115
125
116
- def test_10 ():
117
- '''
118
- Urlquoted characters are normalized for repo URL comparison::
119
- '''
126
+ def test_vcs_url_urlquote_normalization ():
127
+ """
128
+ Test that urlquoted characters are normalized for repo URL comparison.
129
+
130
+ """
120
131
reset_env ()
121
132
result = run_pip ('install' , '-e' , 'bzr+http://bazaar.launchpad.net/~django-wikiapp/django-wikiapp/release-0.1#egg=django-wikiapp' , expect_error = True )
122
133
assert 'pip-log.txt' not in result .files_created , result .files_created ['pip-log.txt' ].bytes
0 commit comments