Skip to content

Commit 616b652

Browse files
author
赵嘉琦
committed
feat:APIKEY
1 parent 7d79be9 commit 616b652

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ build-backend = "poetry.core.masonry.api"
8484
#
8585
# https://github.com/tophat/syrupy
8686
# --snapshot-warn-unused Prints a warning on unused snapshots rather than fail the test suite.
87-
addopts = "--strict-markers --strict-config --durations=5 --snapshot-warn-unused -svv"
87+
addopts = "--strict-markers --strict-config --durations=5 -svv"
8888
# Registering custom markers.
8989
# https://docs.pytest.org/en/7.1.x/example/markers.html#registering-markers
9090
markers = [
9191
"requires: mark tests as requiring a specific library",
9292
"scheduled: mark tests to run in scheduled testing",
93-
"compile: mark placeholder test used to compile integration tests without running them"
93+
"compile: mark placeholder test used to compile integration tests without running them",
94+
"integration: mark tests as integration tests"
9495
]
95-
asyncio_mode = "auto"
9696

9797

9898
# https://python-poetry.org/docs/repositories/

tests/integration_tests/test_tts.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
from zhipuai.api_resource.tts import TTSApi
44

55
# 请根据实际情况填写
6-
BASE_URL_LIST = "http://localhost:9203"
7-
BASE_URL_ADD = "http://localhost:9203"
8-
API_TOKEN = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX3R5cGUiOiJTRVJWSUNFIiwidXNlcl9pZCI6MywiYXBpX2tleSI6IjM0ZDhiM2ExNDQ2OTQ0MmY5MTJkNzg5MTJjZjZlMjU1IiwidXNlcl9rZXkiOiIyNzQyNjM0My1iYjI0LTQ4ZDktODVjNy01ODFmMjUwNzBiMzMiLCJjdXN0b21lcl9pZCI6IjEwMDAwMyIsInVzZXJuYW1lIjoiY3BjMTk4NiJ9.3MsaFjRAyArDp2WZsVbvKGPrVjkKvGB5EfBafprcFogbDeZv4s9VCQt4wUaR4FVon1tiL_pnqtMaI6qGGXs0Qg"
6+
BASE_URL_LIST = "https://dev.bigmodel.cn/stage-api/paas"
7+
BASE_URL_ADD = "https://dev.bigmodel.cn/stage-api/paas"
8+
API_KEY = "d91103df5c4a47bb808d4c84bcae9fcf.HCFkuDBhwKWLxliY"
99
AUDIO_FILE_PATH = r"C:\Users\zjq18\Downloads\北京今天的天气.wav"
1010

1111
@pytest.mark.integration
1212
def test_list_voices():
13-
tts_api = TTSApi(base_url=BASE_URL_LIST, api_key=API_TOKEN)
13+
tts_api = TTSApi(base_url=BASE_URL_LIST, api_key=API_KEY)
1414
resp = tts_api.list_voices()
1515
assert resp.code == 200
1616
assert resp.success
@@ -22,7 +22,7 @@ def test_list_voices():
2222
def test_add_voice():
2323
if not os.path.exists(AUDIO_FILE_PATH):
2424
pytest.skip("音频文件不存在,跳过上传测试")
25-
tts_api = TTSApi(base_url=BASE_URL_ADD, api_key=API_TOKEN)
25+
tts_api = TTSApi(base_url=BASE_URL_ADD, api_key=API_KEY)
2626
resp = tts_api.add_voice(
2727
voice_name="磁性嗓音123",
2828
voice_text="今天北京的天气怎么样?",

0 commit comments

Comments
 (0)