Process
Process Class Documentation
Overview
The Process class represents a test step or process within the Combidata framework. It is designed to execute a specific function (referred to as given_func) as part of the test step. This function will continue to run until it returns True, indicating the completion of the process.
Attributes
func (function):
- Description: A function that is executed as part of the test step.
- Requirement: This function must return
Trueto indicate the completion of the process. It must also accept an argument of typeCombination. - Example:
def sample_func(combination):
# Your logic here
return True
name (str):
- Description: A unique identifier for the process.
- Requirement: The
namemust be unique across all instances to avoid conflicts. - Example:
process_name = "sample_process"
Usage
To define a test step, instantiate the Process class by providing the necessary attributes:
from combidata import Process
def sample_func(combination):
# Your logic here
return True
process_instance = Process(name="sample_process", given_func=sample_func)
Notes
- Ensure that the
nameattribute is unique to avoid any potential conflicts during execution. - The
given_funcis essential and must always return a boolean value (TrueorFalse). It should returnTrueto indicate the successful completion of the process. - The
given_funcmust accept an argument of typeCombination. This allows you to access and manipulate the combination data within the function.