def _make_namespace_with_route(): # type: (...) -> ApiNamespace ns = ApiNamespace("_make_namespace_with_route()") mock_ast_node = Mock() route_one = ApiRoute( name="route_one", ast_node=mock_ast_node, ) route_two = ApiRoute( name="route_two", ast_node=mock_ast_node, ) ns.add_route(route_one) ns.add_route(route_two) return ns
def _make_namespace_with_route_name_conflict(): # type: (...) -> ApiNamespace ns = ApiNamespace("_make_namespace_with_route()") mock_ast_node = Mock() route_one = ApiRoute( name="route_one_v2", version=1, ast_node=mock_ast_node, ) route_two = ApiRoute( name="route_one", version=2, ast_node=mock_ast_node, ) ns.add_route(route_one) ns.add_route(route_two) return ns