def test_init_missing_cert(): """ Try to initialize the context with a nonexistant cert. """ config = load_config() config["name"] = "failboat" config["sign_messages"] = True context = FedMsgContext(**config) context.publish(topic="awesome", msg=dict(foo="bar"))
def test_init_missing_cert(): """ Try to initialize the context with a nonexistant cert. """ config = load_config() config['name'] = "failboat" config['sign_messages'] = True context = FedMsgContext(**config) context.publish(topic='awesome', msg=dict(foo='bar'))
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()
def setUp(self): self.config = load_config() self.config['name'] = local_name self.config['mute'] = True self.config['persistent_store'] = mock.Mock() self.replay_context = ReplayContext(**self.config) self.replay_thread = ReplayThread(self.replay_context) self.context = zmq.Context()
def setUp(self): self.config = load_config() self.config['name'] = local_name self.config['persistent_store'] = mock.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])
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])
def setUp(self): config = load_config() self.hub = CentralMokshaHub(config=config) self.context = FedMsgContext(**config) # fully qualified self.fq_topic = "org.fedoraproject.dev.%s.foo" % unittest.__name__ # short version self.topic = "foo"
def setUp(self): config = load_config() self.hub = CentralMokshaHub(config=config) self.context = FedMsgContext(**config) # fully qualified self.fq_topic = "com.test_prefix.dev.%s.foo" % unittest.__name__ # short version self.topic = "foo"
def test_init_invalid_endpoint(): try: config = load_config() config['name'] = local_name config['persistent_store'] = mock.Mock() tmp = zmq.Context() placeholder = tmp.socket(zmq.REP) placeholder.bind('tcp://*:{0}'.format( config["replay_endpoints"][local_name].rsplit(':')[-1])) ReplayContext(**config) finally: placeholder.close()
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()
def test_config(self): config = load_config() endpoints = config['endpoints'] for key, value in endpoints.items(): assert isinstance(value, list), value
def setUp(self): config = load_config() config['io_threads'] = 1 self.ctx = FedMsgContext(**config)
def test_init_missing_store(): config = load_config() context = ReplayContext(**config)
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)
def test_init_missing_endpoint(): """ Try to initialize the context with a nonexistant service name. """ config = load_config() config['persistent_store'] = mock.Mock() config['name'] = "failboat" ReplayContext(**config)
def test_init_missing_store(): config = load_config() ReplayContext(**config)