Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Add tests for search_all with best_match
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezro committed Jun 23, 2022
1 parent 7dded5e commit fa84dff
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/template_finder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,15 @@ def test_search_all():
- test passes if 3 matches result
"""
matches = template_finder.search_all(empty, image, threshold=0.98)
assert len(matches) == 3
assert len(matches) == 3
"""
Test first / best match
"""
matches = template_finder.search_all(cross, image, threshold=0.6, best_match=True)
assert len(matches) == 1
matches = template_finder.search_all([cross], image, threshold=0.6, best_match=True)
assert len(matches) == 1
matches = template_finder.search_all(slash, image, threshold=0.6, best_match=True)
assert len(matches) == 1
matches = template_finder.search_all([slash], image, threshold=0.6, best_match=True)
assert len(matches) == 1

0 comments on commit fa84dff

Please sign in to comment.