mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-05-01 21:20:19 +00:00
Remove setup.sh in favor of skyvern CLI (#4737)
This commit is contained in:
parent
08d3b04d14
commit
155c07f8be
77 changed files with 12358 additions and 10 deletions
22
tests/unit/test_llm_response_parsing.py
Normal file
22
tests/unit/test_llm_response_parsing.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import pytest
|
||||
|
||||
from skyvern.forge.sdk.api.llm.utils import _coerce_response_to_dict
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("response", "expected"),
|
||||
[
|
||||
({"page_info": "Select country"}, ({"page_info": "Select country"}, False)),
|
||||
([{"page_info": "First"}, {"page_info": "Second"}], ({"page_info": "First"}, False)),
|
||||
(["text", {"page_info": "First dict"}], ({"page_info": "First dict"}, False)),
|
||||
([1, 2, 3], ({}, True)),
|
||||
("not-a-dict", ({}, True)),
|
||||
([], ({}, True)),
|
||||
],
|
||||
)
|
||||
def test_coerce_response_to_dict_variants(response, expected):
|
||||
try:
|
||||
parsed = _coerce_response_to_dict(response)
|
||||
assert parsed == expected[0]
|
||||
except Exception:
|
||||
assert expected[1]
|
||||
Loading…
Add table
Add a link
Reference in a new issue