diff options
Diffstat (limited to 'distutils2/tests/test_command_register.py')
| -rw-r--r-- | distutils2/tests/test_command_register.py | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/distutils2/tests/test_command_register.py b/distutils2/tests/test_command_register.py index 2cc9f70..4e6c1de 100644 --- a/distutils2/tests/test_command_register.py +++ b/distutils2/tests/test_command_register.py @@ -12,6 +12,7 @@ except ImportError: DOCUTILS_SUPPORT = False from distutils2.tests import unittest, support +from distutils2.tests.support import Inputs from distutils2.command import register as register_module from distutils2.command.register import register from distutils2.errors import PackagingSetupError @@ -38,19 +39,6 @@ password:password """ -class Inputs: - """Fakes user inputs.""" - def __init__(self, *answers): - self.answers = answers - self.index = 0 - - def __call__(self, prompt=''): - try: - return self.answers[self.index] - finally: - self.index += 1 - - class FakeOpener: """Fakes a PyPI server""" def __init__(self): @@ -143,6 +131,7 @@ class RegisterTestCase(support.TempdirManager, register_module.input = _no_way cmd.show_response = True + cmd.finalized = False cmd.ensure_finalized() cmd.run() @@ -200,12 +189,10 @@ class RegisterTestCase(support.TempdirManager, @unittest.skipUnless(DOCUTILS_SUPPORT, 'needs docutils') def test_strict(self): - # testing the script option - # when on, the register command stops if - # the metadata is incomplete or if - # long_description is not reSt compliant + # testing the strict option: when on, the register command stops if the + # metadata is incomplete or if description contains bad reST - # empty metadata + # empty metadata # XXX this is not really empty.. cmd = self._get_cmd({'name': 'xxx', 'version': 'xxx'}) cmd.ensure_finalized() cmd.strict = True @@ -213,16 +200,15 @@ class RegisterTestCase(support.TempdirManager, register_module.input = inputs self.assertRaises(PackagingSetupError, cmd.run) - # metadata is OK but long_description is broken + # metadata is OK but description is broken metadata = {'home_page': 'xxx', 'author': 'xxx', 'author_email': 'éxéxé', - 'name': 'xxx', 'version': 'xxx', + 'name': 'xxx', 'version': '4.2', 'description': 'title\n==\n\ntext'} cmd = self._get_cmd(metadata) cmd.ensure_finalized() cmd.strict = True - self.assertRaises(PackagingSetupError, cmd.run) # now something that works |
