Permalink
Browse files

nested test

  • Loading branch information...
1 parent 0e4ec95 commit 41c04356f3db9b3e4ecaa9ac3e8eaba209816afb @iskandr iskandr committed Aug 19, 2013
Showing with 25 additions and 0 deletions.
  1. +25 −0 test/test_nested_classes.py
@@ -0,0 +1,25 @@
+
+from testing_helpers import wrap
+
+@wrap
+def construct_and_get_fields(a,b):
+ class A(object):
+ def __init__(self, a):
+ self.a = a
+ class B(A):
+ def __init__(self, a, b):
+ A.__init__(self, a)
+ self.b = b
+ obj = A(a)
+ obj2 = B(a,b)
+ return obj.a, obj2.a, obj2.b
+
+def test_nested_objects():
+ (a1, a2, a3) = construct_and_get_fields(1,2.0)
+ assert a1 == 1
+ assert a2 == 1
+ assert a3 == 2.0
+
+
+if __name__ == '__main__':
+ test_nested_objects()

0 comments on commit 41c0435

Please sign in to comment.