-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Fix global options not working after
sub
(#500)
* [BACKEND] Error if arg after positional arg * working * dry-run default * remove unused code
- Loading branch information
Showing
7 changed files
with
129 additions
and
51 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
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
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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import sys | ||
from unittest.mock import patch | ||
|
||
import pytest | ||
|
||
from ytdl_sub.cli.main import main | ||
from ytdl_sub.utils.exceptions import ValidationException | ||
|
||
|
||
def test_args_after_sub_work(): | ||
with patch.object( | ||
sys, | ||
"argv", | ||
["ytdl-sub", "-c", "examples/tv_show_config.yaml", "sub", "--log-level", "debug"], | ||
), patch("ytdl_sub.cli.main._download_subscriptions_from_yaml_files") as mock_sub: | ||
main() | ||
|
||
assert mock_sub.call_count == 1 | ||
assert mock_sub.call_args.kwargs["args"].config == "examples/tv_show_config.yaml" | ||
assert mock_sub.call_args.kwargs["args"].subscription_paths == ["subscriptions.yaml"] | ||
assert mock_sub.call_args.kwargs["args"].ytdl_sub_log_level == "debug" |