-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
92 additions
and
12 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 |
---|---|---|
|
@@ -51,3 +51,7 @@ __pycache__ | |
|
||
# vscode | ||
build | ||
|
||
# .env | ||
.env | ||
!.env.template |
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 @@ | ||
TEST_SIGNALING_URLS=wss://sora.example.com/signaling | ||
TEST_CHANNEL_ID_PREFIX=momo_ | ||
TEST_SECRET_KEY=secret | ||
TEST_API_URL=https://sora.example.com/api |
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,36 @@ | ||
import os | ||
|
||
import pytest | ||
from dotenv import load_dotenv | ||
|
||
|
||
@pytest.fixture | ||
def setup(): | ||
# 環境変数読み込み | ||
load_dotenv() | ||
|
||
# signaling_url 単体か複数かをランダムで決めてテストする | ||
if (test_signaling_urls := os.environ.get("TEST_SIGNALING_URLS")) is None: | ||
raise ValueError("TEST_SIGNALING_URLS is required.") | ||
|
||
# , で区切って ['wss://...', ...] に変換 | ||
test_signaling_urls = test_signaling_urls.split(",") | ||
|
||
if (test_channel_id_prefix := os.environ.get("TEST_CHANNEL_ID_PREFIX")) is None: | ||
raise ValueError("TEST_CHANNEL_ID_PREFIX is required.") | ||
|
||
if (test_secret_key := os.environ.get("TEST_SECRET_KEY")) is None: | ||
raise ValueError("TEST_SECRET_KEY is required.") | ||
|
||
# if (test_api_url := os.environ.get("TEST_API_URL")) is None: | ||
# raise ValueError("TEST_API_URL is required.") | ||
|
||
return { | ||
"signaling_urls": test_signaling_urls, | ||
"channel_id_prefix": test_channel_id_prefix, | ||
# "secret": test_secret_key, | ||
# "api_url": test_api_url, | ||
"metadata": {"access_token": test_secret_key}, | ||
# openh264_path は str | None でよい | ||
# "openh264_path": os.environ.get("OPENH264_PATH"), | ||
} |
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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.