-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix basic functionalities, add basic unit test, update build info
- Loading branch information
1 parent
24d5efb
commit b35d790
Showing
5 changed files
with
139 additions
and
51 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"python.testing.unittestArgs": [ | ||
"-v", | ||
"-s", | ||
"./tests", | ||
"-p", | ||
"test_*.py" | ||
], | ||
"python.testing.pytestEnabled": false, | ||
"python.testing.unittestEnabled": true | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
import unittest | ||
|
||
from gemini import GeminiClient | ||
|
||
|
||
class TestGenerateContent(unittest.IsolatedAsyncioTestCase): | ||
def setUp(self): | ||
self.geminiclient = GeminiClient( | ||
os.getenv("SECURE_1PSID") or "test_1psid", | ||
os.getenv("SECURE_1PSIDTS") or "test_ipsidts", | ||
) | ||
|
||
@unittest.skipIf( | ||
not (os.getenv("SECURE_1PSID") and os.getenv("SECURE_1PSIDTS")), | ||
"Skipping test_success...", | ||
) | ||
async def test_success(self): | ||
await self.geminiclient.init() | ||
self.assertTrue(self.geminiclient.running) | ||
|
||
response = await self.geminiclient.generate_content("Hello World!") | ||
self.assertTrue(response.text) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |