Module test_protocol_utils
source linkFunctions
▷ def test_merge_frames(lengths, writeable, frames) @pytest.mark.parametrize( "lengths,writeable,frames", [ ([3], [False], [b"123"]), ([3], [True], [b"123"]), ([3], [None], [b"123"]), ([3], [False], [bytearray(b"123")]), ([3], [True], [bytearray(b"123")]), ([3], [None], [bytearray(b"123")]), ([3, 3], [False, False], [b"123", b"456"]), ([2, 3, 2], [False, True, None], [b"12345", b"67"]), ([2, 3, 2], [False, True, None], [bytearray(b"12345"), bytearray(b"67")]), ([5, 2], [False, True], [b"123", b"45", b"67"]), ([3, 4], [None, False], [b"12", b"34", b"567"]), ], ) @pytest.mark.parametrize( "lengths,writeable,frames", [ ([3], [False], [b"123"]), ([3], [True], [b"123"]), ([3], [None], [b"123"]), ([3], [False], [bytearray(b"123")]), ([3], [True], [bytearray(b"123")]), ([3], [None], [bytearray(b"123")]), ([3, 3], [False, False], [b"123", b"456"]), ([2, 3, 2], [False, True, None], [b"12345", b"67"]), ([2, 3, 2], [False, True, None], [bytearray(b"12345"), bytearray(b"67")]), ([5, 2], [False, True], [b"123", b"45", b"67"]), ([3, 4], [None, False], [b"12", b"34", b"567"]), ], )
def test_merge_frames(
lengths,
writeable,
frames,
)