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:
data
(CreateLogicalTestCases): logical test cases
method add_test_case_results
Add test case results to a test case
Args:
test_results
(TestCaseResult): test case results to pass to the test casetest_case_fqn
(str): test case fqn
Returns:
_type_
: description
method create_or_update_executable_test_suite
Create or update an executable test suite
Args:
data
(CreateTestSuiteRequest): test suite request
Returns:
TestSuite
: test suite object
method delete_executable_test_suite
Delete executable test suite
Args:
entity_id
(str): test suite IDrecursive
(bool, optional): delete children if truehard_delete
(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:
table_fqn
(str): entity fully qualified name
Returns: TestSuite:
method get_or_create_test_case
Get or create a test case
Args:
test_case_fqn
(str): fully qualified name for the testentity_link
(Optional[str], optional): description. Defaults to None.test_suite_fqn
(Optional[str], optional): description. Defaults to None.test_definition_fqn
(Optional[str], optional): description. Defaults to None.test_case_parameter_values
(Optional[str], optional): description. Defaults to None.
Returns:
_type_
: description
method get_or_create_test_definition
Get or create a test definition
Args:
test_definition_fqn
(str): test definition fully qualified nametest_definition_description
(Optional[str], optional): description for the test definition. Defaults to None.entity_type
(Optional[EntityType], optional): entity type (COLUMN or TABLE). Defaults to None.test_platforms
(Optional[List[TestPlatform]], optional): test platforms. Defaults to None.test_case_parameter_definition
(Optional[List[TestCaseParameterDefinition]], optional): parameters for the test case definition. Defaults to None.
Returns:
TestDefinition
: a test definition object
method get_or_create_test_suite
Get or create a TestSuite
Args:
test_suite_name
(str): test suite nametest_suite_description
(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:
test_case_fqn
(str): test_case_fqnstart_ts
(int): timestampend_ts
(int): timestamp