MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / assert_no_errors_in_result

Function assert_no_errors_in_result

tests/fixtures/helpers.py:59–77  ·  view source on GitHub ↗

Assert that the result doesn't contain common error indicators. Args: result: The result to check

(result: Union[Dict, str])

Source from the content-addressed store, hash-verified

57
58
59def assert_no_errors_in_result(result: Union[Dict, str]):
60 """Assert that the result doesn't contain common error indicators.
61
62 Args:
63 result: The result to check
64 """
65 result_str = json.dumps(result) if isinstance(result, dict) else str(result)
66 error_indicators = [
67 "error",
68 "exception",
69 "failed",
70 "timeout",
71 "rate limit",
72 ]
73
74 for indicator in error_indicators:
75 assert indicator.lower() not in result_str.lower(), (
76 f"Result contains error indicator: {indicator}"
77 )
78
79
80# ============================================================================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected