equal
deleted
inserted
replaced
|
1 """Tests for distutils.command.upload.""" |
|
2 import sys |
|
3 import os |
|
4 import unittest |
|
5 |
|
6 from distutils.command.upload import upload |
|
7 from distutils.core import Distribution |
|
8 |
|
9 from distutils.tests import support |
|
10 from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase |
|
11 |
|
12 class 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 |
|
30 def test_suite(): |
|
31 return unittest.makeSuite(uploadTestCase) |
|
32 |
|
33 if __name__ == "__main__": |
|
34 unittest.main(defaultTest="test_suite") |