示例#1
0
def test_feed_update_store_hashes(bot, feedreader_feed_valid):
    rss._feed_update(bot, feedreader_feed_valid, 'feed1', True)
    expected = [
        'f3ec142344be7e04431001e0dc658ed0', '601daf484a5766ecff6f6d1dc19131dc',
        '53c674b8916ad03755a6f8b679515b3a'
    ]
    hashes = bot.memory['rss']['hashes']['feed1'].get()
    assert expected == hashes
示例#2
0
def test_feed_update_store_hashes(bot, feedreader_feed_valid):
    rss._feed_update(bot, feedreader_feed_valid, "feed1", True)
    expected = [
        "f3ec142344be7e04431001e0dc658ed0",
        "601daf484a5766ecff6f6d1dc19131dc",
        "53c674b8916ad03755a6f8b679515b3a",
    ]
    hashes = bot.memory["rss"]["hashes"]["feed1"].get()
    assert expected == hashes
示例#3
0
def test_feed_update_no_update(bot, feedreader_feed_valid):
    rss._feed_update(bot, feedreader_feed_valid, "feed1", True)
    bot.output = ""
    rss._feed_update(bot, feedreader_feed_valid, "feed1", False)
    assert "" == bot.output
示例#4
0
def test_feed_update_messages(bot, feedreader_feed_valid):
    rss._feed_update(bot, feedreader_feed_valid, "feed1", True)
    expected = "\x02[feed1]\x02 Title 1 \x02→\x02 http://www.site1.com/article1\n\x02[feed1]\x02 Title 2 \x02→\x02 http://www.site1.com/article2\n\x02[feed1]\x02 Title 3 \x02→\x02 http://www.site1.com/article3\n"
    assert expected == bot.output
示例#5
0
def test_feed_update_no_update(bot, feedreader_feed_valid):
    rss._feed_update(bot, feedreader_feed_valid, 'feed1', True)
    bot.output = ''
    rss._feed_update(bot, feedreader_feed_valid, 'feed1', False)
    assert '' == bot.output
示例#6
0
def test_feed_update_messages(bot, feedreader_feed_valid):
    rss._feed_update(bot, feedreader_feed_valid, 'feed1', True)
    expected = '\x02[feed1]\x02 Title 1 \x02→\x02 http://www.site1.com/article1\n\x02[feed1]\x02 Title 2 \x02→\x02 http://www.site1.com/article2\n\x02[feed1]\x02 Title 3 \x02→\x02 http://www.site1.com/article3\n'
    assert expected == bot.output