def test_ahead_branch(repo: Repo): add_ahead_branch(repo) reports = get_merged_reports(repo) assert len(reports) == 0
def test_different_branches(repo: Repo): branch1 = add_ahead_branch(repo, "branch1") branch2 = add_ahead_branch(repo, "branch2") assert not is_ancestors_of(ancestor=branch1.commit, commit=branch2.commit)
def test_ahead_branch(repo: Repo): ahead_branch = add_ahead_branch(repo) assert is_ancestors_of(ancestor=repo.commit("HEAD"), commit=ahead_branch.commit)
def test_behind_branch(repo: Repo): ahead_branch = add_ahead_branch(repo) assert not is_ancestors_of(ancestor=ahead_branch.commit, commit=repo.commit("HEAD"))
def test_untracked_branch(cloned_repo: Repo): # The untracked branch should not be merged in master branch # therefore, we create a branch that is ahead of the master branch add_ahead_branch(cloned_repo, "untracked_branch") reports = get_untracked_reports(cloned_repo) assert len(reports) > 0