added a test for when the tree is specified as a dictionary