From 0df6ecf39407114541b904c187771db3ef390e60 Mon Sep 17 00:00:00 2001 From: killua <1223086337@qq.com> Date: Thu, 16 May 2024 21:18:18 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=E4=BA=86=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=9A=84=E9=85=8D=E7=BD=AE=E5=8F=82=E6=95=B0=20update?= =?UTF-8?q?:=20=E6=9B=B4=E6=96=B0=E4=BA=86=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=B8=AD=E7=9A=84=E9=BB=98=E8=AE=A4ip=E4=B8=8E?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/development.py | 4 ++-- tests/integration_test/backend_test.py | 1 - tests/unit_test/character_test.py | 2 +- tests/unit_test/chat_test.py | 8 ++++---- tests/unit_test/user_test.py | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/config/development.py b/config/development.py index 01c9dc3..17c3a39 100644 --- a/config/development.py +++ b/config/development.py @@ -1,10 +1,10 @@ class DevelopmentConfig: - SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://admin02:LabA100102@127.0.0.1/takway?charset=utf8mb4" #mysql数据库连接配置 + SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://takway:takway123456@127.0.0.1/takway?charset=utf8mb4" #mysql数据库连接配置 REDIS_URL = "redis://:takway@127.0.0.1:6379/0" #redis数据库连接配置 LOG_LEVEL = "DEBUG" #日志级别 class UVICORN: HOST = "0.0.0.0" #uvicorn放行ip,0.0.0.0代表所有ip - PORT = 7878 #uvicorn运行端口 + PORT = 8001 #uvicorn运行端口 WORKERS = 12 #uvicorn进程数(通常与cpu核数相同) class XF_ASR: APP_ID = "your_app_id" #讯飞语音识别APP_ID diff --git a/tests/integration_test/backend_test.py b/tests/integration_test/backend_test.py index d33eefc..773526f 100644 --- a/tests/integration_test/backend_test.py +++ b/tests/integration_test/backend_test.py @@ -1,7 +1,6 @@ from tests.unit_test.user_test import user_test from tests.unit_test.character_test import character_test from tests.unit_test.chat_test import chat_test -import asyncio if __name__ == '__main__': user_test() diff --git a/tests/unit_test/character_test.py b/tests/unit_test/character_test.py index 638442e..9545412 100644 --- a/tests/unit_test/character_test.py +++ b/tests/unit_test/character_test.py @@ -2,7 +2,7 @@ import requests import json class CharacterServiceTest: - def __init__(self,socket="http://114.214.236.207:7878"): + def __init__(self,socket="http://127.0.0.1:8001"): self.socket = socket def test_character_create(self): diff --git a/tests/unit_test/chat_test.py b/tests/unit_test/chat_test.py index 030a92d..409c894 100644 --- a/tests/unit_test/chat_test.py +++ b/tests/unit_test/chat_test.py @@ -10,7 +10,7 @@ import websockets class ChatServiceTest: - def __init__(self,socket="http://114.214.236.207:7878"): + def __init__(self,socket="http://127.0.0.1:8001"): self.socket = socket @@ -149,7 +149,7 @@ class ChatServiceTest: await websocket.send(message) - async with websockets.connect(f'ws://114.214.236.207:7878/chat/streaming/temporary') as websocket: + async with websockets.connect(f'ws://127.0.0.1:8001/chat/streaming/temporary') as websocket: chunks = read_wav_file_in_chunks(2048) # 读取PCM文件并生成数据块 for chunk in chunks: await send_audio_chunk(websocket, chunk) @@ -205,7 +205,7 @@ class ChatServiceTest: message = json.dumps(data) await websocket.send(message) - async with websockets.connect(f'ws://114.214.236.207:7878/chat/streaming/lasting') as websocket: + async with websockets.connect(f'ws://127.0.0.1:8001/chat/streaming/lasting') as websocket: #发送第一次 chunks = read_wav_file_in_chunks(2048) for chunk in chunks: @@ -255,7 +255,7 @@ class ChatServiceTest: current_dir = os.path.dirname(current_file_path) tests_dir = os.path.dirname(current_dir) file_path = os.path.join(tests_dir, 'assets', 'voice_call.wav') - url = f"ws://114.214.236.207:7878/chat/voice_call" + url = f"ws://127.0.0.1:8001/chat/voice_call" #发送格式 ws_data = { "audio" : "", diff --git a/tests/unit_test/user_test.py b/tests/unit_test/user_test.py index 73f8f25..8e67a09 100644 --- a/tests/unit_test/user_test.py +++ b/tests/unit_test/user_test.py @@ -4,7 +4,7 @@ import uuid class UserServiceTest: - def __init__(self,socket="http://114.214.236.207:7878"): + def __init__(self,socket="http://127.0.0.1:8001"): self.socket = socket def test_user_create(self):