Skip to content

Commit 66f01a0

Browse files
committed
update the test file
1 parent 80031e2 commit 66f01a0

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

sdk/cognitivelanguage/azure-ai-language-questionanswering/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/cognitivelanguage/azure-ai-language-questionanswering",
5-
"Tag": "python/cognitivelanguage/azure-ai-language-questionanswering_f8477452ba"
5+
"Tag": "python/cognitivelanguage/azure-ai-language-questionanswering_fd0992c16b"
66
}

sdk/cognitivelanguage/azure-ai-language-questionanswering/tests/test_query_knowledgebase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_query_knowledgebase(self, recorded_test, qna_creds): # standard model
2828
answer_context=KnowledgeBaseAnswerContext(previous_question="Meet Surface Pro 4", previous_qna_id=4),
2929
)
3030
with client:
31-
output = client.get_answers(query_params, project_name=qna_creds["qna_project"], deployment_name="test")
31+
output = client.get_answers(query_params, project_name=qna_creds["qna_project"], deployment_name="production")
3232
assert output.answers
3333
for answer in output.answers:
3434
assert answer.answer

sdk/cognitivelanguage/azure-ai-language-questionanswering/tests/test_query_knowledgebase_async.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def test_query_knowledgebase_basic(self, recorded_test, qna_creds):
2929
answer_context=KnowledgeBaseAnswerContext(previous_question="Meet Surface Pro 4", previous_qna_id=4),
3030
)
3131
async with client:
32-
output = await client.get_answers(params, project_name=qna_creds["qna_project"], deployment_name="test")
32+
output = await client.get_answers(params, project_name=qna_creds["qna_project"], deployment_name="production")
3333
assert output.answers
3434
for answer in output.answers:
3535
assert answer.answer
@@ -50,7 +50,10 @@ async def test_query_knowledgebase_with_short_answer(self, recorded_test, qna_cr
5050
async with client:
5151
output = await client.get_answers(params, project_name=qna_creds["qna_project"], deployment_name="test")
5252
assert output.answers
53-
assert any(a.short_answer for a in output.answers if a.short_answer and a.short_answer.text)
53+
for answer in output.answers:
54+
if answer.short_answer:
55+
assert answer.short_answer.text
56+
assert answer.short_answer.confidence is not None
5457

5558
@pytest.mark.asyncio
5659
async def test_query_knowledgebase_filter(self, recorded_test, qna_creds):
@@ -74,7 +77,7 @@ async def test_query_knowledgebase_filter(self, recorded_test, qna_creds):
7477
response = await client.get_answers(
7578
params,
7679
project_name=qna_creds["qna_project"],
77-
deployment_name="test",
80+
deployment_name="production",
7881
)
7982
assert response.answers
8083
assert any(

0 commit comments

Comments
 (0)