Example #1
0
    def testInitConcreteClassWithVirtualMethods(self):
        b = virtual_funcs.B()
        b.set_c(2)
        self.assertEqual(b.c, 2)

        c = virtual_funcs.ClassNonDefConst(1, 2)
        self.assertEqual(c.DoSomething(), 3)
Example #2
0
 def testTemporaryInstance(self):
     man = virtual_funcs.Manager(virtual_funcs.ClassNonDefConst(100, 23))
     self.assertEqual(man.DoIt(), 123)
     man = virtual_funcs.Manager(ClassNonDefConstImpl(100, 123))
     self.assertEqual(man.DoIt(), 12300)