Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)