~malept/ubuntu/lucid/python2.6/dev-dependency-fix

« back to all changes in this revision

Viewing changes to Lib/distutils/tests/test_upload.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-13 12:51:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090213125100-uufgcb9yeqzujpqw
Tags: upstream-2.6.1
ImportĀ upstreamĀ versionĀ 2.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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")