def METHOD_NAME(self, socket_patches):
    socket_patches.socket.recv.side_effect = [b"U", b"\x00\x00\x00\x03"]
    with pytest.raises(ValueError, match=r"Invalid command: .*"):
        codec.retrieve_msg(socket_patches.socket)