shlex for windows
This commit is contained in:
parent
ee862f83c9
commit
ce853ed669
2 changed files with 3 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import pytest
|
||||||
from ytdl_sub.cli.entrypoint import main
|
from ytdl_sub.cli.entrypoint import main
|
||||||
from ytdl_sub.subscriptions.subscription import Subscription
|
from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
from ytdl_sub.utils.file_handler import FileHandler
|
from ytdl_sub.utils.file_handler import FileHandler
|
||||||
|
from ytdl_sub.utils.system import IS_WINDOWS
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
@ -34,6 +35,6 @@ def timestamps_file_path():
|
||||||
|
|
||||||
|
|
||||||
def mock_run_from_cli(args: str) -> List[Subscription]:
|
def mock_run_from_cli(args: str) -> List[Subscription]:
|
||||||
args_list = ["ytdl-sub"] + shlex.split(args)
|
args_list = ["ytdl-sub"] + shlex.split(args, posix=not IS_WINDOWS)
|
||||||
with patch.object(sys, "argv", args_list):
|
with patch.object(sys, "argv", args_list):
|
||||||
return main()
|
return main()
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ class TestPlaylist:
|
||||||
subscription_name="music_video_playlist_test", preset_dict=playlist_preset_dict
|
subscription_name="music_video_playlist_test", preset_dict=playlist_preset_dict
|
||||||
) as subscription_path:
|
) as subscription_path:
|
||||||
args = "--dry-run " if dry_run else ""
|
args = "--dry-run " if dry_run else ""
|
||||||
args += f"sub {subscription_path}"
|
args += f"sub '{subscription_path}'"
|
||||||
subscriptions = mock_run_from_cli(args=args)
|
subscriptions = mock_run_from_cli(args=args)
|
||||||
|
|
||||||
assert len(subscriptions) == 1
|
assert len(subscriptions) == 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue