-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add unit tests for FilterBot class
- Loading branch information
1 parent
c811ac0
commit f25dae8
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytest | ||
|
||
from sweepai.agents.filter_agent import FilterBot | ||
|
||
|
||
def test_filter_query(): | ||
bot = FilterBot() | ||
|
||
# Test case: query with unnecessary terms | ||
query = "How to sort a list in Python" | ||
expected_output = ["sort", "list", "Python"] | ||
assert bot.filter_query(query) == expected_output | ||
|
||
# Test case: query without unnecessary terms | ||
query = "sort list Python" | ||
expected_output = ["sort", "list", "Python"] | ||
assert bot.filter_query(query) == expected_output | ||
|
||
# Test case: empty query | ||
query = "" | ||
expected_output = [] | ||
assert bot.filter_query(query) == expected_output |