def test_instanceBuildingNamePresent(self): """ L{unpickleMethod} returns an instance method bound to the instance passed to it. """ foo = Foo() m = unpickleMethod('method', foo, Foo) self.assertEqual(m, foo.method) self.assertIsNot(m, foo.method)
def test_instanceBuildingNamePresent(self): """ L{unpickleMethod} returns an instance method bound to the instance passed to it. """ foo = Foo() m = unpickleMethod("method", foo, Foo) self.assertEqual(m, foo.method) self.assertNotIdentical(m, foo.method)
def test_instanceBuildingNameNotPresent(self): """ If the named method is not present in the class, L{unpickleMethod} finds a method on the class of the instance and returns a bound method from there. """ foo = Foo() m = unpickleMethod('method', foo, Bar) self.assertEqual(m, foo.method) self.assertIsNot(m, foo.method)
def test_instanceBuildingNameNotPresent(self): """ If the named method is not present in the class, L{unpickleMethod} finds a method on the class of the instance and returns a bound method from there. """ foo = Foo() m = unpickleMethod("method", foo, Bar) self.assertEqual(m, foo.method) self.assertNotIdentical(m, foo.method)