def test_routing_call_property(self): s = ProcessSubscriber(process=sentinel.process, routing_call=sentinel.routing_call) self.assertEquals(s.routing_call, sentinel.routing_call) s.routing_call = sentinel.something_else self.assertEquals(s.routing_call, sentinel.something_else)
def test_create_endpoint(self, mockce): s = ProcessSubscriber(process=sentinel.process, routing_call=sentinel.routing_call) ep = s.create_endpoint(kw=sentinel.kwarg) mockce.assert_called_once_with(ANY, process=sentinel.process, routing_call=sentinel.routing_call, kw=sentinel.kwarg)
def __init__(self, **kwargs): """ @param name is a tuple (xp, exchange_name) @param callback is a call back function @param Process is the subscribing process @param node is cc.node """ assert "process" in kwargs if not kwargs.get('callback', None): kwargs = kwargs.copy() kwargs['callback'] = kwargs.get('process').call_process ProcessSubscriber.__init__(self, **kwargs)
def __init__(self, **kwargs): """ @param name is a tuple (xp, exchange_name) @param callback is a call back function @param Process is the subscribing process @param node is cc.node """ if not kwargs.get('callback', None): kwargs = kwargs.copy() kwargs['callback'] = self._callback self._routing_call = None ProcessSubscriber.__init__(self, **kwargs)
def test_init(self, mocks): s = ProcessSubscriber(process=sentinel.process, routing_call=sentinel.routing_call, kw1=sentinel.kw1, kw2=sentinel.kw2) self.assertEquals(s._process, sentinel.process) self.assertEquals(s._routing_call, sentinel.routing_call) mocks.assert_called_once_with(s, kw1=sentinel.kw1, kw2=sentinel.kw2)