- Run tests for all 10 services via per-service pytest subprocesses - Group results by service with section headers - Clickable summary cards filter by outcome (passed/failed/errors/skipped) - Service filter nav using ~nav-link buttons in menu bar - Full menu integration: ~header-row + ~header-child + ~menu-row - Show logo image via cart-mini rendering - Mount full service directories in docker-compose for test access - Add 24 unit test files across 9 services Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
"""Unit tests for events slugify utility."""
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from events.bp.calendars.services.calendars import slugify
|
|
|
|
|
|
class TestSlugify:
|
|
def test_basic(self):
|
|
assert slugify("My Calendar") == "my-calendar"
|
|
|
|
def test_unicode(self):
|
|
assert slugify("café résumé") == "cafe-resume"
|
|
|
|
def test_slashes(self):
|
|
assert slugify("foo/bar") == "foo-bar"
|
|
|
|
def test_special_chars(self):
|
|
assert slugify("hello!!world") == "hello-world"
|
|
|
|
def test_collapse_dashes(self):
|
|
assert slugify("a---b") == "a-b"
|
|
|
|
def test_strip_dashes(self):
|
|
assert slugify("--hello--") == "hello"
|
|
|
|
def test_empty_fallback(self):
|
|
assert slugify("") == "calendar"
|
|
|
|
def test_none_fallback(self):
|
|
assert slugify(None) == "calendar"
|
|
|
|
def test_max_len(self):
|
|
result = slugify("a" * 300, max_len=10)
|
|
assert len(result) <= 10
|
|
|
|
def test_numbers(self):
|
|
assert slugify("event-2025") == "event-2025"
|
|
|
|
def test_already_clean(self):
|
|
assert slugify("my-event") == "my-event"
|