# HG changeset patch # User Paul Boddie # Date 1243708228 -7200 # Node ID b8fea09316977c8282a7360dd004bb38580ecdb9 # Parent 892b13f1cba4bcc97667c5ba78fbb797d8a70999 Split the descendant of the old classes test into two more specific tests of attribute binding and methods/callables. diff -r 892b13f1cba4 -r b8fea0931697 tests/attributes_instance_bind_initialiser.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/attributes_instance_bind_initialiser.py Sat May 30 20:30:28 2009 +0200 @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +class B: + def __init__(self, y): + self.y = y + +class A: + c1 = B + def __init__(self, b): + self.c2 = B + self.c3 = b + +b = B(789) +a = A(b) + +b1 = A.c1(678) # A.c1 is just a reference to B +result_678 = b1.y +b2 = a.c1(567) # a.c1 is just a reference to B +result_567 = b2.y +b3 = a.c2(765) # a.c2 is just a reference to B +result_765 = b3.y + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 892b13f1cba4 -r b8fea0931697 tests/attributes_instance_bind_method.py --- a/tests/attributes_instance_bind_method.py Sat May 30 20:27:20 2009 +0200 +++ b/tests/attributes_instance_bind_method.py Sat May 30 20:30:28 2009 +0200 @@ -7,12 +7,9 @@ return x class A: - c1 = B m1 = B.m def __init__(self, b): - self.c2 = B self.m2 = B.m - self.c3 = b self.m3 = b.m b = B(789) @@ -22,11 +19,4 @@ result_345 = a.m2(b, 345) # a.m2 is unbound result_456 = a.m3(456) # a.m3 is bound to b -b1 = A.c1(678) # A.c1 is just a reference to B -result_678 = b1.y -b2 = a.c1(567) # a.c1 is just a reference to B -result_567 = b2.y -b3 = a.c2(765) # a.c2 is just a reference to B -result_765 = b3.y - # vim: tabstop=4 expandtab shiftwidth=4