def test_config_read_format_custom_invalid(bot_basic): formats_custom = ["f=al+fpatl;f=yy+fty"] bot_basic.config.rss.formats = formats_custom rss._config_read(bot_basic) formats = bot_basic.memory["rss"]["formats"] expected = ["al+fpatl"] assert expected == formats
def test_config_read_template_default(bot_basic): for t in rss.TEMPLATES_DEFAULT: bot_basic.config.rss.templates.append("t=" + t + "|" + rss.TEMPLATES_DEFAULT[t]) rss._config_read(bot_basic) templates = bot_basic.memory["rss"]["templates"] expected = rss.TEMPLATES_DEFAULT assert expected == templates
def test_config_read_format_custom_invalid(bot_basic): formats_custom = ['f=al+fpatl;f=yy+fty'] bot_basic.config.rss.formats = formats_custom rss._config_read(bot_basic) formats = bot_basic.memory['rss']['formats'] expected = ['al+fpatl'] assert expected == formats
def test_config_read_template_default(bot_basic): for t in rss.TEMPLATES_DEFAULT: bot_basic.config.rss.templates.append('t=' + t + '|' + rss.TEMPLATES_DEFAULT[t]) rss._config_read(bot_basic) templates = bot_basic.memory['rss']['templates'] expected = rss.TEMPLATES_DEFAULT assert expected == templates
def test_config_read_template_custom(bot_basic): templates_custom = ["t=t|>>{}<<"] bot_basic.config.rss.templates = templates_custom rss._config_read(bot_basic) templates = bot_basic.memory["rss"]["templates"] expected = dict() for t in rss.TEMPLATES_DEFAULT: expected[t] = rss.TEMPLATES_DEFAULT[t] expected["t"] = ">>{}<<" assert expected == templates
def test_config_read_template_custom(bot_basic): templates_custom = ['t=t|>>{}<<'] bot_basic.config.rss.templates = templates_custom rss._config_read(bot_basic) templates = bot_basic.memory['rss']['templates'] expected = dict() for t in rss.TEMPLATES_DEFAULT: expected[t] = rss.TEMPLATES_DEFAULT[t] expected['t'] = '>>{}<<' assert expected == templates
def test_config_read_format_default(bot_basic): bot_basic.config.rss.formats = ["f=" + rss.FORMAT_DEFAULT] rss._config_read(bot_basic) formats = bot_basic.memory["rss"]["formats"] expected = [rss.FORMAT_DEFAULT] assert expected == formats
def test_config_read_feed_default(bot_basic): rss._config_read(bot_basic) feeds = bot_basic.memory["rss"]["feeds"] expected = {} assert expected == feeds
def test_config_read_format_default(bot_basic): bot_basic.config.rss.formats = ['f=' + rss.FORMAT_DEFAULT] rss._config_read(bot_basic) formats = bot_basic.memory['rss']['formats'] expected = [rss.FORMAT_DEFAULT] assert expected == formats
def test_config_read_feed_default(bot_basic): rss._config_read(bot_basic) feeds = bot_basic.memory['rss']['feeds'] expected = {} assert expected == feeds