fix no more running zmq repository test (closes #2500153) stable
authorFlorent Cayré <florent.cayre@logilab.fr>
Tue, 02 Oct 2012 16:44:55 +0200
branchstable
changeset 8572 e54b3bc39011
parent 8571 7e5246889148
child 8573 ae0a567dff30
child 8575 688d108af306
fix no more running zmq repository test (closes #2500153)
dbapi.py
server/test/unittest_repository.py
zmqclient.py
--- a/dbapi.py	Fri Sep 28 17:49:54 2012 +0200
+++ b/dbapi.py	Tue Oct 02 16:44:55 2012 +0200
@@ -104,7 +104,7 @@
         return Repository(config, TasksManager(), vreg=vreg)
     elif method == 'zmq':
         from cubicweb.zmqclient import ZMQRepositoryClient
-        return ZMQRepositoryClient(config, vreg=vreg)
+        return ZMQRepositoryClient(database)
     else: # method == 'pyro'
         # resolve the Pyro object
         from logilab.common.pyro_ext import ns_get_proxy, get_proxy
--- a/server/test/unittest_repository.py	Fri Sep 28 17:49:54 2012 +0200
+++ b/server/test/unittest_repository.py	Tue Oct 02 16:44:55 2012 +0200
@@ -416,8 +416,7 @@
     def _zmq_client(self, done):
         cnxprops = ConnectionProperties('zmq')
         try:
-            cnx = connect(self.repo.config.appid, u'admin', password=u'gingkow',
-                          host='tcp://127.0.0.1:41415',
+            cnx = connect('tcp://127.0.0.1:41415', u'admin', password=u'gingkow',
                           cnxprops=cnxprops,
                           initlog=False) # don't reset logging configuration
             try:
--- a/zmqclient.py	Fri Sep 28 17:49:54 2012 +0200
+++ b/zmqclient.py	Tue Oct 02 16:44:55 2012 +0200
@@ -43,12 +43,9 @@
     ZMQ is used as the transport layer and cPickle is used to serialize data.
     """
 
-    def __init__(self, config, vreg=None):
-        self.config = config
-        self.vreg = vreg
+    def __init__(self, zmq_address):
         self.socket = ctx.socket(zmq.REQ)
-        self.host = config.get('base-url')
-        self.socket.connect(self.host)
+        self.socket.connect(zmq_address)
 
     def __zmqcall__(self, name, *args, **kwargs):
          self.socket.send_pyobj([name, args, kwargs])