Test dashboard: full menu system, all-service tests, filtering
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m11s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m11s
- 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>
This commit is contained in:
50
blog/tests/test_slugify.py
Normal file
50
blog/tests/test_slugify.py
Normal file
@@ -0,0 +1,50 @@
|
||||
"""Unit tests for blog slugify utility."""
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from blog.bp.post.services.markets import slugify
|
||||
|
||||
|
||||
class TestSlugify:
|
||||
def test_basic_ascii(self):
|
||||
assert slugify("Hello World") == "hello-world"
|
||||
|
||||
def test_unicode_stripped(self):
|
||||
assert slugify("café") == "cafe"
|
||||
|
||||
def test_slashes_to_dashes(self):
|
||||
assert slugify("foo/bar") == "foo-bar"
|
||||
|
||||
def test_special_chars(self):
|
||||
assert slugify("foo!!bar") == "foo-bar"
|
||||
|
||||
def test_multiple_dashes_collapsed(self):
|
||||
assert slugify("foo---bar") == "foo-bar"
|
||||
|
||||
def test_leading_trailing_dashes_stripped(self):
|
||||
assert slugify("--foo--") == "foo"
|
||||
|
||||
def test_empty_string_fallback(self):
|
||||
assert slugify("") == "market"
|
||||
|
||||
def test_none_fallback(self):
|
||||
assert slugify(None) == "market"
|
||||
|
||||
def test_max_len_truncation(self):
|
||||
result = slugify("a" * 300, max_len=10)
|
||||
assert len(result) <= 10
|
||||
|
||||
def test_truncation_no_trailing_dash(self):
|
||||
# "abcde-fgh" truncated to 5 should not end with dash
|
||||
result = slugify("abcde fgh", max_len=5)
|
||||
assert not result.endswith("-")
|
||||
|
||||
def test_already_clean(self):
|
||||
assert slugify("hello-world") == "hello-world"
|
||||
|
||||
def test_numbers_preserved(self):
|
||||
assert slugify("item-42") == "item-42"
|
||||
|
||||
def test_accented_characters(self):
|
||||
assert slugify("über straße") == "uber-strae"
|
||||
Reference in New Issue
Block a user