Test partial() with bound/unbound methods.
This commit is contained in:
parent
a1a992c0a0
commit
26e512a04f
|
@ -133,6 +133,12 @@ class TestPartial(unittest.TestCase):
|
||||||
f = None
|
f = None
|
||||||
self.assertRaises(ReferenceError, getattr, p, 'func')
|
self.assertRaises(ReferenceError, getattr, p, 'func')
|
||||||
|
|
||||||
|
def test_with_bound_and_unbound_methods(self):
|
||||||
|
data = map(str, range(10))
|
||||||
|
join = self.thetype(str.join, '')
|
||||||
|
self.assertEqual(join(data), '0123456789')
|
||||||
|
join = self.thetype(''.join)
|
||||||
|
self.assertEqual(join(data), '0123456789')
|
||||||
|
|
||||||
class PartialSubclass(functional.partial):
|
class PartialSubclass(functional.partial):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue