Skip to content

Commit b8b88ae

Browse files
committed
print_test_cases
1 parent 59500ba commit b8b88ae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

open_ai_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ def parse_ai_response(self, response_str: str):
2727
# print('Response string was:', response_str)
2828
raise
2929

30+
def print_test_cases(self, test_case: dict):
31+
print('\n','-' * 5)
32+
print(f"Test case: {test_case.get('test_case_name', 'unnamed')}")
33+
print("Input:", json.dumps(test_case['input'], indent=2))
34+
print("Expected:", json.dumps(test_case['expected'], indent=2))
35+
print('-' * 5)
36+
3037
def generate_api_test_cases(
3138
self, method: str, api_path: str, request_sample: dict, response_sample: dict, max_cases_number: int,
3239
max_tokens: int = 1500, resp_err_code: str = None):

0 commit comments

Comments
 (0)