34 |
34 |
35 from cubicweb import (BadConnectionId, RepositoryError, ValidationError, |
35 from cubicweb import (BadConnectionId, RepositoryError, ValidationError, |
36 UnknownEid, AuthenticationError, Unauthorized, QueryError) |
36 UnknownEid, AuthenticationError, Unauthorized, QueryError) |
37 from cubicweb.predicates import is_instance |
37 from cubicweb.predicates import is_instance |
38 from cubicweb.schema import CubicWebSchema, RQLConstraint |
38 from cubicweb.schema import CubicWebSchema, RQLConstraint |
39 from cubicweb.dbapi import connect, multiple_connections_unfix, ConnectionProperties |
39 from cubicweb.dbapi import connect, multiple_connections_unfix |
40 from cubicweb.devtools.testlib import CubicWebTC |
40 from cubicweb.devtools.testlib import CubicWebTC |
41 from cubicweb.devtools.repotest import tuplify |
41 from cubicweb.devtools.repotest import tuplify |
42 from cubicweb.server import repository, hook |
42 from cubicweb.server import repository, hook |
43 from cubicweb.server.sqlutils import SQL_PREFIX |
43 from cubicweb.server.sqlutils import SQL_PREFIX |
44 from cubicweb.server.hook import Hook |
44 from cubicweb.server.hook import Hook |
358 from logilab.common import pyro_ext |
358 from logilab.common import pyro_ext |
359 pyro_ext._DAEMONS.clear() |
359 pyro_ext._DAEMONS.clear() |
360 |
360 |
361 |
361 |
362 def _pyro_client(self, done): |
362 def _pyro_client(self, done): |
363 cnx = connect(self.repo.config.appid, u'admin', password='gingkow', |
363 cnx = connect('pyro:///'+self.repo.config.appid, |
|
364 u'admin', password='gingkow', |
364 initlog=False) # don't reset logging configuration |
365 initlog=False) # don't reset logging configuration |
365 try: |
366 try: |
366 cnx.load_appobjects(subpath=('entities',)) |
367 cnx.load_appobjects(subpath=('entities',)) |
367 # check we can get the schema |
368 # check we can get the schema |
368 schema = cnx.get_schema() |
369 schema = cnx.get_schema() |
412 while not done: |
413 while not done: |
413 time.sleep(0.1) |
414 time.sleep(0.1) |
414 srv.quit() |
415 srv.quit() |
415 |
416 |
416 def _zmq_client(self, done): |
417 def _zmq_client(self, done): |
417 cnxprops = ConnectionProperties('zmq') |
|
418 try: |
418 try: |
419 cnx = connect('tcp://127.0.0.1:41415', u'admin', password=u'gingkow', |
419 cnx = connect('tcp://127.0.0.1:41415', u'admin', password=u'gingkow', |
420 cnxprops=cnxprops, |
|
421 initlog=False) # don't reset logging configuration |
420 initlog=False) # don't reset logging configuration |
422 try: |
421 try: |
423 cnx.load_appobjects(subpath=('entities',)) |
422 cnx.load_appobjects(subpath=('entities',)) |
424 # check we can get the schema |
423 # check we can get the schema |
425 schema = cnx.get_schema() |
424 schema = cnx.get_schema() |