Beispiel #1
0
 def test_object_extend_object(self):
     woof = "W0000F"
     b = Bark(woof)
     t = Target()
     pytron.interlock(t, b)
     self.assertTrue(hasattr(b, "bark"))
     self.assertTrue(hasattr(t, "bark"))
     self.assertEqual(t.bark(), woof)
     self.assertEqual(t.bark.im_self, b)
Beispiel #2
0
 def test_class_extend_class(self):
     pytron.interlock(Target, Bark)
     pytron.interlock(Target, Clap)
     t = Target()
     self.assertTrue(hasattr(t, "bark"))
     self.assertTrue(hasattr(t, "clap"))
Beispiel #3
0
 def test_class_extend_object(self):
     b = Bark()
     pytron.interlock(Target, b)
     t = Target()
     self.assertTrue(hasattr(b, "bark"))
     self.assertTrue(hasattr(t, "bark"))