Skip to content

Commit

Permalink
Added native int as Hint test (filtered)
Browse files Browse the repository at this point in the history
One may think that it would be valid to pass a dict with
an int as key that matches the Hints in libzim's item.h.

Those are filtered in pylibzim as not recognized as Hint objects.
  • Loading branch information
rgaudin committed Aug 22, 2021
1 parent b75cf6b commit 25a5055
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_libzim_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ def test_hints_values(fpath):
c.add_item(StaticItem(path="5", title="", hints={5: True}))
c.add_item(StaticItem(path="6", title="", hints={"yolo": True}))
c.add_item(StaticItem(path="7", title="", hints={"FRONT_ARTICLE": True}))
c.add_item(StaticItem(path="8", title="", hints={0: True}))

# non-existent Hint
with pytest.raises(AttributeError, match="YOLO"):
Expand Down

0 comments on commit 25a5055

Please sign in to comment.