File: test_api.py

package info (click to toggle)
jellyfin-apiclient-python 1.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 276 kB
  • sloc: python: 1,690; sh: 5; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 519 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
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"