@@ -874,49 +874,6 @@ def test_routine_with_escaped_string_params_from_json(self, input_data_dir: Path
874874 assert "{{search_query}}" in fetch_op .endpoint .url
875875 assert "{{page_size}}" in fetch_op .endpoint .url
876876
877- def test_yahoo_finance_routine_from_discovery_output (self ) -> None :
878- """Real-world example: Yahoo Finance routine with escaped string headers."""
879- # load the actual routine from routine_discovery_output
880- routine_path = Path ("/home/ec2-user/web-hacker/routine_discovery_output/routine.json" )
881- if not routine_path .exists ():
882- pytest .skip ("Yahoo Finance routine not found in routine_discovery_output" )
883-
884- data = load_data (routine_path )
885- routine = Routine (** data )
886-
887- assert routine .name == "Yahoo Finance - Search Ticker"
888- assert len (routine .parameters ) == 6
889-
890- # verify all parameters are string or integer types
891- param_types = {p .name : p .type for p in routine .parameters }
892- assert param_types ["query" ] == ParameterType .STRING
893- assert param_types ["lang" ] == ParameterType .STRING
894- assert param_types ["region" ] == ParameterType .STRING
895- assert param_types ["quotesCount" ] == ParameterType .INTEGER
896- assert param_types ["newsCount" ] == ParameterType .INTEGER
897- assert param_types ["listsCount" ] == ParameterType .INTEGER
898-
899- # get the fetch operation
900- fetch_op = routine .operations [2 ]
901- assert isinstance (fetch_op , RoutineFetchOperation )
902-
903- # verify STRING parameters are ESCAPED in x-param headers
904- assert fetch_op .endpoint .headers ["x-param-query" ] == '"{{query}}"'
905- assert fetch_op .endpoint .headers ["x-param-lang" ] == '"{{lang}}"'
906- assert fetch_op .endpoint .headers ["x-param-region" ] == '"{{region}}"'
907-
908- # verify INTEGER parameters are ESCAPED in x-param headers (note: even integers get escaped in this pattern)
909- assert fetch_op .endpoint .headers ["x-param-quotesCount" ] == '"{{quotesCount}}"'
910- assert fetch_op .endpoint .headers ["x-param-newsCount" ] == '"{{newsCount}}"'
911- assert fetch_op .endpoint .headers ["x-param-listsCount" ] == '"{{listsCount}}"'
912-
913- # verify parameters are in URL (no escaping in URLs)
914- assert "{{query}}" in fetch_op .endpoint .url
915- assert "{{lang}}" in fetch_op .endpoint .url
916- assert "{{region}}" in fetch_op .endpoint .url
917- assert "{{quotesCount}}" in fetch_op .endpoint .url
918- assert "{{newsCount}}" in fetch_op .endpoint .url
919- assert "{{listsCount}}" in fetch_op .endpoint .url
920877
921878 def test_routine_inherits_from_resource_base (self ) -> None :
922879 """Routine should inherit ResourceBase functionality."""
0 commit comments