2007-01-21 | paulb | raw files shortlog changelog graph | Added tests for multiple instances and for local namespaces. | |
tests/attr.py (file) |
1.1 --- a/tests/attr.py Sat Jan 20 22:51:51 2007 +0100 1.2 +++ b/tests/attr.py Sun Jan 21 00:17:09 2007 +0100 1.3 @@ -10,3 +10,34 @@ 1.4 else: 1.5 a = B() 1.6 a.x 1.7 + 1.8 +a1 = A() 1.9 +a2 = A() 1.10 +if x: 1.11 + a1.x = 2 1.12 +else: 1.13 + a2.x = "2" 1.14 +a1.x 1.15 +a2.x 1.16 + 1.17 +def test_subclass(): 1.18 + x = 1 1.19 + if x: 1.20 + a = A() 1.21 + a.x = 2 1.22 + else: 1.23 + a = B() 1.24 + a.x 1.25 + 1.26 +def test_instances(): 1.27 + a1 = A() 1.28 + a2 = A() 1.29 + if x: 1.30 + a1.x = 2 1.31 + else: 1.32 + a2.x = "2" 1.33 + a1.x 1.34 + a2.x 1.35 + 1.36 +test_subclass() 1.37 +test_instances()