

def test_is_child_parent(self):
    vcs = self.get_vcs()
    vcs.clone()
    vcs.update()
    revisions = list(vcs.log())
    assert vcs.is_child_parent(child_in_question=revisions[0].id, parent_in_question=revisions[1].id)
    assert (not vcs.is_child_parent(child_in_question=revisions[1].id, parent_in_question=revisions[0].id))
    unknown_sha = 'ffffffffffffffffffffffffffffffffffffffff'
    with pytest.raises(UnknownChildRevision):
        vcs.is_child_parent(child_in_question=unknown_sha, parent_in_question=revisions[1].id)
    with pytest.raises(UnknownParentRevision):
        vcs.is_child_parent(child_in_question=revisions[1].id, parent_in_question=unknown_sha)

dataset/ETHPy150Open dropbox/changes/tests/changes/vcs/test_git.py GitVcsTest.test_is_child_parent/original