This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Timmy-time-dashboard/tests/timmy/test_introspection.py
Alexander Whitestone 89cfe1be0d fix: Docker-first test suite, UX improvements, and bug fixes (#100)
Dashboard UX:
- Restructure nav from 22 flat links to 6 core + MORE dropdown
- Add mobile nav section labels (Core, Intelligence, Agents, System, Commerce)
- Defer marked.js and dompurify.js loading, consolidate CDN to jsdelivr
- Optimize font weights (drop unused 300/500), bump style.css cache buster
- Remove duplicate HTMX load triggers from sidebar and health panels

Bug fixes:
- Fix Timmy showing OFFLINE by registering after swarm recovery sweep
- Fix ThinkingEngine await bug with asyncio.run_coroutine_threadsafe
- Fix chat auto-scroll by calling scrollChat() after history partial loads
- Add missing /voice/button page and /voice/command endpoint
- Fix Grok api_key="" treated as falsy falling through to env key
- Fix self_modify PROJECT_ROOT using settings.repo_root instead of __file__

Docker test infrastructure:
- Bind-mount hands/, docker/, Dockerfiles, and compose files into test container
- Add fontconfig + fonts-dejavu-core for creative/assembler TextClip tests
- Initialize minimal git repo in Dockerfile.test for GitSafety compatibility
- Fix introspection and path resolution tests for Docker /app context

All 1863 tests pass in Docker (0 failures, 77 skipped).

Co-authored-by: Alexander Payne <apayne@MM.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:14:37 -05:00

64 lines
1.7 KiB
Python

"""Tests for system introspection tools."""
import pytest
def test_get_system_info_returns_dict():
"""System info should return a dictionary."""
from timmy.tools_intro import get_system_info
info = get_system_info()
assert isinstance(info, dict)
assert "python_version" in info
assert "platform" in info
assert "model" in info
assert "repo_root" in info
def test_get_system_info_contains_model():
"""System info should include model name."""
from timmy.tools_intro import get_system_info
from config import settings
info = get_system_info()
assert "model" in info
# Model should come from settings
assert info["model"] == settings.ollama_model
def test_get_system_info_contains_repo_root():
"""System info should include repo_root."""
from timmy.tools_intro import get_system_info
from config import settings
info = get_system_info()
assert "repo_root" in info
assert info["repo_root"] == settings.repo_root
# In Docker the CWD is /app, so just verify it's a non-empty path
assert len(info["repo_root"]) > 0
def test_check_ollama_health_returns_dict():
"""Ollama health check should return a dictionary."""
from timmy.tools_intro import check_ollama_health
result = check_ollama_health()
assert isinstance(result, dict)
assert "accessible" in result
assert "model" in result
def test_get_memory_status_returns_dict():
"""Memory status should return a dictionary with tier info."""
from timmy.tools_intro import get_memory_status
status = get_memory_status()
assert isinstance(status, dict)
assert "tier1_hot_memory" in status
assert "tier2_vault" in status