(self)
| 131 | self.assertEqual(p(3,4), ((1,2,3,4), {})) |
| 132 | |
| 133 | def test_kw_combinations(self): |
| 134 | # exercise special code paths for no keyword args in |
| 135 | # either the partial object or the caller |
| 136 | p = self.partial(capture) |
| 137 | self.assertEqual(p.keywords, {}) |
| 138 | self.assertEqual(p(), ((), {})) |
| 139 | self.assertEqual(p(a=1), ((), {'a':1})) |
| 140 | p = self.partial(capture, a=1) |
| 141 | self.assertEqual(p.keywords, {'a':1}) |
| 142 | self.assertEqual(p(), ((), {'a':1})) |
| 143 | self.assertEqual(p(b=2), ((), {'a':1, 'b':2})) |
| 144 | # keyword args in the call override those in the partial object |
| 145 | self.assertEqual(p(a=3, b=2), ((), {'a':3, 'b':2})) |
| 146 | |
| 147 | def test_positional(self): |
| 148 | # make sure positional arguments are captured correctly |
nothing calls this directly
no test coverage detected