Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"
Пример #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"