twisted/mantissa

Help formatting changes

Closed this issue · 0 comments

The formatting of help output has changed in twisted.python.usage leading to the following test failures:

[FAIL]
Traceback (most recent call last):
  File "/home/mithrandi/code/Mantissa/xmantissa/test/test_port.py", line 720, in test_explicitDeleteHelp
    self.assertEqual(self._deleteHelpText, sys.stdout.getvalue())
  File "/home/mithrandi/deployment/virtualenvs/Mantissa/local/lib/python2.7/site-packages/twisted/trial/_synctest.py", line 447, in assertEqual
    % (msg, pformat(first), pformat(second)))
twisted.trial.unittest.FailTest: not equal:
a = 'Usage: axiomatic [options] port [options] delete [options]\nOptions:\n      --port-identifier=  Identify a port for deletion.\n      --version           Display Twisted version and exit.\n      --help              Display this help and exit.\n\nDelete an existing port binding from a factory. If a server is currently running\nusing the database from which the port is deleted, the factory will *not* stop\nlistening on that port until the server is restarted.\n\n'
b = 'Usage: axiomatic [options] port [options] delete [options]\nOptions:\n      --port-identifier=  Identify a port for deletion.\n      --version           Display Twisted version and exit.\n      --help              Display this help and exit.\n\nDelete an existing port binding from a factory.  If a server is currently\nrunning using the database from which the port is deleted, the factory will\n*not* stop listening on that port until the server is restarted.\n\n'


xmantissa.test.test_port.PortConfigurationCommandTests.test_explicitDeleteHelp
===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/home/mithrandi/code/Mantissa/xmantissa/test/test_port.py", line 730, in test_implicitDeleteHelp
    self.assertEqual(self._deleteHelpText, sys.stdout.getvalue())
  File "/home/mithrandi/deployment/virtualenvs/Mantissa/local/lib/python2.7/site-packages/twisted/trial/_synctest.py", line 447, in assertEqual
    % (msg, pformat(first), pformat(second)))
twisted.trial.unittest.FailTest: not equal:
a = 'Usage: axiomatic [options] port [options] delete [options]\nOptions:\n      --port-identifier=  Identify a port for deletion.\n      --version           Display Twisted version and exit.\n      --help              Display this help and exit.\n\nDelete an existing port binding from a factory. If a server is currently running\nusing the database from which the port is deleted, the factory will *not* stop\nlistening on that port until the server is restarted.\n\n'
b = 'Usage: axiomatic [options] port [options] delete [options]\nOptions:\n      --port-identifier=  Identify a port for deletion.\n      --version           Display Twisted version and exit.\n      --help              Display this help and exit.\n\nDelete an existing port binding from a factory.  If a server is currently\nrunning using the database from which the port is deleted, the factory will\n*not* stop listening on that port until the server is restarted.\n\n'

It seems like these tests are far too brittle; we don't really care all that much about the precise help output from Options, so we shouldn't be asserting that it conforms exactly to some string.