@@ -83,12 +83,13 @@ def test_zim_creator(tmp_path, png_image, html_file, html_str):
8383 # make sure we have our redirects
8484 assert reader .get_entry_by_path ("home2" ).is_redirect
8585 assert reader .get_entry_by_path ("home2" ).get_redirect_entry ().path == f"{ main_path } "
86- # make sure titles were indexed (html with title for xapian)
86+ # make sure titles were indexed (html with title for xapian ; redirects are not )
8787 # see https://github.com/openzim/python-libzim/issues/125
88- assert "home2" in list (reader .get_suggestions ("Home !!" ))
89- assert "home3" in list (reader .get_suggestions ("Home !!" ))
90- assert "home4" in list (reader .get_suggestions ("Home !!" ))
91- assert "images/yahoo.png" not in list (reader .get_suggestions ("Home !!" ))
88+ # see https://github.com/openzim/libzim/issues/642
89+ assert "home2" not in list (reader .get_suggestions ("Home !!" )) # no is_front > False
90+ assert "home3" in list (reader .get_suggestions ("Home !!" )) # is_front=True
91+ assert "home4" not in list (reader .get_suggestions ("Home !!" )) # is_front=False
92+ assert "images/yahoo.png" in list (reader .get_suggestions ("Home !!" )) # is_frontTrue
9293 # make sure full text was indexed
9394 assert reader .get_search_results_count ("PDF doc" ) >= 1
9495
@@ -278,6 +279,8 @@ def test_urlitem_nonhtmlgzip(tmp_path, gzip_nonhtml_url):
278279 fpath = tmp_path / "test.zim"
279280 with Creator (fpath ) as creator :
280281 creator .add_item (URLItem (url = gzip_nonhtml_url ))
282+
283+ with Creator (fpath ) as creator :
281284 creator .add_item (URLItem (url = gzip_nonhtml_url , use_disk = True ))
282285
283286 zim = Archive (fpath )
0 commit comments