def test_takes_one_arg(self): from pform.fields import takes_one_arg def fn(arg): return arg self.assertTrue(takes_one_arg(fn, 'arg')) self.assertFalse(takes_one_arg(fn, 'context'))
def test_takes_one_arg(self, m_inspect): m_inspect.getargspec.side_effect = TypeError from pform.fields import takes_one_arg def fn(arg): return arg self.assertFalse(takes_one_arg(fn, 'arg'))