Fix the errors related to installed module having invalid commit data (#4086)

This commit is contained in:
jack1142
2020-08-05 20:35:57 +02:00
committed by GitHub
parent 5221b1e4a3
commit c673bb0979
4 changed files with 77 additions and 9 deletions

View File

@@ -381,7 +381,7 @@ async def test_git_is_ancestor_false(git_repo):
@pytest.mark.asyncio
async def test_git_is_ancestor_invalid_ref(git_repo):
async def test_git_is_ancestor_invalid_object(git_repo):
p = await git_repo._run(
ProcessFormatter().format(
git_repo.GIT_IS_ANCESTOR,
@@ -394,6 +394,22 @@ async def test_git_is_ancestor_invalid_ref(git_repo):
assert p.stderr.decode().strip() == "fatal: Not a valid object name invalid1"
@pytest.mark.asyncio
async def test_git_is_ancestor_invalid_commit(git_repo):
p = await git_repo._run(
ProcessFormatter().format(
git_repo.GIT_IS_ANCESTOR,
path=git_repo.folder_path,
maybe_ancestor_rev="0123456789abcde0123456789abcde0123456789",
descendant_rev="c950fc05a540dd76b944719c2a3302da2e2f3090",
)
)
assert p.returncode == 128
assert p.stderr.decode().strip() == (
"fatal: Not a valid commit name 0123456789abcde0123456789abcde0123456789"
)
@pytest.mark.asyncio
async def test_git_check_if_module_exists_true(git_repo):
p = await git_repo._run(