Simple Pasta
Ingredients: 1 lb pasta, 2 cups sauce, 1 tbsp olive oil
Instructions: Boil pasta. Add sauce. Serve.
"""Tests for the waterfall recipe extractor. Test case: https://grilledcheesesocial.com/2020/01/19/funeral-sandwiches/ Expected: JSON-LD sniper finds Recipe schema, returns ingredients without LLM call. """ import json import os import sys import pytest # Add parent to path for imports sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) from bs4 import BeautifulSoup from costco_route.extractors.recipe import ( extract_json_ld, extract_recipe, extract_recipe_waterfall, recipe_from_json_ld, RecipeResult, ExtractionMethod, _flatten_ld_json, _is_recipe_type, _fix_json_newlines, _extract_html_chunk, _parse_servings, _parse_duration, _clean_ingredients, _parse_instructions, _extract_tags, ) # --------------------------------------------------------------------------- # Sample ld+json data for unit tests # --------------------------------------------------------------------------- SAMPLE_LD_JSON_DIRECT = ''' ''' SAMPLE_LD_JSON_GRAPH = ''' ''' SAMPLE_LD_JSON_LIST = ''' ''' SAMPLE_HTML_NO_LD = '''
Ingredients: 1 lb pasta, 2 cups sauce, 1 tbsp olive oil
Instructions: Boil pasta. Add sauce. Serve.
2 cups flour
Mix everything together
Real content
Content
' * 10000 + '