~homeworkprod/byceps

1baeb63d79ec5d688e5b8e3d6612edabcfdfc0c3 — Jochen Kupperschmidt 6 days ago 40b274f
Adjust IRC adapter to Weitersager v0.2's changed protocol
2 files changed, 3 insertions(+), 4 deletions(-)

M byceps/util/irc.py
M tests/integration/announce/irc/helpers.py
M byceps/util/irc.py => byceps/util/irc.py +1 -2
@@ 32,11 32,10 @@ def send_message(channel: str, text: str) -> None:
        'ANNOUNCE_IRC_TEXT_PREFIX', DEFAULT_TEXT_PREFIX
    )

    channels = [channel]
    text = text_prefix + text

    url = _get_config_value('ANNOUNCE_IRC_WEBHOOK_URL', DEFAULT_WEBHOOK_URL)
    data = {'channels': channels, 'text': text}
    data = {'channel': channel, 'text': text}

    # Delay a bit as an attempt to avoid getting kicked from server
    # because of flooding.

M tests/integration/announce/irc/helpers.py => tests/integration/announce/irc/helpers.py +2 -2
@@ 37,11 37,11 @@ def assert_submitted_data(
def assert_request_data(
    actual, expected_channel: str, expected_text: str
) -> None:
    assert actual['channels'] == [expected_channel]
    assert actual['channel'] == expected_channel
    assert actual['text'] == expected_text

    # Don't allow any other keys.
    assert actual.keys() == {'channels', 'text'}
    assert actual.keys() == {'channel', 'text'}


def get_submitted_json(mock, expected_call_count: int) -> List[str]: