Exemplo n.º 1
0
def test_command_remove_not_ignoring():
    client = Mock(nickname="helga")
    resp = ignore.ignore_command(client, "#bots", "me", "foo", "ignore", ["remove", "you"])
    assert resp == "Removed you from the ignore list"
Exemplo n.º 2
0
def test_command_remove():
    client = Mock(nickname="helga")
    with patch.object(ignore, "ignored", set(["you"])):
        resp = ignore.ignore_command(client, "#bots", "me", "foo", "ignore", ["remove", "you"])
        assert resp == "Removed you from the ignore list"
Exemplo n.º 3
0
def test_command_add():
    client = Mock(nickname="helga")
    resp = ignore.ignore_command(client, "#bots", "me", "foo", "ignore", ["add", "you"])
    assert resp == "Added you to the ignore list"
Exemplo n.º 4
0
def test_command_add_cannot_ignore_already_ignored():
    client = Mock(nickname="helga")
    with patch.object(ignore, "ignored", set(["you"])):
        resp = ignore.ignore_command(client, "#bots", "me", "foo", "ignore", ["add", "you"])
        assert resp == "I'm already ignoring you"
Exemplo n.º 5
0
def test_command_add_cannot_ignore_operator():
    client = Mock(nickname="helga")
    with patch.object(ignore.settings, "OPERATORS", ["you"]):
        resp = ignore.ignore_command(client, "#bots", "me", "foo", "ignore", ["add", "you"])
        assert resp == "I'm sorry me, but I can't ignore an operator"
Exemplo n.º 6
0
def test_command_add_cannot_ignore_self():
    client = Mock(nickname="helga")
    resp = ignore.ignore_command(client, "#bots", "me", "foo", "ignore", ["add", "me"])
    assert resp == "I'm sorry me, but you can't ignore yourself"
Exemplo n.º 7
0
def test_command_list():
    client = Mock(nickname="helga")
    with patch.object(ignore, "ignored", set(["me", "you"])):
        resp = ignore.ignore_command(client, "#bots", "me", "foo", "ignore", ["list"])
        assert resp == "Currently ignoring the following users: me, you"