What problem does it solve?
Ensuring the reliability and quality of complex applications requires a robust testing strategy. This Skill provides a comprehensive guide to Kailash SDK's 3-tier testing approach (Unit, Integration, E2E), emphasizing test organization and the critical "NO MOCKING" policy for integration tests, guaranteeing production-ready code.
Core Features & Use Cases
- 3-Tier Testing: Learn to implement unit tests for individual components, integration tests with real infrastructure, and end-to-end tests for full user journeys.
- Test Organization: Best practices for structuring your test suite for maintainability and efficiency.
- NO MOCKING Policy: Understand why and how to avoid mocks in integration tests to catch real-world issues.
- Use Case: You're developing a critical workflow and need to ensure its reliability. This Skill guides you through setting up unit tests for each node, integration tests with a real database, and end-to-end tests simulating a complete user interaction.
Quick Start
Example: Unit Test
import pytest
from kailash.nodes.code import PythonCodeNode
def test_python_code_node_execution():
node = PythonCodeNode("test_node", {"code": "result = input_value * 2"})
result = node.execute({"input_value": 10})
assert result["result"]["value"] == 20