fix(data_dir): remove dot files everywhere

This commit is contained in:
2026-04-20 10:06:48 +02:00
parent 978b799ee8
commit fc7d3cb0e8
3 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ class BaseTestCase(unittest.TestCase):
self.tmp_path = pathlib.Path(self.tmp_dir.name)
return self.tmp_dir.name
def mock(self, spec: type | None = None) -> unittest.mock.Mock:
def new_mock(self, spec: type | None = None) -> unittest.mock.Mock:
mock = unittest.mock.Mock(spec)
self.mocks += [mock]
return mock
+12 -1
View File
@@ -97,10 +97,21 @@ class TestDataDir(BaseTestCase):
def test_extract_tar_bytes_create_without_dotfiles(self) -> None:
tar_bytes = self.__get_tar_bytes(
{"value": "value", ".value": "value", ".git/test": "test"}
{
"value": "value",
".value": "value",
".git/test": "test",
"dir/.invalid": "value",
"dir/.test/hello": "value",
}
)
self.data_dir.extract_tar_bytes("test_1", tar_bytes)
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 not (self.tmp_path / "test_1" / "dir" / ".invalid").exists()
assert not (self.tmp_path / "test_1" / "dir" / ".test").exists()
def test_extract_tar_bytes_update(self) -> None:
self.__create_path(