#NEWLINE# def test_search_return_dict_head( ) : #NEWLINE# #INDENT# tdict = { #NEWLINE# #INDENT# 'a' : { #NEWLINE# #INDENT# 'b' : { #NEWLINE# #INDENT# 0 : 0 , #NEWLINE# 1 : 1 , #NEWLINE# 2 : 2 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# res = dpath . util . search ( tdict , '/a/b' ) #NEWLINE# assert isinstance ( res [ 'a' ] [ 'b' ] , dict ) #NEWLINE# assert ( len ( res [ 'a' ] [ 'b' ] ) == 3 ) #NEWLINE# assert ( res [ 'a' ] [ 'b' ] == { #NEWLINE# #INDENT# 0 : 0 , #NEWLINE# 1 : 1 , #NEWLINE# 2 : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# res = dpath . util . search ( tdict , [ 'a' , 'b' ] ) #NEWLINE# assert isinstance ( res [ 'a' ] [ 'b' ] , dict ) #NEWLINE# assert ( len ( res [ 'a' ] [ 'b' ] ) == 3 ) #NEWLINE# assert ( res [ 'a' ] [ 'b' ] == { #NEWLINE# #INDENT# 0 : 0 , #NEWLINE# 1 : 1 , #NEWLINE# 2 : 2 , #NEWLINE# #UNINDENT# } )