Assert that the result doesn't contain common error indicators. Args: result: The result to check
(result: Union[Dict, str])
| 57 | |
| 58 | |
| 59 | def 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 | # ============================================================================ |
nothing calls this directly
no outgoing calls
no test coverage detected