2021-03-11 20:21:05 +13:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# coding=utf-8
|
|
|
|
|
2021-06-24 18:14:05 +12:00
|
|
|
import shutil
|
2021-03-11 20:21:05 +13:00
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from click.testing import CliRunner
|
|
|
|
|
2021-04-12 19:58:32 +12:00
|
|
|
from bdfr.__main__ import cli
|
2021-03-11 20:21:05 +13:00
|
|
|
|
2021-07-02 16:00:48 +12:00
|
|
|
does_test_config_exist = Path('../test_config.cfg').exists()
|
2021-03-11 20:21:05 +13:00
|
|
|
|
2021-04-23 23:05:21 +12:00
|
|
|
|
2021-06-24 18:38:34 +12:00
|
|
|
def copy_test_config(run_path: Path):
|
2021-07-02 16:00:48 +12:00
|
|
|
shutil.copy(Path('../test_config.cfg'), Path(run_path, '../test_config.cfg'))
|
2021-06-24 18:14:05 +12:00
|
|
|
|
|
|
|
|
2021-06-24 18:38:34 +12:00
|
|
|
def create_basic_args_for_download_runner(test_args: list[str], run_path: Path):
|
|
|
|
copy_test_config(run_path)
|
2021-04-27 14:29:37 +12:00
|
|
|
out = [
|
2021-06-24 18:38:34 +12:00
|
|
|
'download', str(run_path),
|
2021-04-27 14:29:37 +12:00
|
|
|
'-v',
|
2021-07-02 16:00:48 +12:00
|
|
|
'--config', str(Path(run_path, '../test_config.cfg')),
|
2021-06-24 18:38:34 +12:00
|
|
|
'--log', str(Path(run_path, 'test_log.txt')),
|
2021-04-27 14:29:37 +12:00
|
|
|
] + test_args
|
|
|
|
return out
|
|
|
|
|
|
|
|
|
2021-03-11 20:21:05 +13:00
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-11 20:21:05 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
|
|
|
['-s', 'Mindustry', '-L', 1],
|
|
|
|
['-s', 'r/Mindustry', '-L', 1],
|
|
|
|
['-s', 'r/mindustry', '-L', 1],
|
|
|
|
['-s', 'mindustry', '-L', 1],
|
|
|
|
['-s', 'https://www.reddit.com/r/TrollXChromosomes/', '-L', 1],
|
|
|
|
['-s', 'r/TrollXChromosomes/', '-L', 1],
|
|
|
|
['-s', 'TrollXChromosomes/', '-L', 1],
|
|
|
|
['-s', 'trollxchromosomes', '-L', 1],
|
2021-03-15 17:00:21 +13:00
|
|
|
['-s', 'trollxchromosomes,mindustry,python', '-L', 1],
|
|
|
|
['-s', 'trollxchromosomes, mindustry, python', '-L', 1],
|
2021-03-12 01:18:54 +13:00
|
|
|
['-s', 'trollxchromosomes', '-L', 1, '--time', 'day'],
|
|
|
|
['-s', 'trollxchromosomes', '-L', 1, '--sort', 'new'],
|
|
|
|
['-s', 'trollxchromosomes', '-L', 1, '--time', 'day', '--sort', 'new'],
|
|
|
|
['-s', 'trollxchromosomes', '-L', 1, '--search', 'women'],
|
2021-09-03 18:39:00 +12:00
|
|
|
['-s', 'hentai', '-L', 10, '--search', 'red'],
|
2021-03-12 01:18:54 +13:00
|
|
|
['-s', 'trollxchromosomes', '-L', 1, '--time', 'day', '--search', 'women'],
|
|
|
|
['-s', 'trollxchromosomes', '-L', 1, '--sort', 'new', '--search', 'women'],
|
|
|
|
['-s', 'trollxchromosomes', '-L', 1, '--time', 'day', '--sort', 'new', '--search', 'women'],
|
2021-03-11 20:21:05 +13:00
|
|
|
))
|
|
|
|
def test_cli_download_subreddits(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-07-02 16:17:13 +12:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
assert 'Added submissions from subreddit ' in result.output
|
2021-09-03 18:39:00 +12:00
|
|
|
assert 'Downloaded submission' in result.output
|
2021-07-02 16:17:13 +12:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
|
|
|
@pytest.mark.authenticated
|
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
|
|
|
@pytest.mark.parametrize('test_args', (
|
|
|
|
['--subreddit', 'friends', '-L', 10, '--authenticate'],
|
|
|
|
))
|
|
|
|
def test_cli_download_user_specific_subreddits(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-11 20:21:05 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
assert 'Added submissions from subreddit ' in result.output
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-11 20:21:05 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
|
|
|
['-l', 'm2601g'],
|
|
|
|
['-l', 'https://www.reddit.com/r/TrollXChromosomes/comments/m2601g/its_a_step_in_the_right_direction/'],
|
2021-03-13 14:13:36 +13:00
|
|
|
['-l', 'm3hxzd'], # Really long title used to overflow filename limit
|
2021-03-13 16:22:22 +13:00
|
|
|
['-l', 'm3kua3'], # Has a deleted user
|
2021-03-15 17:00:21 +13:00
|
|
|
['-l', 'm5bqkf'], # Resource leading to a 404
|
2021-03-11 20:21:05 +13:00
|
|
|
))
|
|
|
|
def test_cli_download_links(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-11 20:21:05 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-11 20:21:05 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
|
|
|
['--user', 'helen_darten', '-m', 'cuteanimalpics', '-L', 10],
|
2021-03-12 01:18:54 +13:00
|
|
|
['--user', 'helen_darten', '-m', 'cuteanimalpics', '-L', 10, '--sort', 'rising'],
|
|
|
|
['--user', 'helen_darten', '-m', 'cuteanimalpics', '-L', 10, '--time', 'week'],
|
|
|
|
['--user', 'helen_darten', '-m', 'cuteanimalpics', '-L', 10, '--time', 'week', '--sort', 'rising'],
|
2021-03-11 20:21:05 +13:00
|
|
|
))
|
|
|
|
def test_cli_download_multireddit(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-11 20:21:05 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
assert 'Added submissions from multireddit ' in result.output
|
|
|
|
|
|
|
|
|
2021-03-12 01:18:54 +13:00
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-12 01:18:54 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
2021-03-12 16:24:25 +13:00
|
|
|
['--user', 'helen_darten', '-m', 'xxyyzzqwerty', '-L', 10],
|
2021-03-12 01:18:54 +13:00
|
|
|
))
|
|
|
|
def test_cli_download_multireddit_nonexistent(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-12 01:18:54 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
2021-03-12 16:24:25 +13:00
|
|
|
assert 'Failed to get submissions for multireddit' in result.output
|
|
|
|
assert 'received 404 HTTP response' in result.output
|
2021-03-12 01:18:54 +13:00
|
|
|
|
|
|
|
|
2021-03-11 20:21:05 +13:00
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
|
|
|
@pytest.mark.authenticated
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-11 20:21:05 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
2021-05-27 17:22:58 +12:00
|
|
|
['--user', 'djnish', '--submitted', '--user', 'FriesWithThat', '-L', 10],
|
2021-03-12 01:18:54 +13:00
|
|
|
['--user', 'me', '--upvoted', '--authenticate', '-L', 10],
|
|
|
|
['--user', 'me', '--saved', '--authenticate', '-L', 10],
|
|
|
|
['--user', 'me', '--submitted', '--authenticate', '-L', 10],
|
|
|
|
['--user', 'djnish', '--submitted', '-L', 10],
|
|
|
|
['--user', 'djnish', '--submitted', '-L', 10, '--time', 'month'],
|
|
|
|
['--user', 'djnish', '--submitted', '-L', 10, '--sort', 'controversial'],
|
2021-03-11 20:21:05 +13:00
|
|
|
))
|
|
|
|
def test_cli_download_user_data_good(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-11 20:21:05 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
assert 'Downloaded submission ' in result.output
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
|
|
|
@pytest.mark.authenticated
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-11 20:21:05 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
2021-03-20 17:05:07 +13:00
|
|
|
['--user', 'me', '-L', 10, '--folder-scheme', ''],
|
2021-03-11 20:21:05 +13:00
|
|
|
))
|
|
|
|
def test_cli_download_user_data_bad_me_unauthenticated(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-11 20:21:05 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
assert 'To use "me" as a user, an authenticated Reddit instance must be used' in result.output
|
2021-03-12 16:24:25 +13:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-12 16:24:25 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
2021-06-24 18:37:25 +12:00
|
|
|
['--subreddit', 'python', '-L', 1, '--search-existing'],
|
2021-03-12 16:24:25 +13:00
|
|
|
))
|
|
|
|
def test_cli_download_search_existing(test_args: list[str], tmp_path: Path):
|
|
|
|
Path(tmp_path, 'test.txt').touch()
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-12 16:24:25 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
assert 'Calculating hashes for' in result.output
|
2021-03-13 16:22:22 +13:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-13 16:22:22 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
2021-05-21 09:14:35 +12:00
|
|
|
['--subreddit', 'tumblr', '-L', '25', '--skip', 'png', '--skip', 'jpg'],
|
|
|
|
['--subreddit', 'MaliciousCompliance', '-L', '25', '--skip', 'txt'],
|
2021-06-23 16:30:39 +12:00
|
|
|
['--subreddit', 'tumblr', '-L', '10', '--skip-domain', 'i.redd.it'],
|
|
|
|
))
|
2021-06-24 18:14:21 +12:00
|
|
|
def test_cli_download_download_filters(test_args: list[str], tmp_path: Path):
|
2021-06-23 16:30:39 +12:00
|
|
|
runner = CliRunner()
|
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
2021-06-24 18:14:21 +12:00
|
|
|
assert any((string in result.output for string in ('Download filter removed ', 'filtered due to URL')))
|
2021-06-23 16:30:39 +12:00
|
|
|
|
|
|
|
|
2021-03-13 16:22:22 +13:00
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-03-13 18:11:59 +13:00
|
|
|
@pytest.mark.slow
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-13 16:22:22 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
2021-03-13 18:11:59 +13:00
|
|
|
['--subreddit', 'all', '-L', '100', '--sort', 'new'],
|
2021-03-13 16:22:22 +13:00
|
|
|
))
|
|
|
|
def test_cli_download_long(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-13 16:22:22 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
2021-03-14 14:11:37 +13:00
|
|
|
|
|
|
|
|
2021-03-14 15:03:43 +13:00
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
|
|
|
@pytest.mark.slow
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-14 15:03:43 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
|
|
|
['--user', 'sdclhgsolgjeroij', '--submitted', '-L', 10],
|
|
|
|
['--user', 'me', '--upvoted', '-L', 10],
|
|
|
|
['--user', 'sdclhgsolgjeroij', '--upvoted', '-L', 10],
|
2021-04-28 14:43:11 +12:00
|
|
|
['--subreddit', 'submitters', '-L', 10], # Private subreddit
|
|
|
|
['--subreddit', 'donaldtrump', '-L', 10], # Banned subreddit
|
2021-05-27 17:22:58 +12:00
|
|
|
['--user', 'djnish', '--user', 'helen_darten', '-m', 'cuteanimalpics', '-L', 10],
|
2021-07-02 16:29:39 +12:00
|
|
|
['--subreddit', 'friends', '-L', 10],
|
2021-03-14 15:03:43 +13:00
|
|
|
))
|
|
|
|
def test_cli_download_soft_fail(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-14 15:03:43 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
2021-05-27 17:22:58 +12:00
|
|
|
assert 'Downloaded' not in result.output
|
2021-03-14 15:03:43 +13:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
|
|
|
@pytest.mark.slow
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-14 15:03:43 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
|
|
|
['--time', 'random'],
|
|
|
|
['--sort', 'random'],
|
|
|
|
))
|
|
|
|
def test_cli_download_hard_fail(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-14 15:03:43 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code != 0
|
2021-03-14 23:38:03 +13:00
|
|
|
|
|
|
|
|
|
|
|
def test_cli_download_use_default_config(tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
|
|
|
test_args = ['download', '-vv', str(tmp_path)]
|
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
2021-03-27 20:58:43 +13:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-27 20:58:43 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
2021-05-21 09:14:35 +12:00
|
|
|
['-l', 'm2601g', '--exclude-id', 'm2601g'],
|
2021-03-27 20:58:43 +13:00
|
|
|
))
|
2021-04-05 23:32:39 +12:00
|
|
|
def test_cli_download_links_exclusion(test_args: list[str], tmp_path: Path):
|
2021-03-27 20:58:43 +13:00
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-27 20:58:43 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
assert 'in exclusion list' in result.output
|
|
|
|
assert 'Downloaded submission ' not in result.output
|
2021-03-30 20:20:05 +13:00
|
|
|
|
|
|
|
|
2021-04-17 21:56:43 +12:00
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-04-17 21:56:43 +12:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
|
|
|
['-l', 'm2601g', '--skip-subreddit', 'trollxchromosomes'],
|
|
|
|
['-s', 'trollxchromosomes', '--skip-subreddit', 'trollxchromosomes', '-L', '3'],
|
|
|
|
))
|
|
|
|
def test_cli_download_subreddit_exclusion(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-04-17 21:56:43 +12:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
assert 'in skip list' in result.output
|
|
|
|
assert 'Downloaded submission ' not in result.output
|
|
|
|
|
|
|
|
|
2021-03-30 20:20:05 +13:00
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
2021-04-17 23:42:24 +12:00
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
2021-03-30 20:20:05 +13:00
|
|
|
@pytest.mark.parametrize('test_args', (
|
|
|
|
['--file-scheme', '{TITLE}'],
|
|
|
|
['--file-scheme', '{TITLE}_test_{SUBREDDIT}'],
|
|
|
|
))
|
2021-06-06 22:47:56 +12:00
|
|
|
def test_cli_download_file_scheme_warning(test_args: list[str], tmp_path: Path):
|
2021-03-30 20:20:05 +13:00
|
|
|
runner = CliRunner()
|
2021-04-27 14:29:37 +12:00
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
2021-03-30 20:20:05 +13:00
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
2021-04-06 19:01:49 +12:00
|
|
|
assert 'Some files might not be downloaded due to name conflicts' in result.output
|
2021-06-06 22:29:09 +12:00
|
|
|
|
|
|
|
|
2021-06-06 22:47:56 +12:00
|
|
|
@pytest.mark.online
|
|
|
|
@pytest.mark.reddit
|
|
|
|
@pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')
|
|
|
|
@pytest.mark.parametrize('test_args', (
|
|
|
|
['-l', 'm2601g', '--disable-module', 'Direct'],
|
|
|
|
['-l', 'nnb9vs', '--disable-module', 'YoutubeDlFallback'],
|
|
|
|
['-l', 'nnb9vs', '--disable-module', 'youtubedlfallback'],
|
|
|
|
))
|
|
|
|
def test_cli_download_disable_modules(test_args: list[str], tmp_path: Path):
|
|
|
|
runner = CliRunner()
|
|
|
|
test_args = create_basic_args_for_download_runner(test_args, tmp_path)
|
|
|
|
result = runner.invoke(cli, test_args)
|
|
|
|
assert result.exit_code == 0
|
|
|
|
assert 'skipped due to disabled module' in result.output
|
|
|
|
assert 'Downloaded submission' not in result.output
|