From 5c6f39bf10120a6bdf4da88899ceea9dc26f3ca8 Mon Sep 17 00:00:00 2001 From: macnult <113482585+macnult@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:52:45 -0400 Subject: [PATCH 1/3] Revise gpt prompt --- tests/test_gpt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_gpt.py b/tests/test_gpt.py index c683423..fe8d2ef 100644 --- a/tests/test_gpt.py +++ b/tests/test_gpt.py @@ -14,7 +14,7 @@ def test_simple_gpt(): "gpt works". If anything else is outputted, we can assume an error has occured """ - surf_summary = "Please only output: 'gpt works!' " + surf_summary = "Please respond with the exact phrase 'gpt works'. Do not include any additional text or context." gpt_prompt = "This is for testing purposes" gpt_response = gpt.simple_gpt(surf_summary, gpt_prompt) - assert "gpt works" in gpt_response + assert "gpt works" in gpt_response, f"Expected 'gpt works', but got: {gpt_response}" From 940b2e61af5c269d29f6d9094a2f817caa9256a7 Mon Sep 17 00:00:00 2001 From: macnult <113482585+macnult@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:15:58 -0400 Subject: [PATCH 2/3] Change assertion for test_gpt --- tests/test_gpt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_gpt.py b/tests/test_gpt.py index fe8d2ef..018032d 100644 --- a/tests/test_gpt.py +++ b/tests/test_gpt.py @@ -17,4 +17,6 @@ def test_simple_gpt(): surf_summary = "Please respond with the exact phrase 'gpt works'. Do not include any additional text or context." gpt_prompt = "This is for testing purposes" gpt_response = gpt.simple_gpt(surf_summary, gpt_prompt) - assert "gpt works" in gpt_response, f"Expected 'gpt works', but got: {gpt_response}" + expected_response = "gpt works" + + assert gpt_response == expected_response, f"Expected '{expected_response}', but got: {gpt_response}" From 463cd47a6e82daf76f900c9617be7843be2d1344 Mon Sep 17 00:00:00 2001 From: macnult <113482585+macnult@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:20:15 -0400 Subject: [PATCH 3/3] Fix linting errors in test_gpt.py --- tests/test_gpt.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_gpt.py b/tests/test_gpt.py index 018032d..8c034e3 100644 --- a/tests/test_gpt.py +++ b/tests/test_gpt.py @@ -14,9 +14,16 @@ def test_simple_gpt(): "gpt works". If anything else is outputted, we can assume an error has occured """ - surf_summary = "Please respond with the exact phrase 'gpt works'. Do not include any additional text or context." + + surf_summary = ( + "Please respond with the exact phrase 'gpt works'. " + "Do not include any additional text or context." +) + gpt_prompt = "This is for testing purposes" gpt_response = gpt.simple_gpt(surf_summary, gpt_prompt) expected_response = "gpt works" - assert gpt_response == expected_response, f"Expected '{expected_response}', but got: {gpt_response}" + assert gpt_response == expected_response, ( + f"Expected '{expected_response}', but got: {gpt_response}" +)