Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve unit testing #128

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

logging.basicConfig(level=logging.DEBUG)

EMAIL = os.environ.get("EMAIL")
PASSWORD = os.environ.get("PASSWORD")
EMAIL = "[email protected]"
PASSWORD = "FOR_TEST_DO_NOT_LOGIN_a1"

chatbot: hugchat.ChatBot = None
my_conversation: hugchat.conversation = None
Expand Down Expand Up @@ -52,14 +52,14 @@ def test_chat_web_search(self):
"""
test chat module with web search
"""
res = str(chatbot.chat("What's the weather like in London today?", web_search=True))
res = str(chatbot.chat("What's the weather like in London today? Reply length limited within 20 words.", web_search=True))
assert res is not None

def test_generator(self):
"""
test generator module
"""
res = chatbot.chat("What's the weather like in London today?", web_search=True, _stream_yield_all=True)
res = chatbot.chat("Just reply me `test_ok`", _stream_yield_all=True)
for i in res:
print(i, flush=True)

Expand All @@ -69,5 +69,4 @@ def test_generator(self):
test = TestAPI()
test.test_login()
test.test_create_conversation()
test.test_chat_without_web_search()
test.test_chat_web_search()
test.test_generator()
Loading