Exemple #1
0
def test_is_muted(mocker, msg, narrow, muted_streams, muted_topics, muted):
    model = mocker.Mock()
    model.narrow = narrow
    model.muted_streams = muted_streams
    model.muted_topics = muted_topics
    return_value = is_muted(msg, model)
    assert return_value is muted
Exemple #2
0
def test_is_muted(mocker, msg, narrow, muted_streams, muted_topics, muted):
    model = mocker.Mock()
    model.is_muted_stream = (mocker.Mock(
        return_value=(msg.get('stream_id', '') in muted_streams)))
    model.narrow = narrow
    model.muted_topics = muted_topics
    return_value = is_muted(msg, model)
    assert return_value is muted
Exemple #3
0
def test_is_muted(mocker, msg, narrow, muted_streams,
                  is_muted_topic_return_value, muted):
    model = mocker.Mock()
    model.is_muted_stream = mocker.Mock(
        return_value=(msg.get("stream_id", "") in muted_streams))
    model.narrow = narrow
    model.is_muted_topic.return_value = is_muted_topic_return_value
    return_value = is_muted(msg, model)
    assert return_value is muted
def test_is_muted(
    mocker: MockerFixture,
    msg: Message,
    narrow: List[Any],
    muted_streams: List[int],
    is_muted_topic_return_value: bool,
    muted: bool,
) -> None:
    model = mocker.Mock()
    model.is_muted_stream = mocker.Mock(
        return_value=(msg.get("stream_id", "") in muted_streams))
    model.narrow = narrow
    model.is_muted_topic.return_value = is_muted_topic_return_value
    return_value = is_muted(msg, model)
    assert return_value is muted