Skip to content

Commit

Permalink
api は独立させる
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Oct 4, 2024
1 parent 2f94e01 commit 78f8b2f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 12 additions & 0 deletions tests/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import httpx

def disconnect_connection_api(url: str, channel_id: str, connection_id: str) -> httpx.Response:
headers = {
"Content-Type": "application/json",
"x-sora-target": "Sora_20151104.DisconnectConnection",
}
body = {
"channel_id": channel_id,
"connection_id": connection_id,
}
return httpx.post(url, headers=headers, json=body, follow_redirects=True)
14 changes: 1 addition & 13 deletions tests/test_sora_disconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,11 @@
import time
import uuid

import httpx
import pytest
from api import disconnect_connection_api
from client import SoraClient, SoraRole


def disconnect_connection_api(url: str, channel_id: str, connection_id: str) -> httpx.Response:
headers = {
"Content-Type": "application/json",
"x-sora-target": "Sora_20151104.DisconnectConnection",
}
body = {
"channel_id": channel_id,
"connection_id": connection_id,
}
return httpx.post(url, headers=headers, json=body, follow_redirects=True)


@pytest.mark.skipif(sys.platform != "linux", reason="linux でのみ実行する")
def test_websocket_signaling_only_disconnect_api(setup):
signaling_urls = setup.get("signaling_urls")
Expand Down

0 comments on commit 78f8b2f

Please sign in to comment.