1
0
Fork 0
Code Issues Pull requests Projects Releases 2 Packages Wiki Activity Actions Pages

Add full and fresh-clone release rehearsals

This commit is contained in:
Andraxion 2026-07-29 16:10:37 -04:00
parent a901c9705b
commit f41a45213b
3 changed files with 210 additions and 3 deletions

View file

@ -0,0 +1,29 @@
from __future__ import annotations
import unittest
from tools.milestone5_fresh_clone import (
COMMIT_PATTERN,
EXPECTED_ORIGINS,
PUBLIC_REPOSITORY,
)
class Milestone5FreshCloneTests(unittest.TestCase):
def test_public_clone_route_has_no_embedded_credentials(self) -> None:
self.assertEqual(
"https://repo.andraxion.net/administrator/DocForge2.git",
PUBLIC_REPOSITORY,
)
self.assertNotIn("@", PUBLIC_REPOSITORY)
self.assertIn(PUBLIC_REPOSITORY, EXPECTED_ORIGINS)
def test_release_commit_requires_one_full_lowercase_sha1(self) -> None:
self.assertIsNotNone(COMMIT_PATTERN.fullmatch("a" * 40))
for invalid in ("a" * 39, "A" * 40, "main", "v1.4.0", "../" + "a" * 40):
with self.subTest(invalid=invalid):
self.assertIsNone(COMMIT_PATTERN.fullmatch(invalid))
if __name__ == "__main__":
unittest.main()