@@ -32,13 +32,16 @@ def fake_download(url: str, destination: Path, overwrite: bool = False, progress
3232 destination .write_bytes (b"fresh" )
3333 return destination
3434
35- def fake_unzip (zip_path : Path , target_dir : Path ) -> Path :
35+ def fake_unzip (zip_path : Path , target_dir : Path , include_globs = None ) -> Path :
3636 calls ["unzip" ] += 1
37+ assert include_globs == ensure_artifacts ._BAKE_INPUT_GLOBS
3738 if calls ["unzip" ] == 1 :
3839 target_dir .mkdir (parents = True , exist_ok = True )
3940 (target_dir / "partial.txt" ).write_text ("partial" , encoding = "utf-8" )
4041 raise RuntimeError ("bad zip payload" )
41- (target_dir / "Documentation" / "en" ).mkdir (parents = True , exist_ok = True )
42+ manual_dir = target_dir / "Documentation" / "en" / "Manual"
43+ manual_dir .mkdir (parents = True , exist_ok = True )
44+ (manual_dir / "index.html" ).write_text ("<html></html>" , encoding = "utf-8" )
4245 return target_dir
4346
4447 monkeypatch .setattr (ensure_artifacts , "download_zip" , fake_download )
@@ -50,7 +53,7 @@ def fake_unzip(zip_path: Path, target_dir: Path) -> Path:
5053
5154 assert calls ["unzip" ] == 2
5255 assert calls ["download_overwrite" ] == [True ]
53- assert (raw_unzipped / "Documentation" / "en" ). is_dir ()
56+ assert (raw_unzipped / "Documentation" / "en" / "Manual" / "index.html" ). is_file ()
5457 assert not (raw_unzipped / "partial.txt" ).exists ()
5558
5659
@@ -65,10 +68,13 @@ def test_nonready_unzip_dir_is_cleared_before_unzip(monkeypatch, tmp_path: Path)
6568
6669 calls = {"unzip" : 0 }
6770
68- def fake_unzip (zip_path : Path , target_dir : Path ) -> Path :
71+ def fake_unzip (zip_path : Path , target_dir : Path , include_globs = None ) -> Path :
6972 calls ["unzip" ] += 1
73+ assert include_globs == ensure_artifacts ._BAKE_INPUT_GLOBS
7074 assert not (target_dir / "stale.tmp" ).exists ()
71- (target_dir / "Documentation" / "en" ).mkdir (parents = True , exist_ok = True )
75+ manual_dir = target_dir / "Documentation" / "en" / "Manual"
76+ manual_dir .mkdir (parents = True , exist_ok = True )
77+ (manual_dir / "index.html" ).write_text ("<html></html>" , encoding = "utf-8" )
7278 return target_dir
7379
7480 monkeypatch .setattr (ensure_artifacts , "safe_unzip" , fake_unzip )
@@ -79,4 +85,4 @@ def fake_unzip(zip_path: Path, target_dir: Path) -> Path:
7985 ensure_artifacts .ensure (cfg )
8086
8187 assert calls ["unzip" ] == 1
82- assert (raw_unzipped / "Documentation" / "en" ). is_dir ()
88+ assert (raw_unzipped / "Documentation" / "en" / "Manual" / "index.html" ). is_file ()
0 commit comments