fix(api-client): fix base_url joining for client v2 (#1998)
This commit is contained in:
parent
d9725003c5
commit
6f0ab7d8f2
3 changed files with 34 additions and 5 deletions
19
api-client/tests/client_test.py
Normal file
19
api-client/tests/client_test.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import pytest
|
||||
|
||||
from libretime_api_client._client import Session
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"base_url, url, expected",
|
||||
[
|
||||
(None, "/path", "/path"),
|
||||
(None, "http://host/path", "http://host/path"),
|
||||
("http://host", "path", "http://host/path"),
|
||||
("http://host", "/path", "http://host/path"),
|
||||
("http://host/", "path", "http://host/path"),
|
||||
("http://host/", "/path", "http://host/path"),
|
||||
],
|
||||
)
|
||||
def test_session_create_url(base_url, url, expected):
|
||||
session = Session(base_url=base_url)
|
||||
assert session.create_url(url) == expected
|
Loading…
Add table
Add a link
Reference in a new issue