Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Boundless Asura committed Jul 18, 2023
1 parent 90d940d commit 157417d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/unit_tests/llms/test_google_palm.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ def test_chat_completion(mock_palm):
top_p=palm_instance.top_p,
max_output_tokens=int(max_tokens)
)


def test_verify_access_key():
model = 'models/text-bison-001'
api_key = 'test_key'
palm_instance = GooglePalm(api_key, model=model)
result = palm_instance.verify_access_key()
assert result is False
9 changes: 9 additions & 0 deletions tests/unit_tests/llms/test_open_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest.mock import MagicMock, patch
from superagi.llms.openai import OpenAi


@patch('superagi.llms.openai.openai')
def test_chat_completion(mock_openai):
# Arrange
Expand Down Expand Up @@ -30,3 +31,11 @@ def test_chat_completion(mock_openai):
frequency_penalty=openai_instance.frequency_penalty,
presence_penalty=openai_instance.presence_penalty
)


def test_verify_access_key():
model = 'gpt-4'
api_key = 'test_key'
openai_instance = OpenAi(api_key, model=model)
result = openai_instance.verify_access_key()
assert result is False

0 comments on commit 157417d

Please sign in to comment.