ThomasMoreAI/legal-skills-open / br/litigation/skills/juriscan-brunobracaioli
juriscan-brunobracaioli
VerifiedAnálise forense de processos judiciais brasileiros. Extrai, classifica e cruza peças processuais, detecta contradições, calcula prazos CPC e gera relatórios de risco com exportação para Obsidian. Use quando mencionar: processo judicial, petição, sentença, acórdão, contradições, prazos, timeline, análise forense, Obsidian.
tests/test_filenames.py
View on GitHub"""Tests for scripts/utils/filenames.py"""
import sys
import os
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'scripts'))
from utils.filenames import safe_filename, FilenameRegistry
class TestSafeFilename:
def test_simple(self):
assert safe_filename('PETIÇÃO INICIAL') == 'peticao-inicial'
def test_accents_removed(self):
assert safe_filename('CONTESTAÇÃO') == 'contestacao'
assert safe_filename('RÉPLICA') == 'replica'
assert safe_filename('ACÓRDÃO') == 'acordao'
def test_special_chars_removed(self):
assert safe_filename('Art. 14 do CDC') == 'art-14-do-cdc'
def test_disambiguation(self):
a = safe_filename('Art. 1', disambiguation='CC Lei 10.406/2002')
b = safe_filename('Art. 1', disambiguation='CPC Lei 13.105/2015')
assert a != b
assert 'cc' in a
assert 'cpc' in b
def test_max_length(self):
long_label = 'A' * 200
result = safe_filename(long_label, max_length=50)
assert len(result) <= 50
def test_empty_string(self):
assert safe_filename('') == 'unnamed'
def test_only_special_chars(self):
assert safe_filename('§§§°°°') == 'unnamed'
def test_unicode(self):
assert safe_filename('Súmula 479') == 'sumula-479'
def test_no_leading_trailing_hyphens(self):
result = safe_filename(' - SENTENÇA - ')
assert not result.startswith('-')
assert not result.endswith('-')
class TestFilenameRegistry:
def test_no_collision(self):
reg = FilenameRegistry()
assert reg.get('PETIÇÃO INICIAL') == 'peticao-inicial'
assert reg.get('CONTESTAÇÃO') == 'contestacao'
def test_collision_adds_suffix(self):
reg = FilenameRegistry()
assert reg.get('DESPACHO') == 'despacho'
assert reg.get('DESPACHO') == 'despacho-2'
assert reg.get('DESPACHO') == 'despacho-3'
def test_reset(self):
reg = FilenameRegistry()
reg.get('SENTENÇA')
reg.reset()
assert reg.get('SENTENÇA') == 'sentenca' # No suffix after reset
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |