From 33e39d2236f99f36111217b6e4f5d24164ec0aab Mon Sep 17 00:00:00 2001 From: Pratham Dubey <134331217+prathamdby@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:38:54 +0530 Subject: [PATCH] tests: Raise an exception if the response comes back empty --- tests/test_bing.py | 1 + tests/test_freechatgpt.py | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/test_bing.py b/tests/test_bing.py index 38d488c..9ae1c6c 100644 --- a/tests/test_bing.py +++ b/tests/test_bing.py @@ -31,6 +31,7 @@ def generate_response() -> str: ) except: print("ERROR: Could not create a prompt!") + raise Exception("ERROR: Could not create a prompt!") return response.choices[0].message.content diff --git a/tests/test_freechatgpt.py b/tests/test_freechatgpt.py index 685c90a..a294142 100644 --- a/tests/test_freechatgpt.py +++ b/tests/test_freechatgpt.py @@ -15,6 +15,7 @@ def generate_response() -> str: ) except: print("ERROR: Could not create a prompt!") + raise Exception("ERROR: Could not create a prompt!") return response.choices[0].message.content