def METHOD_NAME(self):
    # Bind the rpc server to a free port
    thread_pool = futures.ThreadPoolExecutor(max_workers=10)
    self._rpc_server = grpc.server(thread_pool)
    port = self._rpc_server.add_insecure_port('0.0.0.0:0')
    # mock the get_default_client function used to return the same
    # fakeredis object
    func_mock = \
        mock.MagicMock(return_value=fakeredis.FakeStrictRedis())
    with mock.patch(
            'magma.directoryd.rpc_servicer.get_default_client',
            func_mock,
    ):
        # Add the servicer
        self._servicer = GatewayDirectoryServiceRpcServicer(False)
        self._servicer.add_to_server(self._rpc_server)
        self._rpc_server.start()
    # Create a rpc stub
    channel = grpc.insecure_channel('0.0.0.0:{}'.format(port))
    self._stub = GatewayDirectoryServiceStub(channel)