-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from Soulter/118-feature-add-unit-test
Improve unit testing
- Loading branch information
Showing
1 changed file
with
5 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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) | ||
|
||
|
@@ -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() |