forked from genewildish/Mainline
feat(websocket): add WebSocket display backend for browser client
This commit is contained in:
55
tests/test_app.py
Normal file
55
tests/test_app.py
Normal file
@@ -0,0 +1,55 @@
|
||||
"""
|
||||
Tests for engine.app module.
|
||||
"""
|
||||
|
||||
from engine.app import _normalize_preview_rows
|
||||
|
||||
|
||||
class TestNormalizePreviewRows:
|
||||
"""Tests for _normalize_preview_rows function."""
|
||||
|
||||
def test_empty_rows(self):
|
||||
"""Empty input returns empty list."""
|
||||
result = _normalize_preview_rows([])
|
||||
assert result == [""]
|
||||
|
||||
def test_strips_left_padding(self):
|
||||
"""Left padding is stripped."""
|
||||
result = _normalize_preview_rows([" content", " more"])
|
||||
assert all(not r.startswith(" ") for r in result)
|
||||
|
||||
def test_preserves_content(self):
|
||||
"""Content is preserved."""
|
||||
result = _normalize_preview_rows([" hello world "])
|
||||
assert "hello world" in result[0]
|
||||
|
||||
def test_handles_all_empty_rows(self):
|
||||
"""All empty rows returns single empty string."""
|
||||
result = _normalize_preview_rows(["", " ", ""])
|
||||
assert result == [""]
|
||||
|
||||
|
||||
class TestAppConstants:
|
||||
"""Tests for app module constants."""
|
||||
|
||||
def test_title_defined(self):
|
||||
"""TITLE is defined."""
|
||||
from engine.app import TITLE
|
||||
|
||||
assert len(TITLE) > 0
|
||||
|
||||
def test_title_lines_are_strings(self):
|
||||
"""TITLE contains string lines."""
|
||||
from engine.app import TITLE
|
||||
|
||||
assert all(isinstance(line, str) for line in TITLE)
|
||||
|
||||
|
||||
class TestAppImports:
|
||||
"""Tests for app module imports."""
|
||||
|
||||
def test_app_imports_without_error(self):
|
||||
"""Module imports without error."""
|
||||
from engine import app
|
||||
|
||||
assert app is not None
|
||||
Reference in New Issue
Block a user