MCPcopy
hub / github.com/tanelpoder/0xtools / TestInitApp

Class TestInitApp

xtop/tests/test_textual_init.py:21–102  ·  view source on GitHub ↗

Test initialization order

Source from the content-addressed store, hash-verified

19logger = logging.getLogger('test_init')
20
21class TestInitApp(App):
22 """Test initialization order"""
23
24 CSS = """
25 #breadcrumb {
26 height: 4;
27 padding: 1;
28 margin: 0 1;
29 border: solid green;
30 background: $boost;
31 color: $text;
32 }
33
34 DataTable {
35 height: 100%;
36 border: solid blue;
37 }
38
39 TabbedContent {
40 height: 100%;
41 }
42 """
43
44 def compose(self) -> ComposeResult:
45 """Create the UI layout"""
46 logger.info("compose() called")
47
48 yield Header()
49 yield Static(
50 "AvgThreads: (initialising)\n"
51 f"{'TimeRange:'.ljust(LABEL_WIDTH)} Detecting...\n"
52 f"{'Window:'.ljust(LABEL_WIDTH)} Pending...\n"
53 f"{'Filters:'.ljust(LABEL_WIDTH)} No filters applied\n"
54 f"{'Path:'.ljust(LABEL_WIDTH)} Loading...",
55 id="breadcrumb",
56 )
57
58 with TabbedContent(id="tabs"):
59 with TabPane("Main", id="tab-0"):
60 yield DataTable(id="table-0")
61
62 yield Footer()
63
64 def on_mount(self) -> None:
65 """Initialize when app is mounted"""
66 logger.info("on_mount() called")
67
68 # Check if widgets exist
69 try:
70 breadcrumb = self.query_one("#breadcrumb", Static)
71 logger.info(f"Found breadcrumb: {breadcrumb}")
72 breadcrumb.update(
73 "AvgThreads: test\n"
74 f"{'TimeRange:'.ljust(LABEL_WIDTH)} Test\n"
75 f"{'Window:'.ljust(LABEL_WIDTH)} Test window\n"
76 f"{'Filters:'.ljust(LABEL_WIDTH)} Test filter\n"
77 f"{'Path:'.ljust(LABEL_WIDTH)} Test path"
78 )

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected