-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_client.py
More file actions
34 lines (25 loc) · 1.04 KB
/
test_client.py
File metadata and controls
34 lines (25 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import requests_mock
from acrclient import Client
from acrclient.client import _Auth
def test_client():
client = Client(_Auth("bearer-token"))
assert isinstance(client, Client)
assert client.base_url == "https://eu-api-v2.acrcloud.com"
def test_client_get():
client = Client(_Auth("bearer-token"))
with requests_mock.Mocker() as mock:
mock.get("https://eu-api-v2.acrcloud.com/foo", json={})
client.get("/foo")
def test_client_get_bm_cs_projects_results():
client = Client(_Auth("bearer-token"))
with requests_mock.Mocker() as mock:
mock.get(
f"{client.base_url}/api/bm-cs-projects/project-id/streams/stream-id/results",
json={"data": {}},
)
client.get_bm_cs_projects_results("project-id", "stream-id")
def test_client_get_external_metadata_tracks():
client = Client(_Auth("bearer-token"))
with requests_mock.Mocker() as mock:
mock.get(f"{client.base_url}/api/external-metadata/tracks", json={"data": [{}]})
client.get_external_metadata_tracks()