Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    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)
Example #4
0
    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)
Example #5
0
    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)
Example #6
0
    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)
Example #7
0
    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)
Example #8
0
    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)