-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #951 from sundermann/browser-dialog
Use file browser dialog for local path
- Loading branch information
Showing
2 changed files
with
43 additions
and
4 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 |
---|---|---|
|
@@ -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,24 @@ def test_values(item, keys, expected): | |
) | ||
def test_convert_to_local(utctime, timezone, expected): | ||
assert convert_to_local(utctime, timezone=zoneinfo.ZoneInfo(timezone)) == expected | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"url,expected", | ||
[ | ||
("smb://user:[email protected]/media", "smb://server.test/media"), | ||
("smb://server.test/media", "smb://server.test/media"), | ||
("smb://user:[email protected]/media", "smb://192.0.2.1/media"), | ||
("smb://[email protected]/media", "smb://192.0.2.1/media"), | ||
("nfs://server.test/media", "nfs://server.test/media"), | ||
("sftp://user:[email protected]/media", "sftp://server.test/media"), | ||
("file://media/movies", "file://media/movies"), | ||
("/media/movies", "/media/movies"), | ||
("http://user:[email protected]/media", "http://server.test/media"), | ||
("https://user:[email protected]/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 |