Skip to content

Add test for Archive.get_entry_by_title with distinct title and title… - #273

Merged
benoit74 merged 1 commit into
openzim:mainfrom
Sriram-Nambiar:test-get-entry-by-title
Oct 25, 2026
Merged

benoit74 merged 1 commit into
openzim:mainfrom
Sriram-Nambiar:test-get-entry-by-title

Conversation

@Sriram-Nambiar

Copy link
Copy Markdown
Contributor

Fixes #223.

Adds test_get_entry_by_title_utf8 in tests/test_libzim_creator.py to verify that Archive.get_entry_by_title() resolves via the title index rather than path fallback.

Covers:

  • Standard ASCII title distinct from path
  • Unusual UTF-8 title containing accents, non-Latin scripts (Japanese, Hindi), emojis, and symbols
  • Verifying path is not resolved as title
  • Verifying missing title raises KeyError

@benoit74

Copy link
Copy Markdown
Contributor

@Sriram-Nambiar please rebase on main and force push with lease, so that we have tests running on this PR

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.09%. Comparing base (f4c0adb) to head (fc084ac).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #273   +/-   ##
=======================================
  Coverage   94.09%   94.09%           
=======================================
  Files           1        1           
  Lines         542      542           
=======================================
  Hits          510      510           
  Misses         32       32           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sriram-Nambiar
Sriram-Nambiar force-pushed the test-get-entry-by-title branch from 055cbf8 to fc084ac Compare October 22, 2026 13:52
@benoit74
benoit74 self-requested a review October 25, 2026 17:33
@benoit74
benoit74 force-pushed the test-get-entry-by-title branch from fc084ac to dd4aa9c Compare October 25, 2026 17:33
@benoit74
benoit74 merged commit d9453a9 into openzim:main Oct 25, 2026
1 check passed
pawank925 pushed a commit to pawank925/python-libzim that referenced this pull request Oct 28, 2026
…title

Add test for Archive.get_entry_by_title with distinct title and title…
pawank925 added a commit to pawank925/python-libzim that referenced this pull request Oct 28, 2026
…title

Add test for Archive.get_entry_by_title with distinct title and title…
pawank925 added a commit to pawank925/python-libzim that referenced this pull request Oct 28, 2026
…title

Add test for Archive.get_entry_by_title with distinct title and title…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_entry_by_title not properly tested

2 participants