def test_config_split_feeds_format_and_template(bot): feeds = [ '#channel2' + rss.CONFIG_SEPARATOR + 'feed2' + rss.CONFIG_SEPARATOR + FEED_VALID + rss.CONFIG_SEPARATOR + 'f=fy+fty;t=t|+++{}+++' ] rss._config_split_feeds(bot, feeds) result = rss._feed_exists(bot, 'feed2') assert result is True
def test_config_split_feeds_invalid(bot): feeds = [ '#channel2' + rss.CONFIG_SEPARATOR + 'feed2' + rss.CONFIG_SEPARATOR + FEED_INVALID + rss.CONFIG_SEPARATOR + 'f=fy+fty' ] rss._config_split_feeds(bot, feeds) result = rss._feed_exists(bot, 'feed2') assert result is False
def test_rss_del_feed_delete(bot): rss._rss_add(bot, ['add', '#channel', 'feedname', FEED_VALID]) rss._rss_del(bot, ['del', 'feedname']) assert rss._feed_exists(bot, 'feedname') is False
def test_rss_add_feed_add(bot): rss._rss_add(bot, ['add', '#channel', 'feedname', FEED_VALID]) assert rss._feed_exists(bot, 'feedname')
def test_feed_exists_fails(bot): assert rss._feed_exists(bot, 'nofeed') is False
def test_feed_exists_passes(bot): assert rss._feed_exists(bot, 'feed1')
def test_config_set_feeds_exists(bot_basic): feeds = '#channelA' + rss.CONFIG_SEPARATOR + 'feedA' + rss.CONFIG_SEPARATOR + FEED_BASIC + rss.CONFIG_SEPARATOR + \ 'f=fyg+fgty,#channelB' + rss.CONFIG_SEPARATOR + 'feedB' + rss.CONFIG_SEPARATOR + FEED_BASIC + rss.CONFIG_SEPARATOR + 'f=lp+fptl' rss._config_set_feeds(bot_basic, feeds) result = rss._feed_exists(bot_basic, 'feedB') assert result is True