Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)