'Download entire tree without specifying a local path'

@server()
def test_get_tree_with_implicit_local_path(self):

    dirname = env.host_string.replace(':', '-')
    try:
        with hide('everything'):
            get('tree')
        leaves = filter((lambda x: x[0].startswith('/tree')), FILES.items())
        for (path, contents) in leaves:
            path = os.path.join(dirname, path[1:])
            eq_contents(path, contents)
            os.remove(path)
    finally:
        if os.path.exists(dirname):
            shutil.rmtree(dirname)
