feat(api-client): rewrite api-client v1 using abstract client
This commit is contained in:
parent
98aaa4214a
commit
6ab407a23a
4 changed files with 173 additions and 386 deletions
21
api-client/tests/v1_test.py
Normal file
21
api-client/tests/v1_test.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
import pytest
|
||||
|
||||
from libretime_api_client.v1 import ApiClient
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"base_url",
|
||||
[
|
||||
("http://localhost:8080"),
|
||||
("http://localhost:8080/base"),
|
||||
],
|
||||
)
|
||||
def test_api_client(requests_mock, base_url):
|
||||
api_client = ApiClient(base_url=base_url, api_key="test-key")
|
||||
|
||||
requests_mock.get(
|
||||
f"{base_url}/api/version",
|
||||
json={"api_version": "1.0.0"},
|
||||
)
|
||||
|
||||
assert api_client.version() == "1.0.0"
|
Loading…
Add table
Add a link
Reference in a new issue