From c7909fab088b97ced9ea153e6b9d324c9e3a9c43 Mon Sep 17 00:00:00 2001 From: Bart van Merrienboer Date: Wed, 21 Jan 2015 12:51:23 -0500 Subject: Added tests --- test_six.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test_six.py') diff --git a/test_six.py b/test_six.py index 76a8ccb..73a1f41 100644 --- a/test_six.py +++ b/test_six.py @@ -456,6 +456,20 @@ def test_create_bound_method(): assert b() is x +def test_create_unbound_method(): + class X(object): + pass + + def f(self): + return self + u = six.create_unbound_method(f, X) + py.test.raises(TypeError, u) + if six.PY2: + assert isinstance(u, types.MethodType) + x = X() + assert f(x) is x + + if six.PY3: def test_b(): -- cgit v1.2.1