feat: X-Redirect pages
This commit is contained in:
+23
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user