-
Notifications
You must be signed in to change notification settings - Fork 1
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 #22 from COSCUP/feat/add_test
Add test
- Loading branch information
Showing
11 changed files
with
76,879 additions
and
250 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 |
---|---|---|
|
@@ -8,3 +8,4 @@ local_qdrant/ | |
__pycache__/ | ||
vectorDB/qdrant_storage/ | ||
.python-version | ||
.pytest_cache/ |
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
Large diffs are not rendered by default.
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
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,4 @@ | ||
[pytest] | ||
addopts = --asyncio-mode=auto | ||
markers = | ||
vcr: Use vcrpy to record and replay HTTP interactions |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# serializer version: 1 | ||
# name: test_askAPI | ||
dict({ | ||
'result': ''' | ||
志工平台是 COSCUP(開放源碼用戶大會)的管理和組織志工的工具。它可以用於申請各式各樣的志工福利,以及記錄自己的志工經歷。在加入 COSCUP 志工過程中,所使用的平台是 COSCUP 為管理志工所開發的[志工服務平台](https://volunteer.coscup.org/)。 | ||
|
||
2022 年志工服務平台主要集中在解決志工登錄自動化和其他繁瑣的手工事務。透過「流程改善」,整理出規則的流程後,可以協助轉移到志工平台上完成。可能需要志工協助的部分包括社群議程軌等。 | ||
|
||
如何貢獻專案可以參考「[志工平台文件](https://volunteer.coscup.org/docs/)」。在進行以下操作前,請先準備好所需內容,以便在設定流程或之後行政組詢問時會用到。 | ||
Source: | ||
https://github.com/COSCUP/COSCUP-Volunteer/blob/main/docs_dev/docs/announcement/pycontw_2023_sprints.zh-TW.md | ||
https://github.com/COSCUP/COSCUP-Volunteer/blob/main/docs_dev/docs/about_coscup/team_leader_handbook.zh-TW.md | ||
https://github.com/COSCUP/COSCUP-Volunteer/blob/main/docs_dev/docs/about_coscup/team_member_handbook.zh-TW.md | ||
|
||
''', | ||
}) | ||
# --- | ||
# name: test_askAPI_empty_query | ||
dict({ | ||
'message': 'empty query is not allowed', | ||
}) | ||
# --- | ||
# name: test_chatbot | ||
dict({ | ||
'response_type': 'in_channel', | ||
'text': ''' | ||
Question: 志工平台是什麼? | ||
|
||
Answer: | ||
志工平台是 COSCUP(開放源碼用戶大會)的管理和組織志工的工具。它可以用於申請各式各樣的志工福利,以及記錄自己的志工經歷。在加入 COSCUP 志工過程中,所使用的平台是 COSCUP 為管理志工所開發的[志工服務平台](https://volunteer.coscup.org/)。 | ||
|
||
2022 年志工服務平台主要集中在解決志工登錄自動化和其他繁瑣的手工事務。透過「流程改善」,整理出規則的流程後,可以協助轉移到志工平台上完成。可能需要志工協助的部分包括社群議程軌等。 | ||
|
||
如何貢獻專案可以參考「[志工平台文件](https://volunteer.coscup.org/docs/)」。在進行以下操作前,請先準備好所需內容,以便在設定流程或之後行政組詢問時會用到。 | ||
Source: | ||
https://github.com/COSCUP/COSCUP-Volunteer/blob/main/docs_dev/docs/announcement/pycontw_2023_sprints.zh-TW.md | ||
https://github.com/COSCUP/COSCUP-Volunteer/blob/main/docs_dev/docs/about_coscup/team_leader_handbook.zh-TW.md | ||
https://github.com/COSCUP/COSCUP-Volunteer/blob/main/docs_dev/docs/about_coscup/team_member_handbook.zh-TW.md | ||
|
||
''', | ||
}) | ||
# --- | ||
# name: test_health_check | ||
dict({ | ||
'Status': 'OK', | ||
}) | ||
# --- | ||
# name: test_health_check_alternative | ||
dict({ | ||
'Status': 'OK', | ||
}) | ||
# --- |
Large diffs are not rendered by default.
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,152 @@ | ||
interactions: | ||
- request: | ||
body: '{"query": ""}' | ||
headers: | ||
accept: | ||
- '*/*' | ||
accept-encoding: | ||
- gzip, deflate | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '13' | ||
content-type: | ||
- application/json | ||
host: | ||
- test | ||
user-agent: | ||
- python-httpx/0.27.0 | ||
method: POST | ||
uri: http://test/api/v1/ask | ||
response: | ||
body: | ||
string: '{"message":"empty query is not allowed"}' | ||
headers: | ||
content-length: | ||
- '40' | ||
content-type: | ||
- application/json | ||
status: | ||
code: 422 | ||
message: Unprocessable Entity | ||
- request: | ||
body: '{"query": ""}' | ||
headers: | ||
accept: | ||
- '*/*' | ||
accept-encoding: | ||
- gzip, deflate | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '13' | ||
content-type: | ||
- application/json | ||
host: | ||
- test | ||
user-agent: | ||
- python-httpx/0.27.0 | ||
method: POST | ||
uri: http://test/api/v1/ask | ||
response: | ||
body: | ||
string: '{"message":"empty query is not allowed"}' | ||
headers: | ||
content-length: | ||
- '40' | ||
content-type: | ||
- application/json | ||
status: | ||
code: 422 | ||
message: Unprocessable Entity | ||
- request: | ||
body: '{"query": ""}' | ||
headers: | ||
accept: | ||
- '*/*' | ||
accept-encoding: | ||
- gzip, deflate | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '13' | ||
content-type: | ||
- application/json | ||
host: | ||
- test | ||
user-agent: | ||
- python-httpx/0.27.0 | ||
method: POST | ||
uri: http://test/api/v1/ask | ||
response: | ||
body: | ||
string: '{"message":"empty query is not allowed"}' | ||
headers: | ||
content-length: | ||
- '40' | ||
content-type: | ||
- application/json | ||
status: | ||
code: 422 | ||
message: Unprocessable Entity | ||
- request: | ||
body: '{"query": ""}' | ||
headers: | ||
accept: | ||
- '*/*' | ||
accept-encoding: | ||
- gzip, deflate | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '13' | ||
content-type: | ||
- application/json | ||
host: | ||
- test | ||
user-agent: | ||
- python-httpx/0.27.0 | ||
method: POST | ||
uri: http://test/api/v1/ask | ||
response: | ||
body: | ||
string: '{"message":"empty query is not allowed"}' | ||
headers: | ||
content-length: | ||
- '40' | ||
content-type: | ||
- application/json | ||
status: | ||
code: 422 | ||
message: Unprocessable Entity | ||
- request: | ||
body: '{"query": ""}' | ||
headers: | ||
accept: | ||
- '*/*' | ||
accept-encoding: | ||
- gzip, deflate | ||
connection: | ||
- keep-alive | ||
content-length: | ||
- '13' | ||
content-type: | ||
- application/json | ||
host: | ||
- test | ||
user-agent: | ||
- python-httpx/0.27.0 | ||
method: POST | ||
uri: http://test/api/v1/ask | ||
response: | ||
body: | ||
string: '{"message":"empty query is not allowed"}' | ||
headers: | ||
content-length: | ||
- '40' | ||
content-type: | ||
- application/json | ||
status: | ||
code: 422 | ||
message: Unprocessable Entity | ||
version: 1 |
Oops, something went wrong.