def test_kw_with_list_argument(self):
     """ Does a function with a keyword argument as a list work?
     """
     def func(a,b=[]):
         pass
     res = def_signature(func)
     self.assertEqual(res, 'def func(a, b=[]):')
 def test_kw(self):
     """ Does a function with a keyword and positional argument work?
     """
     def func(a,b=1):
         pass
     res = def_signature(func)
     self.assertEqual(res, 'def func(a, b=1):')
Example #3
0
 def test_args_and_kwds(self):
     self.assertEqual(def_signature(args_and_kwds),
                      "def args_and_kwds(x, z=1, y=2):")
Example #4
0
 def test_just_kwds(self):
     self.assertEqual(def_signature(just_kwds), "def just_kwds(y=1, x=2):")
Example #5
0
 def test_just_args(self):
     self.assertEqual(def_signature(just_args), "def just_args(x, y):")
 def test_args_and_kwds(self):
     self.assertEquals(def_signature(args_and_kwds), "def args_and_kwds(x, z=1, y=2):")
 def test_just_kwds(self):
     self.assertEquals(def_signature(just_kwds), "def just_kwds(y=1, x=2):")
 def test_just_args(self):
     self.assertEquals(def_signature(just_args), "def just_args(x, y):")