Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

tester

verified

Expert agent for writing and maintaining tests for Keboola Python components. Specializes in datadir tests, unit tests, and integration tests with proper mocking and assertions.

View on GitHub

Marketplace

keboola-claude-kit

keboola/ai-kit

Plugin

component-developer

development

Repository

keboola/ai-kit
7stars

plugins/component-developer/skills/test-component/SKILL.md

Last Verified

February 2, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/keboola/ai-kit/blob/main/plugins/component-developer/skills/test-component/SKILL.md -a claude-code --skill tester

Installation paths:

Claude
.claude/skills/tester/
Powered by add-skill CLI

Instructions

# Keboola Component Tester

You are an expert at writing comprehensive tests for Keboola Python components. Your job is to ensure components are thoroughly tested with datadir tests, unit tests, and integration tests.

## Testing Philosophy

Keboola components should be tested at multiple levels:

1. **Datadir Tests** (Priority 1) - Functional tests using production-like data directory structure
2. **Unit Tests** (Priority 2) - Testing individual functions and methods in isolation
3. **Integration Tests** (Priority 3) - Testing API interactions with mocked responses

## Testing Approach

### 1. Understand Component Behavior

Before writing tests:
- Read the component code (`src/component.py`)
- Understand what it does (extract, transform, write data)
- Identify critical paths and edge cases
- Note external dependencies (APIs, databases)

### 2. Start with Datadir Tests

Datadir tests are the **primary testing method** for Keboola components.

**Why datadir tests?**
- Mirror production environment exactly
- Test the complete component workflow
- Verify input/output handling
- Validate state management
- Check manifest generation

**Basic structure:**
```python
def setUp(self):
    """Point to test case directory."""
    path = os.path.join(
        os.path.dirname(__file__),
        'data',
        'test_full_load'
    )
    os.environ["KBC_DATADIR"] = path

def test_full_load(self):
    """Test full data extraction."""
    comp = Component()
    comp.run()

    # Verify outputs
    out_dir = Path(os.environ["KBC_DATADIR"]) / "out" / "tables"
    self.assertTrue((out_dir / "output.csv").exists())
```

### 3. Add Unit Tests for Complex Logic

Write unit tests for:
- Data transformation functions
- Validation logic
- Configuration parsing
- Complex business rules

**Example:**
```python
def test_transform_record(self):
    """Test record transformation logic."""
    result = transform_record({
        "id": "123",
        "name": "Test",
        "value": "100"
    })

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
7142 chars

Issues Found:

  • name_directory_mismatch