Index: Lib/distutils/config.py =================================================================== --- Lib/distutils/config.py (révision 67338) +++ Lib/distutils/config.py (copie de travail) @@ -10,8 +10,8 @@ from distutils.cmd import Command DEFAULT_PYPIRC = """\ -[pypirc] -servers = +[distutils] +index-servers = pypi [pypi] Index: Lib/distutils/tests/test_config.py =================================================================== --- Lib/distutils/tests/test_config.py (révision 67338) +++ Lib/distutils/tests/test_config.py (copie de travail) @@ -32,6 +32,17 @@ password:secret """ +WANTED = """\ +[distutils] +index-servers = + pypi + +[pypi] +username:tarek +password:xxx +""" + + class PyPIRCCommandTestCase(support.TempdirManager, unittest.TestCase): def setUp(self): @@ -98,6 +109,20 @@ ('server', 'server-login'), ('username', 'tarek')] self.assertEquals(config, waited) + def test_server_empty_registration(self): + + cmd = self._cmd(self.dist) + rc = cmd._get_rc_file() + self.assert_(not os.path.exists(rc)) + + cmd._store_pypirc('tarek', 'xxx') + + self.assert_(os.path.exists(rc)) + content = open(rc).read() + + self.assertEquals(content, WANTED) + + def test_suite(): return unittest.makeSuite(PyPIRCCommandTestCase)