From d221fbfeacf71a0ef10493db1947c67ef4e940fe Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 18 Nov 2026 13:30:51 +0100 Subject: [PATCH] Kill the mutants of the failed clone's cleanup --- bin/do_epic/test_repos.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/do_epic/test_repos.py b/bin/do_epic/test_repos.py index 8e03ec38..64dd9afb 100644 --- a/bin/do_epic/test_repos.py +++ b/bin/do_epic/test_repos.py @@ -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"))