A Python port of the Invisible Internet Project (I2P)
1"""Tests for dashboard routes — TDD: tests before implementation."""
2
3import pytest
4from i2p_apps.console.app import create_app
5
6
7@pytest.fixture
8def client():
9 app = create_app({"TESTING": True})
10 return app.test_client()
11
12
13class TestDashboard:
14 def test_root_returns_html(self, client):
15 resp = client.get("/")
16 assert resp.status_code == 200
17 assert b"html" in resp.data.lower()
18
19 def test_console_route(self, client):
20 resp = client.get("/console")
21 assert resp.status_code == 200
22 assert b"html" in resp.data.lower()
23
24 def test_dashboard_shows_status(self, client):
25 resp = client.get("/")
26 assert b"I2P" in resp.data
27
28 def test_dashboard_shows_version(self, client):
29 resp = client.get("/")
30 # Should contain version info somewhere
31 assert b"version" in resp.data.lower() or b"Version" in resp.data