def test_bind_socket_fail(zmq_context): socket = zmq_context.socket(zmq.PUB) with pytest.raises(zmq.ZMQError): bind_socket(socket, "bad-address", '--publish') socket.close()
def test_bind_socket_success(zmq_context): socket = zmq_context.socket(zmq.PUB) address = "ipc:///tmp/pelita-test-bind-socket-%s" % uuid.uuid4() bind_socket(socket, address)