Fix the unittest of get_endpoint