src/eric7/Documentation/Source/eric7.Testing.TestResultsTree.html

branch
eric7
changeset 9209
b99e7fd55fd3
parent 9097
213951c41dcd
child 10407
03b41b9bb392
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.Testing.TestResultsTree</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.Testing.TestResultsTree</h1>
10
11 <p>
12 Module implementing a tree view and associated model to show the test result
13 data.
14 </p>
15 <h3>Global Attributes</h3>
16
17 <table>
18 <tr><td>TopLevelId</td></tr>
19 </table>
20 <h3>Classes</h3>
21
22 <table>
23
24 <tr>
25 <td><a href="#TestResultsModel">TestResultsModel</a></td>
26 <td>Class implementing the item model containing the test data.</td>
27 </tr>
28 <tr>
29 <td><a href="#TestResultsTreeView">TestResultsTreeView</a></td>
30 <td>Class implementing a tree view to show the test result data.</td>
31 </tr>
32 </table>
33 <h3>Functions</h3>
34
35 <table>
36 <tr><td>None</td></tr>
37 </table>
38 <hr />
39 <hr />
40 <a NAME="TestResultsModel" ID="TestResultsModel"></a>
41 <h2>TestResultsModel</h2>
42
43 <p>
44 Class implementing the item model containing the test data.
45 </p>
46 <h3>Signals</h3>
47 <dl>
48
49 <dt>summary(str)</dt>
50 <dd>
51 emitted whenever the model data changes. The element
52 is a summary of the test results of the model.
53 </dd>
54 </dl>
55 <h3>Derived from</h3>
56 QAbstractItemModel
57 <h3>Class Attributes</h3>
58
59 <table>
60 <tr><td>DurationColumn</td></tr><tr><td>Headers</td></tr><tr><td>MessageColumn</td></tr><tr><td>NameColumn</td></tr><tr><td>StatusColumn</td></tr>
61 </table>
62 <h3>Class Methods</h3>
63
64 <table>
65 <tr><td>None</td></tr>
66 </table>
67 <h3>Methods</h3>
68
69 <table>
70
71 <tr>
72 <td><a href="#TestResultsModel.__init__">TestResultsModel</a></td>
73 <td>Constructor</td>
74 </tr>
75 <tr>
76 <td><a href="#TestResultsModel.__summary">__summary</a></td>
77 <td>Private method to generate a test results summary text.</td>
78 </tr>
79 <tr>
80 <td><a href="#TestResultsModel.addTestResults">addTestResults</a></td>
81 <td>Public method to add test results to the ones already managed by the model.</td>
82 </tr>
83 <tr>
84 <td><a href="#TestResultsModel.clear">clear</a></td>
85 <td>Public method to clear the model data.</td>
86 </tr>
87 <tr>
88 <td><a href="#TestResultsModel.columnCount">columnCount</a></td>
89 <td>Public method to get the number of columns.</td>
90 </tr>
91 <tr>
92 <td><a href="#TestResultsModel.data">data</a></td>
93 <td>Public method to get the data for the various columns and roles.</td>
94 </tr>
95 <tr>
96 <td><a href="#TestResultsModel.durationKey">durationKey</a></td>
97 <td>Function to generate a key for duration sorting</td>
98 </tr>
99 <tr>
100 <td><a href="#TestResultsModel.getFailedTests">getFailedTests</a></td>
101 <td>Public method to extract the test ids of all failed tests.</td>
102 </tr>
103 <tr>
104 <td><a href="#TestResultsModel.getTestResults">getTestResults</a></td>
105 <td>Public method to get the list of test results managed by the model.</td>
106 </tr>
107 <tr>
108 <td><a href="#TestResultsModel.headerData">headerData</a></td>
109 <td>Public method to get the header string for the various sections.</td>
110 </tr>
111 <tr>
112 <td><a href="#TestResultsModel.index">index</a></td>
113 <td>Public method to generate an index for the given row and column to identify the item.</td>
114 </tr>
115 <tr>
116 <td><a href="#TestResultsModel.parent">parent</a></td>
117 <td>Public method to get the parent of the item pointed to by index.</td>
118 </tr>
119 <tr>
120 <td><a href="#TestResultsModel.rowCount">rowCount</a></td>
121 <td>Public method to get the number of row for a given parent index.</td>
122 </tr>
123 <tr>
124 <td><a href="#TestResultsModel.setTestResults">setTestResults</a></td>
125 <td>Public method to set the list of test results of the model.</td>
126 </tr>
127 <tr>
128 <td><a href="#TestResultsModel.sort">sort</a></td>
129 <td>Public method to sort the model data by column in order.</td>
130 </tr>
131 <tr>
132 <td><a href="#TestResultsModel.updateTestResults">updateTestResults</a></td>
133 <td>Public method to update the data of managed test result items.</td>
134 </tr>
135 </table>
136 <h3>Static Methods</h3>
137
138 <table>
139 <tr><td>None</td></tr>
140 </table>
141
142 <a NAME="TestResultsModel.__init__" ID="TestResultsModel.__init__"></a>
143 <h4>TestResultsModel (Constructor)</h4>
144 <b>TestResultsModel</b>(<i>parent=None</i>)
145
146 <p>
147 Constructor
148 </p>
149 <dl>
150
151 <dt><i>parent</i> (QObject (optional))</dt>
152 <dd>
153 reference to the parent object (defaults to None)
154 </dd>
155 </dl>
156 <a NAME="TestResultsModel.__summary" ID="TestResultsModel.__summary"></a>
157 <h4>TestResultsModel.__summary</h4>
158 <b>__summary</b>(<i></i>)
159
160 <p>
161 Private method to generate a test results summary text.
162 </p>
163 <dl>
164 <dt>Return:</dt>
165 <dd>
166 test results summary text
167 </dd>
168 </dl>
169 <dl>
170 <dt>Return Type:</dt>
171 <dd>
172 str
173 </dd>
174 </dl>
175 <a NAME="TestResultsModel.addTestResults" ID="TestResultsModel.addTestResults"></a>
176 <h4>TestResultsModel.addTestResults</h4>
177 <b>addTestResults</b>(<i>testResults</i>)
178
179 <p>
180 Public method to add test results to the ones already managed by the
181 model.
182 </p>
183 <dl>
184
185 <dt><i>testResults</i> (list of TestResult)</dt>
186 <dd>
187 test results to be added to the model
188 </dd>
189 </dl>
190 <a NAME="TestResultsModel.clear" ID="TestResultsModel.clear"></a>
191 <h4>TestResultsModel.clear</h4>
192 <b>clear</b>(<i></i>)
193
194 <p>
195 Public method to clear the model data.
196 </p>
197 <a NAME="TestResultsModel.columnCount" ID="TestResultsModel.columnCount"></a>
198 <h4>TestResultsModel.columnCount</h4>
199 <b>columnCount</b>(<i>parent=QModelIndex()</i>)
200
201 <p>
202 Public method to get the number of columns.
203 </p>
204 <dl>
205
206 <dt><i>parent</i> (QModelIndex (optional))</dt>
207 <dd>
208 index of the parent item (defaults to QModelIndex())
209 </dd>
210 </dl>
211 <dl>
212 <dt>Return:</dt>
213 <dd>
214 number of columns
215 </dd>
216 </dl>
217 <dl>
218 <dt>Return Type:</dt>
219 <dd>
220 int
221 </dd>
222 </dl>
223 <a NAME="TestResultsModel.data" ID="TestResultsModel.data"></a>
224 <h4>TestResultsModel.data</h4>
225 <b>data</b>(<i>index, role</i>)
226
227 <p>
228 Public method to get the data for the various columns and roles.
229 </p>
230 <dl>
231
232 <dt><i>index</i> (QModelIndex)</dt>
233 <dd>
234 index of the data to be returned
235 </dd>
236 <dt><i>role</i> (Qt.ItemDataRole)</dt>
237 <dd>
238 role designating the data to return
239 </dd>
240 </dl>
241 <dl>
242 <dt>Return:</dt>
243 <dd>
244 requested data item
245 </dd>
246 </dl>
247 <dl>
248 <dt>Return Type:</dt>
249 <dd>
250 Any
251 </dd>
252 </dl>
253 <a NAME="TestResultsModel.durationKey" ID="TestResultsModel.durationKey"></a>
254 <h4>TestResultsModel.durationKey</h4>
255 <b>durationKey</b>(<i></i>)
256
257 <p>
258 Function to generate a key for duration sorting
259 </p>
260 <dl>
261
262 <dt><i>result</i> (TestResult)</dt>
263 <dd>
264 result object
265 </dd>
266 </dl>
267 <dl>
268 <dt>Return:</dt>
269 <dd>
270 sort key
271 </dd>
272 </dl>
273 <dl>
274 <dt>Return Type:</dt>
275 <dd>
276 float
277 </dd>
278 </dl>
279 <a NAME="TestResultsModel.getFailedTests" ID="TestResultsModel.getFailedTests"></a>
280 <h4>TestResultsModel.getFailedTests</h4>
281 <b>getFailedTests</b>(<i></i>)
282
283 <p>
284 Public method to extract the test ids of all failed tests.
285 </p>
286 <dl>
287 <dt>Return:</dt>
288 <dd>
289 test ids of all failed tests
290 </dd>
291 </dl>
292 <dl>
293 <dt>Return Type:</dt>
294 <dd>
295 list of str
296 </dd>
297 </dl>
298 <a NAME="TestResultsModel.getTestResults" ID="TestResultsModel.getTestResults"></a>
299 <h4>TestResultsModel.getTestResults</h4>
300 <b>getTestResults</b>(<i></i>)
301
302 <p>
303 Public method to get the list of test results managed by the model.
304 </p>
305 <dl>
306 <dt>Return:</dt>
307 <dd>
308 list of test results managed by the model
309 </dd>
310 </dl>
311 <dl>
312 <dt>Return Type:</dt>
313 <dd>
314 list of TestResult
315 </dd>
316 </dl>
317 <a NAME="TestResultsModel.headerData" ID="TestResultsModel.headerData"></a>
318 <h4>TestResultsModel.headerData</h4>
319 <b>headerData</b>(<i>section, orientation, role=Qt.ItemDataRole.DisplayRole</i>)
320
321 <p>
322 Public method to get the header string for the various sections.
323 </p>
324 <dl>
325
326 <dt><i>section</i> (int)</dt>
327 <dd>
328 section number
329 </dd>
330 <dt><i>orientation</i> (Qt.Orientation)</dt>
331 <dd>
332 orientation of the header
333 </dd>
334 <dt><i>role</i> (Qt.ItemDataRole (optional))</dt>
335 <dd>
336 data role (defaults to Qt.ItemDataRole.DisplayRole)
337 </dd>
338 </dl>
339 <dl>
340 <dt>Return:</dt>
341 <dd>
342 header string of the section
343 </dd>
344 </dl>
345 <dl>
346 <dt>Return Type:</dt>
347 <dd>
348 str
349 </dd>
350 </dl>
351 <a NAME="TestResultsModel.index" ID="TestResultsModel.index"></a>
352 <h4>TestResultsModel.index</h4>
353 <b>index</b>(<i>row, column, parent=QModelIndex()</i>)
354
355 <p>
356 Public method to generate an index for the given row and column to
357 identify the item.
358 </p>
359 <dl>
360
361 <dt><i>row</i> (int)</dt>
362 <dd>
363 row for the index
364 </dd>
365 <dt><i>column</i> (int)</dt>
366 <dd>
367 column for the index
368 </dd>
369 <dt><i>parent</i> (QModelIndex (optional))</dt>
370 <dd>
371 index of the parent item (defaults to QModelIndex())
372 </dd>
373 </dl>
374 <dl>
375 <dt>Return:</dt>
376 <dd>
377 index for the item
378 </dd>
379 </dl>
380 <dl>
381 <dt>Return Type:</dt>
382 <dd>
383 QModelIndex
384 </dd>
385 </dl>
386 <a NAME="TestResultsModel.parent" ID="TestResultsModel.parent"></a>
387 <h4>TestResultsModel.parent</h4>
388 <b>parent</b>(<i>index</i>)
389
390 <p>
391 Public method to get the parent of the item pointed to by index.
392 </p>
393 <dl>
394
395 <dt><i>index</i> (QModelIndex)</dt>
396 <dd>
397 index of the item
398 </dd>
399 </dl>
400 <dl>
401 <dt>Return:</dt>
402 <dd>
403 index of the parent item
404 </dd>
405 </dl>
406 <dl>
407 <dt>Return Type:</dt>
408 <dd>
409 QModelIndex
410 </dd>
411 </dl>
412 <a NAME="TestResultsModel.rowCount" ID="TestResultsModel.rowCount"></a>
413 <h4>TestResultsModel.rowCount</h4>
414 <b>rowCount</b>(<i>parent=QModelIndex()</i>)
415
416 <p>
417 Public method to get the number of row for a given parent index.
418 </p>
419 <dl>
420
421 <dt><i>parent</i> (QModelIndex (optional))</dt>
422 <dd>
423 index of the parent item (defaults to QModelIndex())
424 </dd>
425 </dl>
426 <dl>
427 <dt>Return:</dt>
428 <dd>
429 number of rows
430 </dd>
431 </dl>
432 <dl>
433 <dt>Return Type:</dt>
434 <dd>
435 int
436 </dd>
437 </dl>
438 <a NAME="TestResultsModel.setTestResults" ID="TestResultsModel.setTestResults"></a>
439 <h4>TestResultsModel.setTestResults</h4>
440 <b>setTestResults</b>(<i>testResults</i>)
441
442 <p>
443 Public method to set the list of test results of the model.
444 </p>
445 <dl>
446
447 <dt><i>testResults</i> (list of TestResult)</dt>
448 <dd>
449 test results to be managed by the model
450 </dd>
451 </dl>
452 <a NAME="TestResultsModel.sort" ID="TestResultsModel.sort"></a>
453 <h4>TestResultsModel.sort</h4>
454 <b>sort</b>(<i>column, order</i>)
455
456 <p>
457 Public method to sort the model data by column in order.
458 </p>
459 <dl>
460
461 <dt><i>column</i> (int)</dt>
462 <dd>
463 sort column number
464 </dd>
465 <dt><i>order</i> (Qt.SortOrder)</dt>
466 <dd>
467 sort order
468 </dd>
469 </dl>
470 <a NAME="TestResultsModel.updateTestResults" ID="TestResultsModel.updateTestResults"></a>
471 <h4>TestResultsModel.updateTestResults</h4>
472 <b>updateTestResults</b>(<i>testResults</i>)
473
474 <p>
475 Public method to update the data of managed test result items.
476 </p>
477 <dl>
478
479 <dt><i>testResults</i> (list of TestResult)</dt>
480 <dd>
481 test results to be updated
482 </dd>
483 </dl>
484 <div align="right"><a href="#top">Up</a></div>
485 <hr />
486 <hr />
487 <a NAME="TestResultsTreeView" ID="TestResultsTreeView"></a>
488 <h2>TestResultsTreeView</h2>
489
490 <p>
491 Class implementing a tree view to show the test result data.
492 </p>
493 <h3>Signals</h3>
494 <dl>
495
496 <dt>goto(str, int)</dt>
497 <dd>
498 emitted to go to the position given by file name
499 and line number
500 </dd>
501 </dl>
502 <h3>Derived from</h3>
503 QTreeView
504 <h3>Class Attributes</h3>
505
506 <table>
507 <tr><td>None</td></tr>
508 </table>
509 <h3>Class Methods</h3>
510
511 <table>
512 <tr><td>None</td></tr>
513 </table>
514 <h3>Methods</h3>
515
516 <table>
517
518 <tr>
519 <td><a href="#TestResultsTreeView.__init__">TestResultsTreeView</a></td>
520 <td>Constructor</td>
521 </tr>
522 <tr>
523 <td><a href="#TestResultsTreeView.__canonicalIndex">__canonicalIndex</a></td>
524 <td>Private method to create the canonical index for a given index.</td>
525 </tr>
526 <tr>
527 <td><a href="#TestResultsTreeView.__createBackgroundContextMenu">__createBackgroundContextMenu</a></td>
528 <td>Private method to create a context menu for the background.</td>
529 </tr>
530 <tr>
531 <td><a href="#TestResultsTreeView.__createContextMenu">__createContextMenu</a></td>
532 <td>Private method to create a context menu for the item pointed to by the given index.</td>
533 </tr>
534 <tr>
535 <td><a href="#TestResultsTreeView.__gotoTestDefinition">__gotoTestDefinition</a></td>
536 <td>Private slot to show the test definition.</td>
537 </tr>
538 <tr>
539 <td><a href="#TestResultsTreeView.__showContextMenu">__showContextMenu</a></td>
540 <td>Private slot to show the context menu.</td>
541 </tr>
542 <tr>
543 <td><a href="#TestResultsTreeView.dataChanged">dataChanged</a></td>
544 <td>Public method called when the model data has changed.</td>
545 </tr>
546 <tr>
547 <td><a href="#TestResultsTreeView.reset">reset</a></td>
548 <td>Public method to reset the internal state of the view.</td>
549 </tr>
550 <tr>
551 <td><a href="#TestResultsTreeView.resizeColumns">resizeColumns</a></td>
552 <td>Public method to resize the columns to their contents.</td>
553 </tr>
554 <tr>
555 <td><a href="#TestResultsTreeView.rowsInserted">rowsInserted</a></td>
556 <td>Public method called when rows are inserted.</td>
557 </tr>
558 <tr>
559 <td><a href="#TestResultsTreeView.spanFirstColumn">spanFirstColumn</a></td>
560 <td>Public method to make the first column span the row for second level items.</td>
561 </tr>
562 </table>
563 <h3>Static Methods</h3>
564
565 <table>
566 <tr><td>None</td></tr>
567 </table>
568
569 <a NAME="TestResultsTreeView.__init__" ID="TestResultsTreeView.__init__"></a>
570 <h4>TestResultsTreeView (Constructor)</h4>
571 <b>TestResultsTreeView</b>(<i>parent=None</i>)
572
573 <p>
574 Constructor
575 </p>
576 <dl>
577
578 <dt><i>parent</i> (QWidget (optional))</dt>
579 <dd>
580 reference to the parent widget (defaults to None)
581 </dd>
582 </dl>
583 <a NAME="TestResultsTreeView.__canonicalIndex" ID="TestResultsTreeView.__canonicalIndex"></a>
584 <h4>TestResultsTreeView.__canonicalIndex</h4>
585 <b>__canonicalIndex</b>(<i>index</i>)
586
587 <p>
588 Private method to create the canonical index for a given index.
589 </p>
590 <p>
591 The canonical index is the index of the first column of the test
592 result entry (i.e. the top-level item). If the index is invalid,
593 None is returned.
594 </p>
595 <dl>
596
597 <dt><i>index</i> (QModelIndex)</dt>
598 <dd>
599 index to determine the canonical index for
600 </dd>
601 </dl>
602 <dl>
603 <dt>Return:</dt>
604 <dd>
605 index of the firt column of the associated top-level item index
606 </dd>
607 </dl>
608 <dl>
609 <dt>Return Type:</dt>
610 <dd>
611 QModelIndex
612 </dd>
613 </dl>
614 <a NAME="TestResultsTreeView.__createBackgroundContextMenu" ID="TestResultsTreeView.__createBackgroundContextMenu"></a>
615 <h4>TestResultsTreeView.__createBackgroundContextMenu</h4>
616 <b>__createBackgroundContextMenu</b>(<i></i>)
617
618 <p>
619 Private method to create a context menu for the background.
620 </p>
621 <dl>
622 <dt>Return:</dt>
623 <dd>
624 created context menu
625 </dd>
626 </dl>
627 <dl>
628 <dt>Return Type:</dt>
629 <dd>
630 QMenu
631 </dd>
632 </dl>
633 <a NAME="TestResultsTreeView.__createContextMenu" ID="TestResultsTreeView.__createContextMenu"></a>
634 <h4>TestResultsTreeView.__createContextMenu</h4>
635 <b>__createContextMenu</b>(<i>index</i>)
636
637 <p>
638 Private method to create a context menu for the item pointed to by the
639 given index.
640 </p>
641 <dl>
642
643 <dt><i>index</i> (QModelIndex)</dt>
644 <dd>
645 index of the item
646 </dd>
647 </dl>
648 <dl>
649 <dt>Return:</dt>
650 <dd>
651 created context menu
652 </dd>
653 </dl>
654 <dl>
655 <dt>Return Type:</dt>
656 <dd>
657 QMenu
658 </dd>
659 </dl>
660 <a NAME="TestResultsTreeView.__gotoTestDefinition" ID="TestResultsTreeView.__gotoTestDefinition"></a>
661 <h4>TestResultsTreeView.__gotoTestDefinition</h4>
662 <b>__gotoTestDefinition</b>(<i>index</i>)
663
664 <p>
665 Private slot to show the test definition.
666 </p>
667 <dl>
668
669 <dt><i>index</i> (QModelIndex)</dt>
670 <dd>
671 index for the double-clicked item
672 </dd>
673 </dl>
674 <a NAME="TestResultsTreeView.__showContextMenu" ID="TestResultsTreeView.__showContextMenu"></a>
675 <h4>TestResultsTreeView.__showContextMenu</h4>
676 <b>__showContextMenu</b>(<i>pos</i>)
677
678 <p>
679 Private slot to show the context menu.
680 </p>
681 <dl>
682
683 <dt><i>pos</i> (QPoint)</dt>
684 <dd>
685 relative position for the context menu
686 </dd>
687 </dl>
688 <a NAME="TestResultsTreeView.dataChanged" ID="TestResultsTreeView.dataChanged"></a>
689 <h4>TestResultsTreeView.dataChanged</h4>
690 <b>dataChanged</b>(<i>topLeft, bottomRight, roles=[]</i>)
691
692 <p>
693 Public method called when the model data has changed.
694 </p>
695 <dl>
696
697 <dt><i>topLeft</i> (QModelIndex)</dt>
698 <dd>
699 index of the top left element
700 </dd>
701 <dt><i>bottomRight</i> (QModelIndex)</dt>
702 <dd>
703 index of the bottom right element
704 </dd>
705 <dt><i>roles</i> (list of Qt.ItemDataRole (optional))</dt>
706 <dd>
707 list of roles changed (defaults to [])
708 </dd>
709 </dl>
710 <a NAME="TestResultsTreeView.reset" ID="TestResultsTreeView.reset"></a>
711 <h4>TestResultsTreeView.reset</h4>
712 <b>reset</b>(<i></i>)
713
714 <p>
715 Public method to reset the internal state of the view.
716 </p>
717 <a NAME="TestResultsTreeView.resizeColumns" ID="TestResultsTreeView.resizeColumns"></a>
718 <h4>TestResultsTreeView.resizeColumns</h4>
719 <b>resizeColumns</b>(<i></i>)
720
721 <p>
722 Public method to resize the columns to their contents.
723 </p>
724 <a NAME="TestResultsTreeView.rowsInserted" ID="TestResultsTreeView.rowsInserted"></a>
725 <h4>TestResultsTreeView.rowsInserted</h4>
726 <b>rowsInserted</b>(<i>parent, startRow, endRow</i>)
727
728 <p>
729 Public method called when rows are inserted.
730 </p>
731 <dl>
732
733 <dt><i>parent</i> (QModelIndex)</dt>
734 <dd>
735 model index of the parent item
736 </dd>
737 <dt><i>startRow</i> (int)</dt>
738 <dd>
739 first row been inserted
740 </dd>
741 <dt><i>endRow</i> (int)</dt>
742 <dd>
743 last row been inserted
744 </dd>
745 </dl>
746 <a NAME="TestResultsTreeView.spanFirstColumn" ID="TestResultsTreeView.spanFirstColumn"></a>
747 <h4>TestResultsTreeView.spanFirstColumn</h4>
748 <b>spanFirstColumn</b>(<i>startRow, endRow</i>)
749
750 <p>
751 Public method to make the first column span the row for second level
752 items.
753 </p>
754 <p>
755 These items contain the test results.
756 </p>
757 <dl>
758
759 <dt><i>startRow</i> (QModelIndex)</dt>
760 <dd>
761 index of the first row to span
762 </dd>
763 <dt><i>endRow</i> (QModelIndex)</dt>
764 <dd>
765 index of the last row (including) to span
766 </dd>
767 </dl>
768 <div align="right"><a href="#top">Up</a></div>
769 <hr />
770 </body></html>

eric ide

mercurial