def test_a(): x = basics.A(5) x.a = 10 assert_equal(x.a, 10) x.a = 42 assert_equal(x.a, 42) x.call() assert_equal(x.a, 1)
def test_b(): x = basics.A() x.a = 10 y = basics.B() y.b = 11 assert_equal(y.b, 11) y.b = 43 assert_equal(y.b, 43) y.call() assert_equal(y.b, 1) y.from_a(x) assert_equal(y.b, 10) assert_true(isinstance(y, basics.A))
def test_c(): x = basics.A() x.a = 10 y = basics.B() y.b = 11 z = basics.C() z.c = 12 assert_equal(z.c, 12) z.c = 44 assert_equal(z.c, 44) z.call() assert_equal(z.c, 1) z.from_a(x) assert_equal(z.b, 10) assert_true(isinstance(z, basics.A)) assert_true(isinstance(z, basics.B))