- 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>
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
"""Unit tests for account auth operations."""
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from account.bp.auth.services.auth_operations import validate_email
|
|
|
|
|
|
class TestValidateEmail:
|
|
def test_valid_email(self):
|
|
ok, email = validate_email("user@example.com")
|
|
assert ok is True
|
|
assert email == "user@example.com"
|
|
|
|
def test_uppercase_lowered(self):
|
|
ok, email = validate_email("USER@EXAMPLE.COM")
|
|
assert ok is True
|
|
assert email == "user@example.com"
|
|
|
|
def test_whitespace_stripped(self):
|
|
ok, email = validate_email(" user@example.com ")
|
|
assert ok is True
|
|
assert email == "user@example.com"
|
|
|
|
def test_empty_string(self):
|
|
ok, email = validate_email("")
|
|
assert ok is False
|
|
|
|
def test_no_at_sign(self):
|
|
ok, email = validate_email("notanemail")
|
|
assert ok is False
|
|
|
|
def test_just_at(self):
|
|
ok, email = validate_email("@")
|
|
assert ok is True # has "@", passes the basic check
|
|
|
|
def test_spaces_only(self):
|
|
ok, email = validate_email(" ")
|
|
assert ok is False
|