Example #1
0
    def test__cancel_pending_call(self):
        svc = self._make_service()
        p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)

        ar = p._routing_call(sentinel.call, MagicMock())
        val = p._cancel_pending_call(ar)

        self.assertTrue(val)
        self.assertTrue(ar.ready())
Example #2
0
    def test__cancel_pending_call(self):
        svc = self._make_service()
        p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)

        ar = p._routing_call(sentinel.call, MagicMock())
        val = p._cancel_pending_call(ar)

        self.assertTrue(val)
        self.assertTrue(ar.ready())
Example #3
0
    def test__cancel_pending_call_with_no_call(self):
        svc = self._make_service()
        p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)

        ar = p._routing_call(sentinel.call, MagicMock())
        # pretend we've processed it
        p._ctrl_queue.get()

        val = p._cancel_pending_call(ar)

        self.assertFalse(val)
Example #4
0
    def test__cancel_pending_call_with_no_call(self):
        svc = self._make_service()
        p = IonProcessThread(name=sentinel.name, listeners=[], service=svc)

        ar = p._routing_call(sentinel.call, MagicMock())
        # pretend we've processed it
        p._ctrl_queue.get()

        val = p._cancel_pending_call(ar)

        self.assertFalse(val)