AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(agent/tests): Update `test_utils.py:test_extract_json_from_response*` in accordance with 956cdc7
Reinier van der Leer9b7fee673ed2
diff --git a/autogpts/autogpt/tests/unit/test_utils.py b/autogpts/autogpt/tests/unit/test_utils.pyindex afe2497dca..758e27f157 100644--- a/autogpts/autogpt/tests/unit/test_utils.py+++ b/autogpts/autogpt/tests/unit/test_utils.py@@ -1,3 +1,4 @@+import jsonimport osfrom unittest.mock import patch@@ -194,14 +195,14 @@ def test_get_current_git_branch_failure(mock_repo):def test_extract_json_from_response(valid_json_response: dict):- emulated_response_from_openai = str(valid_json_response)+ emulated_response_from_openai = json.dumps(valid_json_response)assert (extract_dict_from_response(emulated_response_from_openai) == valid_json_response)def test_extract_json_from_response_wrapped_in_code_block(valid_json_response: dict):- emulated_response_from_openai = "```" + str(valid_json_response) + "```"+ emulated_response_from_openai = "```" + json.dumps(valid_json_response) + "```"assert (extract_dict_from_response(emulated_response_from_openai) == valid_json_response)@@ -210,14 +211,14 @@ def test_extract_json_from_response_wrapped_in_code_block(valid_json_response: ddef test_extract_json_from_response_wrapped_in_code_block_with_language(valid_json_response: dict,):- emulated_response_from_openai = "```json" + str(valid_json_response) + "```"+ emulated_response_from_openai = "```json" + json.dumps(valid_json_response) + "```"assert (extract_dict_from_response(emulated_response_from_openai) == valid_json_response)def test_extract_json_from_response_json_contained_in_string(valid_json_response: dict):- emulated_response_from_openai = "sentence1" + str(valid_json_response) + "sentence2"+ emulated_response_from_openai = "sentence1" + json.dumps(valid_json_response) + "sentence2"assert (extract_dict_from_response(emulated_response_from_openai) == valid_json_response)