diff options
| author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-01-08 23:56:31 (GMT) |
|---|---|---|
| committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-01-08 23:56:31 (GMT) |
| commit | 1a240fb9f038839f0e6f157ce4c7fcbcbf777ebc (patch) | |
| tree | f60ab4380cf7de758fda0994eb9c0071e489f041 /Lib/distutils/tests/test_upload.py | |
| parent | 5b913e31a1cbcea7807fca4cc272079039a3bd67 (diff) | |
| download | cpython-1a240fb9f038839f0e6f157ce4c7fcbcbf777ebc.zip cpython-1a240fb9f038839f0e6f157ce4c7fcbcbf777ebc.tar.gz cpython-1a240fb9f038839f0e6f157ce4c7fcbcbf777ebc.tar.bz2 | |
fixed #4394 make the storage of the password optional in .pypirc
Diffstat (limited to 'Lib/distutils/tests/test_upload.py')
| -rw-r--r-- | Lib/distutils/tests/test_upload.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py index b05ab1f..3f8ca6d 100644 --- a/Lib/distutils/tests/test_upload.py +++ b/Lib/distutils/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) |
