def testReimplementedProtectedCall(self): '''Calls a reimplemented virtual protected method.''' original_name = 'Poly' p = ExtendedProtectedPolymorphic(original_name) name = p.callProtectedName() self.assertTrue(p.protectedName_called) self.assertEqual(p.protectedName(), name) self.assertEqual(ProtectedPolymorphic.protectedName(p), original_name)
def testReimplementedProtectedCall(self): '''Calls a reimplemented virtual protected method.''' original_name = 'Poly' p = ExtendedProtectedPolymorphic(original_name) name = p.callProtectedName() self.assert_(p.protectedName_called) self.assertEqual(p.protectedName(), name) self.assertEqual(ProtectedPolymorphic.protectedName(p), original_name)
def protectedName(self): self.protectedName_called = True self._name = 'Extended' + ProtectedPolymorphic.protectedName(self) return self._name
def protectedName(self): self.protectedName_called = True self._name = 'Extended' + ProtectedPolymorphic.protectedName(self) return self._name