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)
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)
def protectedName(self): self.protectedName_called = True self._name = 'ExtendedGrandDaughter' + ProtectedPolymorphicGrandDaughter.protectedName( self) return self._name
def protectedName(self): self.protectedName_called = True self._name = 'ExtendedGrandDaughter' + ProtectedPolymorphicGrandDaughter.protectedName(self) return self._name