Skip to content

Commit

Permalink
feat: add unit tests for FilterBot class
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-nightly[bot] committed Dec 14, 2023
1 parent c811ac0 commit f25dae8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions sweepai/agents/filter_agent_test.py
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

0 comments on commit f25dae8

Please sign in to comment.