-
-
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.
- Loading branch information
1 parent
f7ce255
commit cfc5323
Showing
1 changed file
with
21 additions
and
1 deletion.
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
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 | ||
|
||
@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 |