Exemplo n.º 1
0
 def test_argspec(self):
     def foo(x, y, z=10):
         "docstring!"
         pass
     argspec = inspection.getargspec('foo', foo) + [1]
     array = replpainter.formatted_argspec(argspec, 30, setup_config())
     screen = [(bold(cyan(u'foo'))+cyan(':')+cyan(' ')+cyan('(')+cyan('x') +
               yellow(',')+yellow(' ')+bold(cyan('y'))+yellow(',') +
               yellow(' ')+cyan('z')+yellow('=')+bold(cyan('10'))+yellow(')'))]
     self.assertFSArraysEqual(fsarray(array), fsarray(screen))
Exemplo n.º 2
0
 def test_argspec(self):
     def foo(x, y, z=10):
         "docstring!"
         pass
     argspec = inspection.getfuncprops('foo', foo)
     array = replpainter.formatted_argspec(argspec, 1, 30, setup_config())
     screen = [bold(cyan('foo')) + cyan(':') + cyan(' ') + cyan('(') +
               cyan('x') + yellow(',') + yellow(' ') + bold(cyan('y')) +
               yellow(',') + yellow(' ') + cyan('z') + yellow('=') +
               bold(cyan('10')) + yellow(')')]
     self.assertFSArraysEqual(fsarray(array), fsarray(screen))
Exemplo n.º 3
0
    def test_argspec(self):
        def foo(x, y, z=10):
            "docstring!"
            pass

        argspec = inspection.getfuncprops("foo", foo)
        array = replpainter.formatted_argspec(argspec, 1, 30, setup_config())
        screen = [
            bold(cyan("foo")) + cyan(":") + cyan(" ") + cyan("(") + cyan("x") +
            yellow(",") + yellow(" ") + bold(cyan("y")) + yellow(",") +
            yellow(" ") + cyan("z") + yellow("=") + bold(cyan("10")) +
            yellow(")")
        ]
        assertFSArraysEqual(fsarray(array), fsarray(screen))