Exemplo n.º 1
0
 def setUp(self):
     self.config = load_config()
     self.config['name'] = local_name
     self.config['mute'] = True
     self.config['persistent_store'] = Mock()
     self.replay_context = ReplayContext(**self.config)
     self.replay_thread = ReplayThread(self.replay_context)
     self.context = zmq.Context()
Exemplo n.º 2
0
 def setUp(self):
     self.config = load_config()
     self.config['name'] = local_name
     self.config['persistent_store'] = Mock()
     self.replay_context = ReplayContext(**self.config)
     self.request_context = zmq.Context()
     self.request_socket = self.request_context.socket(zmq.REQ)
     self.request_socket.connect(
         self.config['replay_endpoints'][local_name])
Exemplo n.º 3
0
def test_init_invalid_endpoint():
    try:
        config = load_config()
        config['name'] = local_name
        config['persistent_store'] = Mock()
        tmp = zmq.Context()
        placeholder = tmp.socket(zmq.REP)
        placeholder.bind('tcp://*:{0}'.format(
            config["replay_endpoints"][local_name].rsplit(':')[-1]))
        context = ReplayContext(**config)
    finally:
        placeholder.close()
Exemplo n.º 4
0
def test_init_missing_store():
    config = load_config()
    context = ReplayContext(**config)
Exemplo n.º 5
0
def test_init_missing_endpoint():
    """ Try to initialize the context with a nonexistant service name. """
    config = load_config()
    config['persistent_store'] = Mock()
    config['name'] = "failboat"
    context = ReplayContext(**config)