1
0
Fork 0
mirror of synced 2024-06-02 18:34:37 +12:00

Test fixes

This commit is contained in:
OMEGARAZER 2023-06-24 16:42:36 -04:00
parent fb6ae392b1
commit c993e01634
No known key found for this signature in database
GPG key ID: D89925310D306E35
7 changed files with 29 additions and 31 deletions

View file

@ -39,16 +39,16 @@ def create_basic_args_for_download_runner(test_args: list[str], run_path: Path):
@pytest.mark.parametrize(
"test_args",
(
["-s", "Mindustry", "-L", 3],
["-s", "r/Mindustry", "-L", 3],
["-s", "r/mindustry", "-L", 3],
["-s", "mindustry", "-L", 3],
["-s", "EmpireDidNothingWrong", "-L", 3],
["-s", "r/EmpireDidNothingWrong", "-L", 3],
["-s", "r/EmpireDidNothingWrong", "-L", 3],
["-s", "EmpireDidNothingWrong", "-L", 3],
["-s", "https://www.reddit.com/r/TrollXChromosomes/", "-L", 3],
["-s", "r/TrollXChromosomes/", "-L", 3],
["-s", "TrollXChromosomes/", "-L", 3],
["-s", "trollxchromosomes", "-L", 3],
["-s", "trollxchromosomes,mindustry,python", "-L", 3],
["-s", "trollxchromosomes, mindustry, python", "-L", 3],
["-s", "trollxchromosomes,EmpireDidNothingWrong,python", "-L", 3],
["-s", "trollxchromosomes, EmpireDidNothingWrong, python", "-L", 3],
["-s", "trollxchromosomes", "-L", 3, "--time", "day"],
["-s", "trollxchromosomes", "-L", 3, "--sort", "new"],
["-s", "trollxchromosomes", "-L", 3, "--time", "day", "--sort", "new"],
@ -388,10 +388,10 @@ def test_cli_download_ignore_user(test_args: list[str], tmp_path: Path):
@pytest.mark.parametrize(
("test_args", "was_filtered"),
(
(["-l", "ljyy27", "--min-score", "50"], True),
(["-l", "ljyy27", "--min-score", "1"], False),
(["-l", "ljyy27", "--max-score", "1"], True),
(["-l", "ljyy27", "--max-score", "100"], False),
(["-l", "w22m5l", "--min-score", "50000"], True),
(["-l", "w22m5l", "--min-score", "1"], False),
(["-l", "w22m5l", "--max-score", "1"], True),
(["-l", "w22m5l", "--max-score", "50000"], False),
),
)
def test_cli_download_score_filter(test_args: list[str], was_filtered: bool, tmp_path: Path):

View file

@ -61,12 +61,10 @@ def test_gallery_get_links(test_ids: list[dict], expected: set[str]):
},
),
(
"ljyy27",
"w22m5l",
{
"359c203ec81d0bc00e675f1023673238",
"79262fd46bce5bfa550d878a3b898be4",
"808c35267f44acb523ce03bfa5687404",
"ec8b65bdb7f1279c4b3af0ea2bbb30c3",
"26aa07eed6dd0bd0ec871a9dcdd572ef",
"7e8d2dc005b1270947a0cef4cd64238f",
},
),
(

View file

@ -30,6 +30,6 @@ def test_yaml_file_read():
file = "./tests/yaml_test_configuration.yaml"
test_config = Configuration()
test_config.parse_yaml_options(file)
assert test_config.subreddit == ["EarthPorn", "TwoXChromosomes", "Mindustry"]
assert test_config.subreddit == ["EarthPorn", "TwoXChromosomes", "EmpireDidNothingWrong"]
assert test_config.sort == "new"
assert test_config.limit == 10

View file

@ -188,7 +188,7 @@ def test_get_submissions_from_link(
("test_subreddits", "limit", "sort_type", "time_filter", "max_expected_len"),
(
(("Futurology",), 10, "hot", "all", 10),
(("Futurology", "Mindustry, Python"), 10, "hot", "all", 30),
(("Futurology", "EmpireDidNothingWrong, Python"), 10, "hot", "all", 30),
(("Futurology",), 20, "hot", "all", 20),
(("Futurology", "Python"), 10, "hot", "all", 20),
(("Futurology",), 100, "hot", "all", 100),
@ -517,7 +517,7 @@ def test_check_subreddit_status_bad(test_subreddit_name: str, expected_message:
"test_subreddit_name",
(
"Python",
"Mindustry",
"EmpireDidNothingWrong",
"TrollXChromosomes",
"all",
),

View file

@ -174,7 +174,7 @@ def test_download_submission_file_exists(
@pytest.mark.online
@pytest.mark.reddit
@pytest.mark.parametrize(("test_submission_id", "expected_files_len"), (("ljyy27", 4),))
@pytest.mark.parametrize(("test_submission_id", "expected_files_len"), (("w22m5l", 2),))
def test_download_submission(
test_submission_id: str,
expected_files_len: int,
@ -195,7 +195,7 @@ def test_download_submission(
@pytest.mark.online
@pytest.mark.reddit
@pytest.mark.parametrize(("test_submission_id", "min_score"), (("ljyy27", 1),))
@pytest.mark.parametrize(("test_submission_id", "min_score"), (("w22m5l", 1),))
def test_download_submission_min_score_above(
test_submission_id: str,
min_score: int,
@ -219,7 +219,7 @@ def test_download_submission_min_score_above(
@pytest.mark.online
@pytest.mark.reddit
@pytest.mark.parametrize(("test_submission_id", "min_score"), (("ljyy27", 25),))
@pytest.mark.parametrize(("test_submission_id", "min_score"), (("w22m5l", 50000),))
def test_download_submission_min_score_below(
test_submission_id: str,
min_score: int,
@ -243,7 +243,7 @@ def test_download_submission_min_score_below(
@pytest.mark.online
@pytest.mark.reddit
@pytest.mark.parametrize(("test_submission_id", "max_score"), (("ljyy27", 25),))
@pytest.mark.parametrize(("test_submission_id", "max_score"), (("w22m5l", 50000),))
def test_download_submission_max_score_below(
test_submission_id: str,
max_score: int,
@ -267,7 +267,7 @@ def test_download_submission_max_score_below(
@pytest.mark.online
@pytest.mark.reddit
@pytest.mark.parametrize(("test_submission_id", "max_score"), (("ljyy27", 1),))
@pytest.mark.parametrize(("test_submission_id", "max_score"), (("w22m5l", 1),))
def test_download_submission_max_score_above(
test_submission_id: str,
max_score: int,

View file

@ -336,10 +336,10 @@ def test_strip_emojies(test_string: str, expected: str):
("test_submission_id", "expected"),
(
(
"mfuteh",
"718ifq",
{
"title": "Why Do Interviewers Ask Linked List Questions?",
"redditor": "mjgardner",
"title": "Wood Stormtrooper Carving",
"redditor": "deathakissaway",
},
),
),
@ -357,11 +357,11 @@ def test_generate_dict_for_submission(test_submission_id: str, expected: dict, r
("test_comment_id", "expected"),
(
(
"gsq0yuw",
"dn8xwh1",
{
"title": "Why Do Interviewers Ask Linked List Questions?",
"redditor": "Doctor-Dapper",
"postid": "gsq0yuw",
"title": "Wood Stormtrooper Carving",
"redditor": "lemonman37",
"postid": "dn8xwh1",
"flair": "",
},
),

View file

@ -3,4 +3,4 @@ sort: new
subreddit:
- EarthPorn
- TwoXChromosomes
- Mindustry
- EmpireDidNothingWrong