"""Tests for RouterContext adapter — TDD: tests before implementation.""" import pytest from i2p_apps.console.context import ConsoleContext class TestConsoleContext: def test_creation(self): ctx = ConsoleContext() assert ctx is not None def test_uptime(self): ctx = ConsoleContext() assert ctx.uptime_seconds >= 0 def test_version(self): ctx = ConsoleContext() assert isinstance(ctx.version, str) assert len(ctx.version) > 0 def test_status(self): ctx = ConsoleContext() status = ctx.status assert "state" in status assert "uptime" in status assert "version" in status def test_network_status(self): ctx = ConsoleContext() net = ctx.network_status assert "active_peers" in net assert "known_routers" in net assert isinstance(net["active_peers"], int) def test_get_property(self): ctx = ConsoleContext() ctx.set_property("test.key", "test_value") assert ctx.get_property("test.key") == "test_value" def test_get_property_default(self): ctx = ConsoleContext() assert ctx.get_property("nonexistent", "default") == "default"