feat: cert_manager detect file change

This commit is contained in:
2026-04-20 19:55:35 +02:00
parent 5ff397e6d1
commit 7f02abca1a
7 changed files with 65 additions and 21 deletions
+11
View File
@@ -249,6 +249,17 @@ class TestRegistry(BaseTestCase):
self.socket_mock, "new_host", self.context_mock
)
def test_detect_default_cert_change(self) -> None:
self._make_self_signed("localhost")
assert self.cert_manager.detect_default_cert_change("localhost")
def test_detect_default_cert_change_nothing(self) -> None:
self._make_self_signed("localhost")
self.cert_manager.last_file_change = (
(self.self_signed_path / "localhost" / CertManager.CRT_FILE).stat().st_mtime
)
assert not self.cert_manager.detect_default_cert_change("localhost")
def _make_self_signed(self, host: str) -> None:
(self.self_signed_path / host).mkdir(parents=True, exist_ok=True)
(self.self_signed_path / host / CertManager.CRT_FILE).touch()