def test_yaml_config(): cfg = Config() cfg.read_from_string(""" adapters: [xmpp, irc] irc: channels: [thebot, test] xmpp: jid: [email protected] """) eq_(['xmpp', 'irc'], cfg.adapters) eq_('*****@*****.**', cfg.xmpp_jid)
def test_get_config_values_from_nested_structures(): cfg = Config() cfg.read_from_string(""" xmpp: jid: [email protected] notify: adapter: irc to_username: art """) eq_('*****@*****.**', cfg.xmpp['jid']) eq_('*****@*****.**', cfg.xmpp_jid) eq_('irc', cfg.xmpp_notify_adapter) eq_('art', cfg.xmpp_notify_to_username)