Beispiel #1
0
class TestBidirClientChannel(PyonTestCase):

    # @TODO: have to do this because i'm patching the class, anything to be done?
    def test_verify_service(self, mocksendchannel):
        PyonTestCase.test_verify_service(self)

    def setUp(self):
        self.ch = BidirClientChannel()

    def test__send_with_reply_to(self, mocksendchannel):

        self.ch._recv_name = NameTrio(sentinel.xp, sentinel.queue)

        self.ch._send(sentinel.name, sentinel.data, headers={sentinel.header_key: sentinel.header_value})

        mocksendchannel._send.assert_called_with(self.ch,
                                                 sentinel.name,
                                                 sentinel.data,
                                                 headers={sentinel.header_key: sentinel.header_value, 'reply-to': '%s,%s' % (sentinel.xp, sentinel.queue)})


    def test__send_with_no_reply_to(self, mocksendchannel):

        # must set recv_name
        self.ch._recv_name = NameTrio(sentinel.xp, sentinel.queue)

        self.ch._send(sentinel.name, sentinel.data)

        mocksendchannel._send.assert_called_with(self.ch, sentinel.name, sentinel.data, headers={'reply-to':"%s,%s" % (sentinel.xp, sentinel.queue)})
Beispiel #2
0
class TestBidirClientChannel(PyonTestCase):
    def setUp(self):
        self.ch = BidirClientChannel()

    def test__send_with_reply_to(self, mocksendchannel):

        self.ch._recv_name = NameTrio(sentinel.xp, sentinel.queue)

        self.ch._send(sentinel.name,
                      sentinel.data,
                      headers={sentinel.header_key: sentinel.header_value})

        mocksendchannel._send.assert_called_with(
            self.ch,
            sentinel.name,
            sentinel.data,
            headers={
                sentinel.header_key: sentinel.header_value,
                'reply-to': '%s,%s' % (sentinel.xp, sentinel.queue)
            })

    def test__send_with_no_reply_to(self, mocksendchannel):

        # must set recv_name
        self.ch._recv_name = NameTrio(sentinel.xp, sentinel.queue)

        self.ch._send(sentinel.name, sentinel.data)

        mocksendchannel._send.assert_called_with(
            self.ch,
            sentinel.name,
            sentinel.data,
            headers={'reply-to': "%s,%s" % (sentinel.xp, sentinel.queue)})
Beispiel #3
0
class TestBidirClientChannel(PyonTestCase):

    def setUp(self):
        self.ch = BidirClientChannel()

    def test__send_with_reply_to(self, mocksendchannel):

        self.ch._recv_name = NameTrio(sentinel.xp, sentinel.queue)

        self.ch._send(sentinel.name, sentinel.data, headers={sentinel.header_key: sentinel.header_value})

        mocksendchannel._send.assert_called_with(self.ch,
                                                 sentinel.name,
                                                 sentinel.data,
                                                 headers={sentinel.header_key: sentinel.header_value, 'reply-to': '%s,%s' % (sentinel.xp, sentinel.queue)})


    def test__send_with_no_reply_to(self, mocksendchannel):

        # must set recv_name
        self.ch._recv_name = NameTrio(sentinel.xp, sentinel.queue)

        self.ch._send(sentinel.name, sentinel.data)

        mocksendchannel._send.assert_called_with(self.ch, sentinel.name, sentinel.data, headers={'reply-to':"%s,%s" % (sentinel.xp, sentinel.queue)})
Beispiel #4
0
class TestBidirClientChannel(PyonTestCase):

    # @TODO: have to do this because i'm patching the class, anything to be done?
    def test_verify_service(self, mocksendchannel):
        PyonTestCase.test_verify_service(self)

    def setUp(self):
        self.ch = BidirClientChannel()

    def test__send_with_reply_to(self, mocksendchannel):

        self.ch._recv_name = NameTrio(sentinel.xp, sentinel.queue)

        self.ch._send(sentinel.name,
                      sentinel.data,
                      headers={sentinel.header_key: sentinel.header_value})

        mocksendchannel._send.assert_called_with(
            self.ch,
            sentinel.name,
            sentinel.data,
            headers={
                sentinel.header_key: sentinel.header_value,
                'reply-to': '%s,%s' % (sentinel.xp, sentinel.queue)
            })

    def test__send_with_no_reply_to(self, mocksendchannel):

        # must set recv_name
        self.ch._recv_name = NameTrio(sentinel.xp, sentinel.queue)

        self.ch._send(sentinel.name, sentinel.data)

        mocksendchannel._send.assert_called_with(
            self.ch,
            sentinel.name,
            sentinel.data,
            headers={'reply-to': "%s,%s" % (sentinel.xp, sentinel.queue)})
Beispiel #5
0
 def setUp(self):
     self.ch = BidirClientChannel()
Beispiel #6
0
 def setUp(self):
     self.ch = BidirClientChannel()