INNER CODE UNIT · Python

_write_kt_file_tests

Kotlin/kandy · util/kandy-samples-utils/nb_to_doc.py:557

def _write_kt_file_tests(file, cells: List[Tuple[NotebookNode, Optional[str], Optional[str]]], base_name: str) -> None:
    """
    Write test methods to the Kotlin file.

    Args:
        file: File object to write to
        cells: List of tuples containing (cell, output_type, output_content)
        base_name: Base name for function names
    """
    test_index = 1
    for cell, output_type, _ in cells:
        if cell.cell_type == "code":
            cell_code = cell.source
            if cell_code.strip():
                function_name = f"{base_name}_{test_index}"
                save_method = _get_save_method(output_type)

                _write_line(file, "", indent=4)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…