diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..1ceab94 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = -p no:warnings diff --git a/tests/test_bing.py b/tests/test_bing.py index c33b482..b30337d 100644 --- a/tests/test_bing.py +++ b/tests/test_bing.py @@ -21,10 +21,13 @@ def generate_response() -> str: client = Client(provider=Bing) - response = client.chat.completions.create( - model="gpt-4.0-turbo", - messages=[{"role": "user", "content": "Say hi, with your response starting with START and ending with END"}], - ) + try: + response = client.chat.completions.create( + model="gpt-4.0-turbo", + messages=[{"role": "user", "content": "Say hi, with your response starting with START and ending with END"}], + ) + except: + print("ERROR: Could not create a prompt!") return response.choices[0].message.content @@ -32,4 +35,10 @@ def generate_response() -> str: class TestOutput: def test_output(self): response = generate_response() + + if (len(response) > 0): + print("✅ Bing is up!") + else: + print("❌ Bing is down...") + assert response.startswith("START") and response.endswith("END")