Skip to content

Commit

Permalink
fixed black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Dec 4, 2023
1 parent 047be87 commit 4842bc7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_libzim_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ def test_creator_redirection(fpath, lipsum_item):
sugg_bonjour.getResults(0, sugg_hello.getEstimatedMatches())
)


def test_creator_alias(fpath, lipsum_item):
# ensure we can't add if not started
c = Creator(fpath)
Expand All @@ -478,15 +479,21 @@ def test_creator_alias(fpath, lipsum_item):
c.add_item(lipsum_item)
c.add_alias("home", "hello", HOME_PATH, {Hint.FRONT_ARTICLE: True})
with pytest.raises(RuntimeError, match="doesn't exist"):
c.add_alias("accueil", "bonjour", HOME_PATH+"_non_existent", {Hint.FRONT_ARTICLE: True})
c.add_alias(
"accueil",
"bonjour",
HOME_PATH + "_non_existent",
{Hint.FRONT_ARTICLE: True},
)

zim = Archive(fpath)
assert zim.entry_count == 2
assert zim.has_entry_by_path("home") is True
assert zim.has_entry_by_path("accueil") is False
assert not zim.get_entry_by_path("home").is_redirect
assert (
zim.get_entry_by_path("home").get_item().content == zim.get_entry_by_path(HOME_PATH).get_item().content
zim.get_entry_by_path("home").get_item().content
== zim.get_entry_by_path(HOME_PATH).get_item().content
)


Expand Down

0 comments on commit 4842bc7

Please sign in to comment.