From 56575dc390fbefcbcbadb390e950fdda38561030 Mon Sep 17 00:00:00 2001 From: Serene-Arc Date: Thu, 9 Sep 2021 13:43:11 +1000 Subject: [PATCH] Add NSFW search test --- .../test_download_integration.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/integration_tests/test_download_integration.py b/tests/integration_tests/test_download_integration.py index 6fecd73..57f39bf 100644 --- a/tests/integration_tests/test_download_integration.py +++ b/tests/integration_tests/test_download_integration.py @@ -45,7 +45,6 @@ def create_basic_args_for_download_runner(test_args: list[str], run_path: Path): ['-s', 'trollxchromosomes', '-L', 1, '--sort', 'new'], ['-s', 'trollxchromosomes', '-L', 1, '--time', 'day', '--sort', 'new'], ['-s', 'trollxchromosomes', '-L', 1, '--search', 'women'], - ['-s', 'hentai', '-L', 10, '--search', 'red'], ['-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'], @@ -59,6 +58,22 @@ def test_cli_download_subreddits(test_args: list[str], tmp_path: Path): assert 'Downloaded submission' in result.output +@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', ( + ['-s', 'hentai', '-L', 10, '--search', 'red', '--authenticate'], +)) +def test_cli_download_search_subreddits_authenticated(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 'Added submissions from subreddit ' in result.output + assert 'Downloaded submission' in result.output + + @pytest.mark.online @pytest.mark.reddit @pytest.mark.authenticated