dream

Форк
0
43 строки · 1.7 Кб
1
import allure
2
import pytest
3
import requests
4

5

6
@allure.description("""Knowledge grounding multi-language test""")
7
@pytest.mark.parametrize(
8
    "checked_sentence, knowledge, text, expected",
9
    [
10
        (
11
            "When Mabel visited their home to play the piano, "
12
            "she occasionally glimpsed a flitting swirl of white in the next room, "
13
            "sometimes even received a note of thanks for calling, but she never actually "
14
            "spoke with the reclusive, almost spectral Emily.",
15
            "The real-life soap opera behind the publication of Emily Dickinson’s poems\n"
16
            "When Mabel visited their home to play the piano, she occasionally glimpsed "
17
            "a flitting swirl of white in the next room, sometimes even received a note of "
18
            "thanks for calling, but she never actually spoke with the reclusive, almost spectral Emily.",
19
            "Yeah she was an icon she died in 1886 at the tender age of 55.",
20
            True,
21
        ),
22
        (
23
            "Penguins are a group of aquatic flightless birds.",
24
            "Penguins are a group of aquatic flightless birds.",
25
            "Who are penguins?",
26
            True,
27
        ),
28
    ],
29
)
30
def test_knowledge_grounding(url: str, checked_sentence, knowledge, text, expected):
31
    history = (
32
        "Do you know who Emily Dickson is?\n"
33
        'Emily Dickinson? The poet? I do! "Tell all the truth, but tell it slant" '
34
        "she once said. Do you like her poetry?"
35
    )
36

37
    request_data = {
38
        "batch": [
39
            {"checked_sentence": checked_sentence, "knowledge": knowledge, "text": text, "history": history},
40
        ]
41
    }
42
    results = requests.post(url, json=request_data).json()
43
    assert all(results)
44

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.