feat: 仓库接入通用化——批量预检 + 多仓 ssh 别名配给

This commit is contained in:
host committed 2026-10-30 04:18:09 +08:00
1 parent 0787496427
commit 50ba8d9297
3 files changed
+77 -3

No files matched your search

+20
View File
@@ -146,6 +146,26 @@ class CheckRepoAccessTestCase(unittest.TestCase):
self.assertFalse(ok)
self.assertIn("timed out", detail)
def test_many_continues_after_failure(self):
seen = []
def runner(cmd, timeout=None):
seen.append(cmd[2])
if "good" in cmd[2]:
return SimpleNamespace(returncode=0,
stdout="abc123\tHEAD\n", stderr="")
return SimpleNamespace(returncode=128, stdout="",
stderr="fatal: denied")
from cloud.repos import check_repo_access_many
out = check_repo_access_many(
["git@github.com:o/good.git", "git@github.com:o/bad.git"],
runner=runner)
self.assertEqual(seen, ["git@github.com:o/good.git",
"git@github.com:o/bad.git"])
self.assertTrue(out["git@github.com:o/good.git"][0])
self.assertFalse(out["git@github.com:o/bad.git"][0])
self.assertEqual(check_repo_access_many([]), {})
class CheckoutDirTestCase(unittest.TestCase):
def test_sanitizes_and_stays_inside(self):