#NEWLINE# def test_get_subtree_1_level( self ) : #NEWLINE# #INDENT# '\n        Test get_subtree() for a read with tree 1 level deep.\n        ' #NEWLINE# response = { #NEWLINE# #INDENT# 'node' : { #NEWLINE# #INDENT# 'key' : '/test' , #NEWLINE# 'value' : 'hello' , #NEWLINE# 'expiration' : None , #NEWLINE# 'ttl' : None , #NEWLINE# 'modifiedIndex' : 5 , #NEWLINE# 'createdIndex' : 1 , #NEWLINE# 'newKey' : False , #NEWLINE# 'dir' : False , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# result = etcd . EtcdResult ( ** response ) #NEWLINE# self . assertEqual ( result . key , response [ 'node' ] [ 'key' ] ) #NEWLINE# self . assertEqual ( self . value , response [ 'node' ] [ 'value' ] ) #NEWLINE# subtree = list ( result . get_subtree ( leaves_only = True ) ) #NEWLINE# self . assertListEqual ( [ result ] , subtree ) #NEWLINE# subtree = list ( result . get_subtree ( leaves_only = False ) ) #NEWLINE# self . assertListEqual ( [ result ] , subtree )