def test_add_manifest_project(self):
        xml = """
<worktree>
    <project src="manifest/default" />
</worktree>
"""
        worktree = self.create_worktee(xml)
        manifest_projects = worktree.get_manifest_projects()
        manifest_srcs = [p.src for p in manifest_projects]
        self.assertEquals(manifest_srcs, list())

        # Set the manifest project
        worktree.set_manifest_project("manifest/default")
        manifest_projects = worktree.get_manifest_projects()
        manifest_srcs = [p.src for p in manifest_projects]
        self.assertEquals(manifest_srcs, ["manifest/default"])

        # Adding same proect twice should do nothing:
        worktree.set_manifest_project("manifest/default")
        manifest_srcs = [p.src for p in manifest_projects]
        self.assertEquals(manifest_srcs, ["manifest/default"])
    def test_get_manifest_projects(self):
        xml = """
<worktree>
  <project src="manifest/default"
           manifest="true"
  />
  <project src="manifest/custom"
           manifest="true"
  />
  <project src="foo" />
</worktree>
"""
        worktree = self.create_worktee(xml)
        manifest_projects = worktree.get_manifest_projects()
        manifest_srcs = [p.src for p in manifest_projects]
        self.assertEquals(manifest_srcs, ["manifest/custom", "manifest/default"])