def test__user_and_channel_in_whitelist(): whois = WhoisData() whois.account = 'FooNick' assert (yield from cmd_is_good( cfg={'whitelist': '#bar,#foobar{Barnick},#foo{FooNick;BarNick}'}, func=create_func(cmd='cmd'), cmd='cmd', channel='#foo', user=User('foo!foo@foo'), whois=whois))
def test__user_and_channel_in_blacklist(): whois = WhoisData() whois.account = 'BarNick' assert not (yield from cmd_is_good( cfg={'whitelist': '#foobar,#barfoo{BarNick},*{FooNick}'}, func=create_func(cmd='cmd'), cmd='cmd', channel='#bar', user=User('foo!foo@foo'), whois=whois, ))
def whois_func(enemy): whois_data = WhoisData() whois_data.realname = 'foo' whois_data.host = 'bar' return whois_data