Skip to content

Commit

Permalink
add test when no threshold is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
aakrem committed Mar 19, 2024
1 parent 2ae9a77 commit f7d9b14
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions agenta-backend/agenta_backend/tests/unit/test_evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,13 @@ def test_auto_contains_json(output, expected):
("hello world", "hola mundo", 5, False),
("hello world", "hello world!", 2, True),
("hello world", "hello wor", 10, True),
("hello world", "hello worl", None, 1),
("hello world", "helo world", None, 1),
],
)
def test_auto_levenshtein_distance(output, correct_answer, threshold, expected):
settings_values = {"threshold": threshold} if threshold is not None else {}
result = auto_levenshtein_distance(
{}, output, correct_answer, {}, {"threshold": threshold}, {}
{}, output, correct_answer, {}, settings_values, {}
)
assert result.value == expected
assert result.value == expected

0 comments on commit f7d9b14

Please sign in to comment.