mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-07 13:52:42 +08:00
24 lines
967 B
Python
24 lines
967 B
Python
from unittest import TestCase
|
|
|
|
|
|
class PluginHelperTest(TestCase):
|
|
|
|
def test_sanitize_repo_url_for_statistic_keeps_remote_url(self):
|
|
try:
|
|
from app.helper.plugin import PluginHelper
|
|
except ModuleNotFoundError as exc:
|
|
self.skipTest(f"missing dependency: {exc}")
|
|
repo_url = "https://github.com/InfinityPacer/MoviePilot-Plugins"
|
|
self.assertEqual(repo_url, PluginHelper.sanitize_repo_url_for_statistic(repo_url))
|
|
|
|
def test_sanitize_repo_url_for_statistic_strips_local_path(self):
|
|
try:
|
|
from app.helper.plugin import PluginHelper
|
|
except ModuleNotFoundError as exc:
|
|
self.skipTest(f"missing dependency: {exc}")
|
|
repo_url = "local://TestPlugin?path=/Users/InfinityPacer/GitHub/MoviePilot/MoviePilot-Plugins&version=v2"
|
|
self.assertEqual(
|
|
"local://TestPlugin?version=v2",
|
|
PluginHelper.sanitize_repo_url_for_statistic(repo_url)
|
|
)
|