updates
This commit is contained in:
42
test_tui_minimal.py
Normal file
42
test_tui_minimal.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""Minimal TUI test to verify DataTable rendering."""
|
||||
|
||||
import asyncio
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Add src to path
|
||||
sys.path.insert(0, str(Path(__file__).parent / "src"))
|
||||
|
||||
from textual.app import App
|
||||
from textual.widgets import Header, Footer, DataTable
|
||||
from textual.containers import Container
|
||||
|
||||
|
||||
class TestApp(App):
|
||||
"""Minimal test app to verify DataTable works."""
|
||||
|
||||
def compose(self):
|
||||
"""Create layout."""
|
||||
yield Header()
|
||||
yield DataTable()
|
||||
yield Footer()
|
||||
|
||||
def on_mount(self) -> None:
|
||||
"""Add test data when mounted."""
|
||||
table = self.query_one(DataTable)
|
||||
table.add_column("User", width=20)
|
||||
table.add_column("Plays", width=12)
|
||||
table.add_column("Duration", width=15)
|
||||
table.add_column("Items", width=13)
|
||||
|
||||
# Add test rows (same data from our test)
|
||||
table.add_row("HRiggs", "346", "3h 9m", "153")
|
||||
table.add_row("TV", "204", "5d 1h 16m", "115")
|
||||
table.add_row("Katenoel", "111", "3d 11h 13m", "69")
|
||||
|
||||
self.notify(f"Added {table.row_count} rows to table")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = TestApp()
|
||||
app.run()
|
||||
Reference in New Issue
Block a user