예제 #1
0
 def testReimplementedProtectedCall(self):
     '''Calls a reimplemented virtual protected method from parent class.'''
     original_name = 'Poly'
     p = ExtendedProtectedPolymorphicGrandDaughter(original_name)
     name = p.callProtectedName()
     self.assertTrue(p.protectedName_called)
     self.assertEqual(p.protectedName(), name)
     self.assertEqual(ProtectedPolymorphicGrandDaughter.protectedName(p), original_name)
예제 #2
0
 def testReimplementedProtectedCall(self):
     '''Calls a reimplemented virtual protected method from parent class.'''
     original_name = 'Poly'
     p = ExtendedProtectedPolymorphicGrandDaughter(original_name)
     name = p.callProtectedName()
     self.assert_(p.protectedName_called)
     self.assertEqual(p.protectedName(), name)
     self.assertEqual(ProtectedPolymorphicGrandDaughter.protectedName(p), original_name)
예제 #3
0
 def protectedName(self):
     self.protectedName_called = True
     self._name = 'ExtendedGrandDaughter' + ProtectedPolymorphicGrandDaughter.protectedName(
         self)
     return self._name
예제 #4
0
 def protectedName(self):
     self.protectedName_called = True
     self._name = 'ExtendedGrandDaughter' + ProtectedPolymorphicGrandDaughter.protectedName(self)
     return self._name