def test_shutdown_request(self):
    rc = utils.MockRequestContext()
    handler = mock.MagicMock()
    server = JSONRPCServer(None, None, logger=utils.get_mock_logger())
    server.add_shutdown_handler(handler)
    server._handle_shutdown_request(rc, None)
    self.assertTrue(server._stop_requested)
    handler.assert_called_once()
def test_shutdown_request(self):
    rc = utils.MockRequestContext()
    handler = mock.MagicMock()
    server = JSONRPCServer(None, None, logger=utils.get_mock_logger())
    server.add_shutdown_handler(handler)
    server._handle_shutdown_request(rc, None)
    self.assertTrue(server._stop_requested)
    handler.assert_called_once()