Beispiel #1
0
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())
Beispiel #2
0
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())
Beispiel #3
0
def nodoc(self):
    """Help should work without any docstring"""
    def f():
        pass

    clifunc.help(f, StringIO())
Beispiel #4
0
def nodoc(self):
    """Help should work without any docstring"""
    
    def f():
        pass
    clifunc.help(f, StringIO())