* GoogleAuthUtils.GoogleGenaiClient.generate_content() 调用增加了timeout参数 默认为300秒 * 规范化VertexAI调用方式 --------- Merge request URL: https://g-ldyi2063.coding.net/p/dev/d/modalDeploy/git/merge/4827?initial=true Co-authored-by: shuohigh@gmail.com
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
import base64
|
|
import unittest
|
|
|
|
import httpx
|
|
from loguru import logger
|
|
|
|
|
|
class PydanticModelTestCase(unittest.TestCase):
|
|
|
|
def test_nakama_login(self):
|
|
nakama_endpoint = 'http://43.143.58.201:7350'
|
|
email = "ybj.yege@gmail.com"
|
|
password = "Bowong7777"
|
|
basic_auth_str = base64.b64encode(f"{email}:{password}".encode('utf8')).decode('utf8')
|
|
logger.info(basic_auth_str)
|
|
with httpx.Client() as client:
|
|
login_response = client.post(url=f"{nakama_endpoint}/v2/account/authenticate/email?create=false",
|
|
headers={
|
|
"Authorization": f"Basic {basic_auth_str}",
|
|
},
|
|
json={"email": "ybj.yege@gmail.com", "password": "Bowong7777"}
|
|
)
|
|
login_response.raise_for_status()
|
|
session_json = login_response.json()
|
|
logger.info(f"Login response: {session_json}")
|
|
self.assertEqual(True, True)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|