Ejemplo n.º 1
0
    def test_broken_submodules(self):
        manifest_url = create_git_repo(self.tmp, "manifest")
        create_broken_submodules(self.tmp)
        xml = """
<manifest>
    <remote name="origin" fetch="{tmp}/srv" />
    <project name="foo.git" path="foo" />
    <project name="bar.git" path="foo/bar"/>
</manifest>
"""
        xml = xml.format(tmp=self.tmp)
        push_file(self.tmp, "manifest", "default.xml", xml)
        work = os.path.join(self.tmp, "work")
        worktree = qisrc.worktree.create(work)
        manifest = qisrc.sync.fetch_manifest(worktree, manifest_url)
        qisrc.sync.init_worktree(worktree, manifest)
        self.assertEqual(len(worktree.git_projects), 3)
Ejemplo n.º 2
0
    def test_broken_submodules(self):
        manifest_url = create_git_repo(self.tmp, "manifest")
        create_broken_submodules(self.tmp)
        xml = """
<manifest>
    <remote name="origin" fetch="{tmp}/srv" />
    <project name="foo.git" path="foo" />
</manifest>
"""
        xml = xml.format(tmp=self.tmp)
        push_file(self.tmp, "manifest", "default.xml", xml)
        work = os.path.join(self.tmp, "work")
        worktree = qisys.worktree.create(work)
        manifest = qisrc.sync.fetch_load_manifest(worktree, manifest_url)
        # pylint: disable-msg=E1101
        with pytest.raises(Exception) as e:
            qisrc.sync.init_worktree(worktree, manifest)
        assert "Broken submodules" in str(e.value)