def help(self): """Test help works and everything that is meant to be there is there""" capture = StringIO() clifunc.help(Fixture().f, capture) self.maxDiff = None self.assertEqual("""\ Summary line parameters: [-mand] <str> [[-defnone] <str>] [-noarg] [[-multi] <str> . . .] [<var> . . .] -mand-opt=<str> [-optzero=<str>] [-noarg-opt] [-multi-opt=<str> . . .] defaults: -optzero=0 Docstring body """, capture.getvalue())
def help(self): """Test help works and everything that is meant to be there is there""" capture = StringIO() clifunc.help(Fixture().f, capture) self.maxDiff = None self.assertEqual( """\ Summary line parameters: [-mand] <str> [[-defnone] <str>] [-noarg] [[-multi] <str> . . .] [<var> . . .] -mand-opt=<str> [-optzero=<str>] [-noarg-opt] [-multi-opt=<str> . . .] defaults: -optzero=0 Docstring body """, capture.getvalue())
def nodoc(self): """Help should work without any docstring""" def f(): pass clifunc.help(f, StringIO())