PageRenderTime 61ms CodeModel.GetById 20ms app.highlight 3ms RepoModel.GetById 17ms app.codeStats 0ms

/Lib/distutils/tests/test_upload.py

http://unladen-swallow.googlecode.com/
Python | 34 lines | 23 code | 9 blank | 2 comment | 3 complexity | af52e147917f8d5bd954afb0bcc5294d MD5 | raw file
 1"""Tests for distutils.command.upload."""
 2import sys
 3import os
 4import unittest
 5
 6from distutils.command.upload import upload
 7from distutils.core import Distribution
 8
 9from distutils.tests import support
10from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase
11
12class uploadTestCase(PyPIRCCommandTestCase):
13
14    def test_finalize_options(self):
15
16        # new format
17        f = open(self.rc, 'w')
18        f.write(PYPIRC)
19        f.close()
20
21        dist = Distribution()
22        cmd = upload(dist)
23        cmd.finalize_options()
24        for attr, waited in (('username', 'me'), ('password', 'secret'),
25                             ('realm', 'pypi'),
26                             ('repository', 'http://pypi.python.org/pypi')):
27            self.assertEquals(getattr(cmd, attr), waited)
28
29
30def test_suite():
31    return unittest.makeSuite(uploadTestCase)
32
33if __name__ == "__main__":
34    unittest.main(defaultTest="test_suite")