示例#1
0
    def test_check_subreddits_only_valid_subreddits(self):
        invalid, valid = [], []
        reddit = Login.create_reddit_object()

        object_list = ["askreddit", "wallstreetbets", "cscareerquestions"]

        Validation._check_subreddits(invalid, object_list, reddit, valid)

        assert not invalid
        assert len(valid) == 3
示例#2
0
    def test_check_subreddits_only_invalid_subreddits(self):
        invalid, valid = [], []
        reddit = Login.create_reddit_object()

        object_list = [
            "shdg8h342842h3gidbsfgjdbs",
            "asdfhauhwspf8912034812hudfghb979023974ht",
            "xcvhcsxiuvbeidefgh3qw48tr324805tyasdguap;l"
        ]

        Validation._check_subreddits(invalid, object_list, reddit, valid)

        assert not valid
        assert len(invalid) == 3
示例#3
0
    def test_check_subreddit_both_valid_and_invalid_subreddits(self):
        invalid, valid = [], []
        reddit = Login.create_reddit_object()

        object_list = [
            "askreddit", "wallstreetbets", "cscareerquestions",
            "shdg8h342842h3gidbsfgjdbs",
            "asdfhauhwspf8912034812hudfghb979023974ht",
            "xcvhcsxiuvbeidefgh3qw48tr324805tyasdguap;l",
            "u0893-45u238hdusafghudsgh982"
        ]

        Validation._check_subreddits(invalid, object_list, reddit, valid)

        assert len(valid) == 3
        assert len(invalid) == 4