def test_invalid_cfg(create_bot):
    wiki_flair_posts = """
    [Seup]

    """
    test.create_bot(TEST_SUBREDDIT)
    sub = test.get_subreddit(TEST_SUBREDDIT)
    # Update flair posts control panel
    sub.edit_wiki("control_panel", enable_flair_posts)
    sub.edit_wiki("changed_title", wiki_flair_posts, author="wikieditboy")

    # Tell the bot to update the control panel
    test.get_reddit().inbox.add_message(
        "mod1", "/update_control_panel --subreddit %s" % TEST_SUBREDDIT)

    test.advance_time_30m()

    assert (len(test.get_user("wikieditboy").inbox) == 1)
def test_invalid_cfg(create_bot):
    wiki_flair_posts = """
    [Seup]
    message_intervals = 2, 30

    message = message ${MESSAGE_NO}/${MAX_MESSAGES}/${SUBMISSION_LINK}
    """
    test.create_bot(TEST_SUBREDDIT)
    sub = test.get_subreddit(TEST_SUBREDDIT)
    # Update flair posts control panel
    sub.edit_wiki("control_panel", enable_flair_posts)
    sub.edit_wiki("flair_posts",
                  wiki_flair_posts,
                  author="wikieditboy_flair_posts")

    # Tell the bot to update the control panel
    test.get_reddit().inbox.add_message(
        "mod1", "/update_control_panel --subreddit %s" % TEST_SUBREDDIT)

    test.advance_time_30m()

    assert (len(test.get_user("wikieditboy_flair_posts").inbox) == 1)
Example #3
0
def create_bot():
    test.create_bot(TEST_SUBREDDIT)