Beispiel #1
0
def test_decompress_broken():
    frames = [Frame(1, b'hello', fin=0), Frame(0, b' world!', fin=1)]

    def decompress(frames):
        raise ValueError('broken')

    with pytest.raises(CriticalProtocolError):
        Message.decompress_frames(frames, decompress)
Beispiel #2
0
def test_decompress():
    assert Message.decompress_frames('foo', lambda frames: frames) == 'foo'