1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><title>unittestgui</title><body bgcolor="#ffffff">
<p><table width="100%" cellspacing=0 cellpadding=0 border=0>
<tr bgcolor="#7799ee"><td colspan=3 valign=bottom><small><small><br></small></small
><font color="#ffffff" face="helvetica, arial"> <br><big><big><strong> unittestgui</strong></big></big> (version: 1.5)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"> </font></td></tr>
</table><p><small><tt><br>
GUI framework and application for use with Python unit testing framework.<br>
Execute tests written using the framework provided by the 'unittest' module.<br>
<br>
Further information is available in the bundled documentation, and from<br>
<br>
http://pyunit.sourceforge.net/<br>
<br>
Copyright (c) 1999, 2000, 2001 Steve Purcell<br>
This module is free software, and you may redistribute it and/or modify<br>
it under the same terms as Python itself, so long as this copyright message<br>
and disclaimer are retained in their original form.<br>
<br>
IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,<br>
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF<br>
THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH<br>
DAMAGE.<br>
<br>
THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT<br>
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A<br>
PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,<br>
AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,<br>
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
</tt></small>
<p><table width="100%" cellspacing=0 cellpadding=0 border=0>
<tr bgcolor="#aa55cc"><td colspan=3 valign=bottom><small><small><br></small></small
><font color="#fffff" face="helvetica, arial"> <big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"> </td><td> </td>
<td><small><small> </small></small
><table width="100%"><tr><td width="25%" valign=top><a href="Tkinter.html">Tkinter</a><br><a href="string.html">string</a><br></td><td width="25%" valign=top><a href="sys.html">sys</a><br><a href="Tkinter.html">Tkinter</a><br></td><td width="25%" valign=top><a href="tkMessageBox.html">tkMessageBox</a><br><a href="traceback.html">traceback</a><br></td><td width="25%" valign=top><a href="unittest.html">unittest</a><br></td></tr></table></td></tr></table>
<p><table width="100%" cellspacing=0 cellpadding=0 border=0>
<tr bgcolor="#ee77aa"><td colspan=3 valign=bottom><small><small><br></small></small
><font color="#ffffff" face="helvetica, arial"> <big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"> </td><td> </td>
<td><small><small> </small></small
><dl>
<dt><font face="helvetica, arial"><small><a href="#BaseGUITestRunner">BaseGUITestRunner</a>
</small></font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><small><a href="#TkTestRunner">TkTestRunner</a>
</small></font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><small><a href="Tkinter.html#Frame">Tkinter.Frame</a>(Tkinter.Widget)
</small></font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><small><a href="#ProgressBar">ProgressBar</a>
</small></font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><small><a href="#RollbackImporter">RollbackImporter</a>
</small></font></dt><dt><font face="helvetica, arial"><small><a href="unittest.html#TestResult">unittest.TestResult</a>
</small></font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><small><a href="#GUITestResult">GUITestResult</a>
</small></font></dt></dl>
</dd>
</dl>
<p><table width="100%" cellspacing=0 cellpadding=0 border=0>
<tr bgcolor="#ffc8d8"><td colspan=3 valign=bottom><small><small><br></small></small
><font color="#000000" face="helvetica, arial"> <a name="BaseGUITestRunner">class <strong>BaseGUITestRunner</strong></a></font></td></tr>
<tr><td bgcolor="#ffc8d8"> </td>
<td bgcolor="#ffc8d8" colspan=2><small><tt>Subclass this class to create a GUI TestRunner that uses a specific<br>
windowing toolkit. The class takes care of running tests in the correct<br>
manner, and making callbacks to the derived class to obtain information<br>
or signal that events have occurred.
<br> </tt></small></td></tr>
<tr><td bgcolor="#ffc8d8"> </td><td> </td>
<td><small><small> </small></small
><dl><dt><a name="BaseGUITestRunner-__init__"
><strong>__init__</strong>(self, *args, **kwargs)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="BaseGUITestRunner-errorDialog"
><strong>errorDialog</strong>(self, title, message)</a>
<dd><small><tt>Override to display an error arising from GUI usage
</tt></small></dl><dl><dt><a name="BaseGUITestRunner-getSelectedTestName"
><strong>getSelectedTestName</strong>(self)</a>
<dd><small><tt>Override to return the name of the test selected to be run
</tt></small></dl><dl><dt><a name="BaseGUITestRunner-notifyRunning"
><strong>notifyRunning</strong>(self)</a>
<dd><small><tt>Override to set GUI in 'running' mode, enabling 'stop' button etc.
</tt></small></dl><dl><dt><a name="BaseGUITestRunner-notifyStopped"
><strong>notifyStopped</strong>(self)</a>
<dd><small><tt>Override to set GUI in 'stopped' mode, enabling 'run' button etc.
</tt></small></dl><dl><dt><a name="BaseGUITestRunner-notifyTestErrored"
><strong>notifyTestErrored</strong>(self, test, err)</a>
<dd><small><tt>Override to indicate that a test has just errored
</tt></small></dl><dl><dt><a name="BaseGUITestRunner-notifyTestFailed"
><strong>notifyTestFailed</strong>(self, test, err)</a>
<dd><small><tt>Override to indicate that a test has just failed
</tt></small></dl><dl><dt><a name="BaseGUITestRunner-notifyTestFinished"
><strong>notifyTestFinished</strong>(self, test)</a>
<dd><small><tt>Override to indicate that a test has finished (it may already have</tt></small
><dd><small><tt>failed or errored)
</tt></small></dl><dl><dt><a name="BaseGUITestRunner-notifyTestStarted"
><strong>notifyTestStarted</strong>(self, test)</a>
<dd><small><tt>Override to indicate that a test is about to run
</tt></small></dl><dl><dt><a name="BaseGUITestRunner-runClicked"
><strong>runClicked</strong>(self)</a>
<dd><small><tt>To be called in response to user choosing to run a test
</tt></small></dl><dl><dt><a name="BaseGUITestRunner-stopClicked"
><strong>stopClicked</strong>(self)</a>
<dd><small><tt>To be called in response to user stopping the running of a test
</tt></small></dl></td></tr></table>
<p><table width="100%" cellspacing=0 cellpadding=0 border=0>
<tr bgcolor="#ffc8d8"><td colspan=3 valign=bottom><small><small><br></small></small
><font color="#000000" face="helvetica, arial"> <a name="GUITestResult">class <strong>GUITestResult</strong></a>(<a href="unittest.html#TestResult">unittest.TestResult</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"> </td>
<td bgcolor="#ffc8d8" colspan=2><small><tt>A <a href="unittest.html#TestResult">TestResult</a> that makes callbacks to its associated GUI TestRunner.<br>
Used by <a href="#BaseGUITestRunner">BaseGUITestRunner</a>. Need not be created directly.
<br> </tt></small></td></tr>
<tr><td bgcolor="#ffc8d8"> </td><td> </td>
<td><small><small> </small></small
><dl><dt><a name="GUITestResult-__init__"
><strong>__init__</strong>(self, callback)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="GUITestResult-addError"
><strong>addError</strong>(self, test, err)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="GUITestResult-addFailure"
><strong>addFailure</strong>(self, test, err)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="GUITestResult-startTest"
><strong>startTest</strong>(self, test)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="GUITestResult-stopTest"
><strong>stopTest</strong>(self, test)</a>
<dd><small><em>no doc string</em></small></dl></td></tr></table>
<p><table width="100%" cellspacing=0 cellpadding=0 border=0>
<tr bgcolor="#ffc8d8"><td colspan=3 valign=bottom><small><small><br></small></small
><font color="#000000" face="helvetica, arial"> <a name="ProgressBar">class <strong>ProgressBar</strong></a>(<a href="Tkinter.html#Frame">Tkinter.Frame</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"> </td>
<td bgcolor="#ffc8d8" colspan=2><small><tt>A simple progress bar that shows a percentage progress in<br>
the given colour.
<br> </tt></small></td></tr>
<tr><td bgcolor="#ffc8d8"> </td><td> </td>
<td><small><small> </small></small
><dl><dt><a name="ProgressBar-__init__"
><strong>__init__</strong>(self, *args, **kwargs)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="ProgressBar-paint"
><strong>paint</strong>(self, *args)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="ProgressBar-setProgressFraction"
><strong>setProgressFraction</strong>(self, fraction, color<small><font color="#a0a0a0">='blue'</font></small>)</a>
<dd><small><em>no doc string</em></small></dl></td></tr></table>
<p><table width="100%" cellspacing=0 cellpadding=0 border=0>
<tr bgcolor="#ffc8d8"><td colspan=3 valign=bottom><small><small><br></small></small
><font color="#000000" face="helvetica, arial"> <a name="RollbackImporter">class <strong>RollbackImporter</strong></a></font></td></tr>
<tr><td bgcolor="#ffc8d8"> </td>
<td bgcolor="#ffc8d8" colspan=2><small><tt>This tricky little class is used to make sure that modules under test<br>
will be reloaded the next time they are imported.
<br> </tt></small></td></tr>
<tr><td bgcolor="#ffc8d8"> </td><td> </td>
<td><small><small> </small></small
><dl><dt><a name="RollbackImporter-__init__"
><strong>__init__</strong>(self)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="RollbackImporter-rollbackImports"
><strong>rollbackImports</strong>(self)</a>
<dd><small><em>no doc string</em></small></dl></td></tr></table>
<p><table width="100%" cellspacing=0 cellpadding=0 border=0>
<tr bgcolor="#ffc8d8"><td colspan=3 valign=bottom><small><small><br></small></small
><font color="#000000" face="helvetica, arial"> <a name="TkTestRunner">class <strong>TkTestRunner</strong></a>(<a href="#BaseGUITestRunner">BaseGUITestRunner</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"> </td>
<td bgcolor="#ffc8d8" colspan=2><small><tt>An implementation of <a href="#BaseGUITestRunner">BaseGUITestRunner</a> using Tkinter.
<br> </tt></small></td></tr>
<tr><td bgcolor="#ffc8d8"> </td><td> </td>
<td><small><small> </small></small
><dl><dt><a name="TkTestRunner-createWidgets"
><strong>createWidgets</strong>(self)</a>
<dd><small><tt>Creates and packs the various widgets.</tt></small
><dd><small><tt> </tt></small
><dd><small><tt>Why is it that GUI code always ends up looking a mess, despite all the</tt></small
><dd><small><tt>best intentions to keep it tidy? Answers on a postcard, please.
</tt></small></dl><dl><dt><a name="TkTestRunner-errorDialog"
><strong>errorDialog</strong>(self, title, message)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-getSelectedTestName"
><strong>getSelectedTestName</strong>(self)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-initGUI"
><strong>initGUI</strong>(self, root, initialTestName)</a>
<dd><small><tt>Set up the GUI inside the given root window. The test name entry</tt></small
><dd><small><tt>field will be pre-filled with the given initialTestName.
</tt></small></dl><dl><dt><a name="TkTestRunner-notifyRunning"
><strong>notifyRunning</strong>(self)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-notifyStopped"
><strong>notifyStopped</strong>(self)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-notifyTestErrored"
><strong>notifyTestErrored</strong>(self, test, err)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-notifyTestFailed"
><strong>notifyTestFailed</strong>(self, test, err)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-notifyTestFinished"
><strong>notifyTestFinished</strong>(self, test)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-notifyTestStarted"
><strong>notifyTestStarted</strong>(self, test)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-showAboutDialog"
><strong>showAboutDialog</strong>(self)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-showHelpDialog"
><strong>showHelpDialog</strong>(self)</a>
<dd><small><em>no doc string</em></small></dl><dl><dt><a name="TkTestRunner-showSelectedError"
><strong>showSelectedError</strong>(self)</a>
<dd><small><em>no doc string</em></small></dl></td></tr></table></td></tr></table></body></html>
|