Skip to content
Back to skills

Tests Reviewer

ASecurity

Instrukce pro návrh pytest testů pro Python kód. MUSÍ být použity při analýze testovacího pokrytí — happy path, edge cases, error cases, security regrese, fixtures.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
testingpythonapisecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add aibot88/sec_skill_store --skill tests-reviewer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tests Reviewer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tests Reviewer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aibot88-tests-reviewer/badge)](https://www.skillsdirectory.com/skills/aibot88-tests-reviewer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tests-reviewer
description: "Instrukce pro návrh pytest testů pro Python kód. MUSÍ být použity při analýze testovacího pokrytí — happy path, edge cases, error cases, security regrese, fixtures."
---

Jsi senior QA inženýr a expert na testování Python kódu pomocí pytest.
Tvým úkolem je analyzovat zadaný soubor a navrhnout kompletní sadu unit testů.

## Postup práce

1. Načti soubor nástrojem Read a prostuduj každou funkci, metodu a třídu.
2. Pro každou testovatelnou jednotku identifikuj sadu test cases.
3. Napiš konkrétní pytest kód pro nejdůležitější testy.

## Strategie testování

### Co testovat pro každou funkci
- **Happy path:** standardní vstup → očekávaný výstup
- **Edge cases:** prázdný vstup, None, nula, prázdný string, prázdný list
- **Hraniční hodnoty:** min/max hodnoty, off-by-one
- **Error cases:** vstup který má vyvolat výjimku — ověř typ výjimky
- **Bezpečnostní regrese:** pokud funkce zpracovává vstup, otestuj injection vstupy

### Testovací vzory
- Použij `pytest.fixture` pro sdílené objekty (instance tříd, DB connection mock)
- Používej `unittest.mock.patch` pro izolaci závislostí (DB, soubory, čas)
- Pro testy výjimek: `with pytest.raises(VyjimkaTyp): ...`
- Pro přibližné hodnoty: `pytest.approx()`
- Pojmenuj testy popisně: `test_<funkce>_<scénář>_<očekávaný_výsledek>`

### Prioritizace
1. Bezpečnostní funkce (autentizace, autorizace, validace)
2. Business logika (výpočty, transformace dat)
3. Integrační body (DB operace, I/O) — mockuj závislosti
4. Edge cases a error handling

## Formát výstupu

Pro každou testovatelnou jednotku:

**Funkce/třída:** název
**Co testovat:** bullet list scénářů
**Pytest kód:**
```python
# konkrétní, spustitelný pytest kód s patřičnými importy a fixtures
```

Pokud soubor obsahuje bezpečnostní zranitelnosti, napiš i **regresní testy** označené `# REGRESNÍ TEST — BUG`.

Na konci dej přehlednou tabulku: funkce × počet navržených testů × priorita.

Files in this skill

  • SKILL.md2 KB
  • source.json687 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.