Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use file browser dialog for local path #951

Merged
merged 3 commits into from
Dec 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests for strip_credentials
  • Loading branch information
sundermann committed Dec 16, 2024
commit cfc532377ea86c270878f915bb79013ff698d37f
22 changes: 21 additions & 1 deletion tests/test_helper_utils.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@

import pytest

from jellyfin_kodi.helper.utils import values, convert_to_local
from jellyfin_kodi.helper.utils import values, convert_to_local, strip_credentials

item1 = {"foo": 123, "bar": 456, "baz": 789}

@@ -77,3 +77,23 @@ def test_values(item, keys, expected):
)
def test_convert_to_local(utctime, timezone, expected):
assert convert_to_local(utctime, timezone=zoneinfo.ZoneInfo(timezone)) == expected

oddstr13 marked this conversation as resolved.
Show resolved Hide resolved
@pytest.mark.parametrize(
"url,expected",
[
("smb://user:pass@server.test/media", "smb://server.test/media"),
("smb://server.test/media", "smb://server.test/media"),
("smb://user:pass@192.0.2.1/media", "smb://192.0.2.1/media"),
("smb://user@192.0.2.1/media", "smb://192.0.2.1/media"),
("nfs://server.test/media", "nfs://server.test/media"),
("sftp://user:pass@server.test/media", "sftp://server.test/media"),
("file://media/movies", "file://media/movies"),
("/media/movies", "/media/movies"),
("http://user:pass@server.test/media", "http://server.test/media"),
("https://user:pass@server.test/media", "https://server.test/media"),
("http://server.test/media", "http://server.test/media"),
("https://server.test/media", "https://server.test/media"),
],
)
def test_strip_credentials(url, expected):
assert strip_credentials(url) == expected