def testDefaults(self): #{{{ '''Function with default values''' t = lambda a, b, c=1, d=2: None self.assertEqual(nsa(t), (2, 4))
def testNoDefaults(self): #{{{ '''Function with no default values''' t = lambda a, b, c: None self.assertEqual(nsa(t), (3, 3))
def testVarArgs(self): #{{{ '''Function with variable args''' t = lambda *a: None self.assertEqual(nsa(t), (0, None)) t = lambda a, b, *c: None self.assertEqual(nsa(t), (2, None))
def testNonCallableObject(self): #{{{ '''Object with non-method __call__''' class _(object): __call__ = 1 self.assertEqual(nsa(_()), (-1, None))
def testClass(self): #{{{ '''Class objects are valid callables''' class _(object): def __init__(self): pass self.assertEqual(nsa(_), (0, 0))
def testNonCallable(self): #{{{ '''Non-callable returns (-1, None)''' self.assertEqual(nsa(1), (-1, None))