module tests_mixin
Mixin class containing Tests specific methods
To be used by OpenMetadata class
class OMetaTestsMixin
OpenMetadata API methods related to Tests.
To be inherited by OpenMetadata
method add_logical_test_cases
Add logical test cases to a test suite
Args:
- <b>
data
</b> (CreateLogicalTestCases): logical test cases
method add_test_case_results
Add test case results to a test case
Args:
- <b>
test_results
</b> (TestCaseResult): test case results to pass to the test case - <b>
test_case_fqn
</b> (str): test case fqn
Returns:
- <b>
_type_
</b>: description
method create_or_update_executable_test_suite
Create or update an executable test suite
Args:
- <b>
data
</b> (CreateTestSuiteRequest): test suite request
Returns:
- <b>
TestSuite
</b>: test suite object
method delete_executable_test_suite
Delete executable test suite
Args:
- <b>
entity_id
</b> (str): test suite ID - <b>
recursive
</b> (bool, optional): delete children if true - <b>
hard_delete
</b> (bool, optional): hard delete if true
method get_or_create_executable_test_suite
Given an entity fqn, retrieve the link test suite if it exists or create a new one
Args:
- <b>
table_fqn
</b> (str): entity fully qualified name
Returns: TestSuite:
method get_or_create_test_case
Get or create a test case
Args:
- <b>
test_case_fqn
</b> (str): fully qualified name for the test - <b>
entity_link
</b> (Optional[str], optional): description. Defaults to None. - <b>
test_suite_fqn
</b> (Optional[str], optional): description. Defaults to None. - <b>
test_definition_fqn
</b> (Optional[str], optional): description. Defaults to None. - <b>
test_case_parameter_values
</b> (Optional[str], optional): description. Defaults to None.
Returns:
- <b>
_type_
</b>: description
method get_or_create_test_definition
Get or create a test definition
Args:
- <b>
test_definition_fqn
</b> (str): test definition fully qualified name - <b>
test_definition_description
</b> (Optional[str], optional): description for the test definition. Defaults to None. - <b>
entity_type
</b> (Optional[EntityType], optional): entity type (COLUMN or TABLE). Defaults to None. - <b>
test_platforms
</b> (Optional[List[TestPlatform]], optional): test platforms. Defaults to None. - <b>
test_case_parameter_definition
</b> (Optional[List[TestCaseParameterDefinition]], optional): parameters for the test case definition. Defaults to None.
Returns:
- <b>
TestDefinition
</b>: a test definition object
method get_or_create_test_suite
Get or create a TestSuite
Args:
- <b>
test_suite_name
</b> (str): test suite name - <b>
test_suite_description
</b> (Optional[str], optional): test suite description. Defaults to f"Test Suite created on {datetime.now(timezone.utc).strftime('%Y-%m-%d')}".
Returns: TestSuite:
method get_test_case_results
Retrieve list of test cases
Args:
- <b>
test_case_fqn
</b> (str): test_case_fqn - <b>
start_ts
</b> (int): timestamp - <b>
end_ts
</b> (int): timestamp