forked from jellyfin/jellyfin-apiclient-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix jellyfin#53: Handle trailing slashes in jellyfin_url
- Loading branch information
1 parent
4e90e3d
commit 4a83918
Showing
2 changed files
with
101 additions
and
3 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
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,13 @@ | ||
from jellyfin_apiclient_python.api import jellyfin_url | ||
from unittest.mock import Mock | ||
|
||
def test_jellyfin_url_handles_trailing_slash(): | ||
mock_client = Mock() | ||
mock_client.config.data = {'auth.server': 'https://example.com/'} | ||
handler = "Items/1234" | ||
url = jellyfin_url(mock_client, handler) | ||
assert url == "https://example.com/Items/1234" | ||
|
||
mock_client.config.data = {'auth.server': 'https://example.com'} | ||
url = jellyfin_url(mock_client, handler) | ||
assert url == "https://example.com/Items/1234" |