Skip to content

Commit 930bf64

Browse files
committed
Update test to use FIND_PROMPT
1 parent 1ba3420 commit 930bf64

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/unit/test_workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from structured_qa.workflow import find_retrieve_answer
1+
from structured_qa.workflow import find_retrieve_answer, FIND_PROMPT
22

33

44
def test_find_retrieve_answer_multi_sections(tmp_path, mocker):
55
model = mocker.MagicMock()
66

77
def side_effect(messages):
8-
if "You are given two pieces" in messages[0]["content"]:
8+
if FIND_PROMPT[:10] in messages[0]["content"]:
99
if "section_1" in messages[0]["content"]:
1010
return {"choices": [{"message": {"content": "section_1"}}]}
1111
else:
@@ -35,7 +35,7 @@ def test_find_retrieve_answer_unkown_section(tmp_path, mocker):
3535
model = mocker.MagicMock()
3636

3737
def side_effect(messages):
38-
if "Given an input question" in messages[0]["content"]:
38+
if FIND_PROMPT[:10] in messages[0]["content"]:
3939
return {"choices": [{"message": {"content": "section_x"}}]}
4040

4141
model.create_chat_completion.side_effect = side_effect

0 commit comments

Comments
 (0)