From c4aa6177372e73a469e58cdc5de57675de69a7a8 Mon Sep 17 00:00:00 2001 From: Serene-Arc Date: Fri, 2 Jul 2021 14:17:13 +1000 Subject: [PATCH] Add test for friends subreddit --- .../test_download_integration.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/integration_tests/test_download_integration.py b/tests/integration_tests/test_download_integration.py index fca0f8b..56da1d5 100644 --- a/tests/integration_tests/test_download_integration.py +++ b/tests/integration_tests/test_download_integration.py @@ -58,6 +58,21 @@ def test_cli_download_subreddits(test_args: list[str], tmp_path: Path): assert 'Added submissions from subreddit ' 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', ( + ['--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) + 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 @pytest.mark.skipif(not does_test_config_exist, reason='A test config file is required for integration tests')