Files
nanobot/tests/test_media_tracking.py
code-server 31a889f9fd Snapshot: All native Anthropic tools implemented
Complete implementation of all three native Anthropic tools:
- bash_20250124: Shell command execution
- text_editor_20250124: File editing operations
- computer_20251124: VNC desktop control (all 17 actions)

Includes provider updates, test improvements, and registry changes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-28 23:43:15 +00:00

26 lines
773 B
Python

"""Tests for screenshot media tracking."""
import pytest
import base64
from pathlib import Path
from unittest.mock import AsyncMock, MagicMock
from nanobot.agent.loop import AgentLoop
from nanobot.agent.tools.anthropic.base import ToolResult
@pytest.mark.asyncio
async def test_media_tracking_saves_screenshots():
"""Test that screenshots are saved to disk and tracked."""
# This is more of an integration test
# Test the media saving logic separately
# Create fake screenshot data
fake_png = b"\x89PNG\r\n\x1a\n" # PNG header
base64_image = base64.b64encode(fake_png).decode()
result = ToolResult(base64_image=base64_image)
# Verify we can decode it
decoded = base64.b64decode(result.base64_image)
assert decoded == fake_png