예제 #1
0
    def test_stop_already_stopped(self):
        """Calling stop on a non-running router should not raise any
        exceptions"""

        config = self.create_router_config()
        router = Router(self.api, config)
        router.start(self.service)

        self.assertIn(router.id, self.service.namedServices)

        yield router.stop()

        self.assertNotIn(router.id, self.service.namedServices)

        yield router.stop()
예제 #2
0
    def test_stop_already_stopped(self):
        """Calling stop on a non-running router should not raise any
        exceptions"""

        config = self.create_router_config()
        router = Router(self.api, config)
        router.start(self.service)

        self.assertIn(router.id, self.service.namedServices)

        yield router.stop()

        self.assertNotIn(router.id, self.service.namedServices)

        yield router.stop()
예제 #3
0
    def test_stop(self):
        """stop should stop the router worker if it is running"""
        config = self.create_router_config()
        router = Router(self.api, config)
        router.start(self.service)

        self.assertIn(router.id, self.service.namedServices)

        yield router.stop()

        self.assertNotIn(router.id, self.service.namedServices)
예제 #4
0
    def test_stop(self):
        """stop should stop the router worker if it is running"""
        config = self.create_router_config()
        router = Router(self.api, config)
        router.start(self.service)

        self.assertIn(router.id, self.service.namedServices)

        yield router.stop()

        self.assertNotIn(router.id, self.service.namedServices)