#NEWLINE# def test_deepgetattr( self ) : #NEWLINE# #INDENT# a = type ( '' , ( ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# a . b = type ( '' , ( ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# a . b . c = type ( '' , ( ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# a . b . c . d = 'deep value' #NEWLINE# a . b . c . d2 = 'deep value 2' #NEWLINE# a . b . c . e = 'a.b.c' #NEWLINE# self . assertEqual ( 'deep value' , b_utils . deepgetattr ( a . b . c , 'd' ) ) #NEWLINE# self . assertEqual ( 'deep value 2' , b_utils . deepgetattr ( self . b . c , 'd2' ) ) #NEWLINE# self . assertEqual ( 'a.b.c' , b_utils . deepgetattr ( a . b . c , 'e' ) ) #NEWLINE# self . assertEqual ( 'deep value' , b_utils . deepgetattr ( a , 'b.c.d' ) ) #NEWLINE# self . assertEqual ( 'deep value 2' , b_utils . deepgetattr ( a , 'b.c.d2' ) ) #NEWLINE# self . assertRaises ( AttributeError , b_utils . deepgetattr , a . b , 'z' )