latent.testing¶
Testing utilities for Latent framework.
Functions¶
assert_input_dataset_exists¶
Assert that an input dataset file exists on filesystem.
Args: flow_name: Name of the flow dataset_name: Name of the dataset
Raises: AssertionError: If dataset doesn't exist
create_test_dataframe¶
Create a test DataFrame with sample data.
Args: rows: Number of rows columns: List of column names (default: ["col1", "col2", "col3"])
Returns: DataFrame with sample data
mock_catalog¶
Mock catalog for testing flows without real data dependencies.
This context manager replaces the catalog loading mechanism with in-memory data, allowing you to test flows without file I/O or actual data files.
Args: datasets: Dictionary mapping dataset names to data objects
Example: >>> with mock_catalog({"raw_data": pd.DataFrame([{"x": 1}])}): ... my_flow() # Runs with mocked data
mock_config¶
Mock configuration for testing flows.
Args: config: Dictionary of configuration parameters
Example: >>> with mock_config({"batch_size": 10}): ... my_flow() # Runs with mocked config