MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / to_dict

Method to_dict

AskAgent/python/testing/base_test_runner.py:60–80  ·  view source on GitHub ↗

Convert test result to dictionary.

(self)

Source from the content-addressed store, hash-verified

58 execution_time: float | None = None
59
60 def to_dict(self) -> dict[str, Any]:
61 """Convert test result to dictionary."""
62 result_dict = {
63 **self.test_case.to_dict(),
64 'success': self.success,
65 'error': self.error,
66 'execution_time': self.execution_time
67 }
68
69 # Add all additional attributes from the test case
70 if hasattr(self.test_case, '__dict__'):
71 for key, value in self.test_case.__dict__.items():
72 if key not in result_dict and not key.startswith('_'):
73 result_dict[key] = value
74
75 # Add all additional attributes from the result
76 for key, value in self.__dict__.items():
77 if key not in ['test_case', 'success', 'error', 'execution_time'] and not key.startswith('_'):
78 result_dict[key] = value
79
80 return result_dict
81
82
83class BaseTestRunner(ABC):

Callers

nothing calls this directly

Calls 1

to_dictMethod · 0.45

Tested by

no test coverage detected