diff options
| author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-01-09 00:15:45 +0000 |
|---|---|---|
| committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-01-09 00:15:45 +0000 |
| commit | 5b32d845dc21e255e9b1d40c5aa7b12aa9149271 (patch) | |
| tree | 5638596345df569a11bf34de41e25b2dc6e93eef /tests/test_upload.py | |
| parent | 7da96ed6b364ce84ab7b0f2c563fda2779f641ec (diff) | |
| download | python-setuptools-git-5b32d845dc21e255e9b1d40c5aa7b12aa9149271.tar.gz | |
Merged revisions 68415 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r68415 | tarek.ziade | 2009-01-09 00:56:31 +0100 (Fri, 09 Jan 2009) | 1 line
fixed #4394 make the storage of the password optional in .pypirc
........
Diffstat (limited to 'tests/test_upload.py')
| -rw-r--r-- | tests/test_upload.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_upload.py b/tests/test_upload.py index b05ab1f7..3f8ca6d6 100644 --- a/tests/test_upload.py +++ b/tests/test_upload.py @@ -9,6 +9,17 @@ from distutils.core import Distribution from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase +PYPIRC_NOPASSWORD = """\ +[distutils] + +index-servers = + server1 + +[server1] +username:me +""" + + class uploadTestCase(PyPIRCCommandTestCase): def test_finalize_options(self): @@ -26,6 +37,24 @@ class uploadTestCase(PyPIRCCommandTestCase): ('repository', 'http://pypi.python.org/pypi')): self.assertEquals(getattr(cmd, attr), waited) + def test_saved_password(self): + # file with no password + f = open(self.rc, 'w') + f.write(PYPIRC_NOPASSWORD) + f.close() + + # make sure it passes + dist = Distribution() + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, None) + + # make sure we get it as well, if another command + # initialized it at the dist level + dist.password = 'xxx' + cmd = upload(dist) + cmd.finalize_options() + self.assertEquals(cmd.password, 'xxx') def test_suite(): return unittest.makeSuite(uploadTestCase) |
