Skip to content

Commit e8819ac

Browse files
authored
test: prevent updater path tests from creating stray dirs (#9376)
1 parent fb02c72 commit e8819ac

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/test_updator_socks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ def fake_listdir(path: str) -> list[str]:
227227
return [".dockerignore"]
228228

229229
monkeypatch.setattr(updater_module.os, "makedirs", lambda path, exist_ok=True: None)
230+
monkeypatch.setattr(updater_module, "ensure_dir", lambda path: None)
230231
monkeypatch.setattr(updater_module.os.path, "join", ntpath.join)
231232
monkeypatch.setattr(updater_module.os.path, "normpath", ntpath.normpath)
232233
monkeypatch.setattr(updater_module.os.path, "commonpath", ntpath.commonpath)
@@ -984,6 +985,7 @@ def test_repo_unzip_file_rejects_archive_roots_outside_target_dir(
984985
monkeypatch.setattr(
985986
zip_updator_module.os, "makedirs", lambda path, exist_ok=True: None
986987
)
988+
monkeypatch.setattr(zip_updator_module, "ensure_dir", lambda path: None)
987989
monkeypatch.setattr(zip_updator_module.os.path, "join", ntpath.join)
988990
monkeypatch.setattr(zip_updator_module.os.path, "normpath", ntpath.normpath)
989991
monkeypatch.setattr(zip_updator_module.os.path, "commonpath", ntpath.commonpath)
@@ -1020,6 +1022,7 @@ def fake_listdir(path: str) -> list[str]:
10201022
monkeypatch.setattr(
10211023
zip_updator_module.os, "makedirs", lambda path, exist_ok=True: None
10221024
)
1025+
monkeypatch.setattr(zip_updator_module, "ensure_dir", lambda path: None)
10231026
monkeypatch.setattr(zip_updator_module.os.path, "join", ntpath.join)
10241027
monkeypatch.setattr(zip_updator_module.os.path, "normpath", ntpath.normpath)
10251028
monkeypatch.setattr(zip_updator_module.os.path, "commonpath", ntpath.commonpath)

0 commit comments

Comments
 (0)