'Create a single-branched project hierarchy with the specified size.
:param hierarchy_size: the desired hierarchy size, default is 1 -
a project with one child.
:returns projects: a list of the projects in the created hierarchy.'

def _create_projects_hierarchy(self, hierarchy_size=1):

    new_ref = unit.new_project_ref(domain_id=self.domain_id)
    resp = self.post('/projects', body={'project': new_ref})
    projects = [resp.result]
    for i in range(hierarchy_size):
        new_ref = unit.new_project_ref(domain_id=self.domain_id, parent_id=projects[i]['project']['id'])
        resp = self.post('/projects', body={'project': new_ref})
        self.assertValidProjectResponse(resp, new_ref)
        projects.append(resp.result)
    return projects
