Kill the mutants that survived on the lines the release review changed
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import contextlib
|
||||
import os
|
||||
import pathlib
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -35,6 +36,14 @@ class Git(unittest.TestCase):
|
||||
self.assertTrue(done.reason.startswith("git log could not start: "), done.reason)
|
||||
self.assertIn("/code/gone", done.reason)
|
||||
|
||||
def test_runs_git_in_the_environment_given_and_only_guarded_stops_the_fetch_of_missing_objects(self):
|
||||
shown = ("-c", "alias.shown=!echo \"$SHOWN_TO_GIT/$GIT_NO_LAZY_FETCH\"", "shown")
|
||||
given = {**{name: value for name, value in os.environ.items() if name != "GIT_NO_LAZY_FETCH"}, "SHOWN_TO_GIT": "given"}
|
||||
self.assertEqual(git_repo.git(*shown, env=given), "given/\n")
|
||||
self.assertEqual(git_repo.git(*shown, env=given, guarded=True), "given/1\n")
|
||||
self.assertNotIn("SHOWN_TO_GIT", os.environ)
|
||||
self.assertEqual(git_repo.git(*shown, guarded=True), "/1\n")
|
||||
|
||||
|
||||
class Guarded(unittest.TestCase):
|
||||
"""A checkout whose own config may name a program for git to run."""
|
||||
|
||||
Reference in New Issue
Block a user