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
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
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
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
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
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