From b42613fca98a45dc6c17f71352f274c2e868e651 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Mon, 7 Oct 2024 23:01:23 +0200 Subject: [PATCH] test(backend): fix tests contains_json --- .../agenta_backend/tests/unit/test_evaluators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agenta-backend/agenta_backend/tests/unit/test_evaluators.py b/agenta-backend/agenta_backend/tests/unit/test_evaluators.py index 0714a34ef4..0b4f65a00e 100644 --- a/agenta-backend/agenta_backend/tests/unit/test_evaluators.py +++ b/agenta-backend/agenta_backend/tests/unit/test_evaluators.py @@ -222,13 +222,13 @@ async def test_auto_contains_all(output, substrings, case_sensitive, expected): @pytest.mark.parametrize( "output, expected", [ - ('Some random text {"key": "value"} more text', None), - ("No JSON here!", None), - ("{Malformed JSON, nope!}", None), + ('Some random text {"key": "value"} more text', True), + ("No JSON here!", False), + ("{Malformed JSON, nope!}", False), ('{"valid": "json", "number": 123}', True), ({"data": {"message": "The capital of Azerbaijan is Baku."}}, True), ({"data": '{"message": "The capital of Azerbaijan is Baku."}'}, True), - ({"data": "The capital of Azerbaijan is Baku."}, None), + ({"data": "The capital of Azerbaijan is Baku."}, False), ], ) @pytest.mark.asyncio