feat: X-Redirect pages

This commit is contained in:
2026-04-20 11:36:56 +02:00
parent 5fb10ffb9d
commit 5671d68e21
11 changed files with 334 additions and 73 deletions
+23 -1
View File
@@ -109,7 +109,7 @@ class TestDataDir(BaseTestCase):
self.assert_file_content(self.tmp_path / "test_1" / "value", "value")
assert not (self.tmp_path / "test_1" / ".value").exists()
assert not (self.tmp_path / "test_1" / ".git").exists()
assert (self.tmp_path / "test_1" / "dir").exists()
assert (self.tmp_path / "test_1" / "dir").is_dir()
assert not (self.tmp_path / "test_1" / "dir" / ".invalid").exists()
assert not (self.tmp_path / "test_1" / "dir" / ".test").exists()
@@ -128,6 +128,28 @@ class TestDataDir(BaseTestCase):
self.data_dir.extract_tar_bytes("~test", tar_bytes)
assert not (self.tmp_path / "~test").exists()
def test_empty_create(self) -> None:
self.data_dir.empty("test_1")
assert (self.tmp_path / "test_1").is_dir()
self.assertListEqual(list((self.tmp_path / "test_1").iterdir()), [])
def test_empty_existing(self) -> None:
self.__create_path("test_1", {".host": "value"})
self.data_dir.empty("test_1")
assert (self.tmp_path / "test_1").is_dir()
self.assertListEqual(list((self.tmp_path / "test_1").iterdir()), [])
def test_exists_invalid_dir(self) -> None:
self.__create_path(".certbot")
assert not self.data_dir.exists(".certbot")
def test_exists_ok(self) -> None:
self.__create_path("test_1")
assert self.data_dir.exists("test_1")
def test_exists_fail(self) -> None:
assert not self.data_dir.exists("test_1")
def __create_path(self, path: str, files: dict[str, str] | None = None) -> None:
(self.tmp_path / path).mkdir()
if files is not None: