Kill the mutants of the failed clone's cleanup
CI / tests (pull_request) Failing after 3m37s

This commit is contained in:
2026-11-18 13:30:51 +01:00
parent 28ff6d7731
commit d221fbfeac
+6
View File
@@ -2,6 +2,7 @@ import pathlib
import sys
import tempfile
import unittest
import unittest.mock
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
@@ -108,6 +109,11 @@ class LocateTest(unittest.TestCase):
self.origins[str(self.billing)] = "billing"
self.assertIn(f"{self.billing} has an origin, billing, with no host and owner to put another repo under", self.unsure(FakeGit(self.origins)))
def test_asks_all_the_same_where_the_leftovers_of_a_failed_clone_cannot_be_removed(self) -> None:
self.configure()
with unittest.mock.patch("do_epic.repos.shutil.rmtree", side_effect=lambda path, ignore_errors: None if ignore_errors is True else self.fail("rmtree must ignore errors")):
self.assertIn("cannot clone", self.unsure(FakeGit(self.origins, refused="git@github.com:acme/ledger")))
def test_asks_where_the_clone_fails_naming_the_url_and_the_reason(self) -> None:
self.configure()
asked = self.unsure(FakeGit(self.origins, refused="git@github.com:acme/ledger"))