示例#1
0
文件: test_endpoint.py 项目: daf/pyon
    def test_get_stats(self):
        ep = ListeningBaseEndpoint()
        ep._chan = Mock(spec=ListenChannel)

        ep.get_stats()

        ep._chan.get_stats.assert_called_once_with()
示例#2
0
    def test_get_stats(self):
        ep = ListeningBaseEndpoint()
        ep._chan = Mock(spec=ListenChannel)

        ep.get_stats()

        ep._chan.get_stats.assert_called_once_with()
示例#3
0
文件: test_endpoint.py 项目: daf/pyon
    def test_get_stats_multiple_on_named_queue(self):
        ep1 = ListeningBaseEndpoint(node=self.container.node, from_name="test_get_stats_multi")
        gl1 = spawn(ep1.listen)

        ep2 = ListeningBaseEndpoint(node=self.container.node, from_name="test_get_stats_multi")
        gl2 = spawn(ep2.listen)

        ep1.get_ready_event().wait(timeout=5)
        ep2.get_ready_event().wait(timeout=5)

        gs_res1 = ep1.get_stats()
        self.assertEquals(gs_res1, (0, 2)) # num of messages, num listeners

        gs_res2 = ep2.get_stats()
        self.assertEquals(gs_res2, (0, 2)) # num of messages, num listeners

        ep1.close()
        ep2.close()
        gl1.join(timeout=5)
        gl2.join(timeout=5)
示例#4
0
文件: test_endpoint.py 项目: daf/pyon
    def test_get_stats(self):
        ep = ListeningBaseEndpoint(node=self.container.node)
        gl = spawn(ep.listen, binding="test_get_stats")

        ep.get_ready_event().wait(timeout=5)

        gs_res = ep.get_stats()
        self.assertEquals(gs_res, (0, 1)) # num of messages, num listeners

        ep.close()
        gl.join(timeout=5)
示例#5
0
    def test_get_stats(self):
        ep = ListeningBaseEndpoint(node=self.container.node)
        gl = spawn(ep.listen, binding="test_get_stats")

        ep.get_ready_event().wait(timeout=5)

        gs_res = ep.get_stats()
        self.assertEquals(gs_res, (0, 1))  # num of messages, num listeners

        ep.close()
        gl.join(timeout=5)
示例#6
0
    def test_get_stats_multiple_on_named_queue(self):
        ep1 = ListeningBaseEndpoint(node=self.container.node,
                                    from_name="test_get_stats_multi")
        gl1 = spawn(ep1.listen)

        ep2 = ListeningBaseEndpoint(node=self.container.node,
                                    from_name="test_get_stats_multi")
        gl2 = spawn(ep2.listen)

        ep1.get_ready_event().wait(timeout=5)
        ep2.get_ready_event().wait(timeout=5)

        gs_res1 = ep1.get_stats()
        self.assertEquals(gs_res1, (0, 2))  # num of messages, num listeners

        gs_res2 = ep2.get_stats()
        self.assertEquals(gs_res2, (0, 2))  # num of messages, num listeners

        ep1.close()
        ep2.close()
        gl1.join(timeout=5)
        gl2.join(timeout=5)