1 2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3 <html><head><title>Python: module telemetry.testing.simple_mock</title> 4 <meta charset="utf-8"> 5 </head><body bgcolor="#f0f0f8"> 6 7 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 8 <tr bgcolor="#7799ee"> 9 <td valign=bottom> <br> 10 <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.testing.html"><font color="#ffffff">testing</font></a>.simple_mock</strong></big></big></font></td 11 ><td align=right valign=bottom 12 ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/testing/simple_mock.py">telemetry/testing/simple_mock.py</a></font></td></tr></table> 13 <p><tt>A very very simple mock <a href="__builtin__.html#object">object</a> harness.</tt></p> 14 <p> 15 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 16 <tr bgcolor="#ee77aa"> 17 <td colspan=3 valign=bottom> <br> 18 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 19 20 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 21 <td width="100%"><dl> 22 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 23 </font></dt><dd> 24 <dl> 25 <dt><font face="helvetica, arial"><a href="telemetry.testing.simple_mock.html#MockFunctionCall">MockFunctionCall</a> 26 </font></dt><dt><font face="helvetica, arial"><a href="telemetry.testing.simple_mock.html#MockObject">MockObject</a> 27 </font></dt><dt><font face="helvetica, arial"><a href="telemetry.testing.simple_mock.html#MockTimer">MockTimer</a> 28 </font></dt><dt><font face="helvetica, arial"><a href="telemetry.testing.simple_mock.html#MockTrace">MockTrace</a> 29 </font></dt></dl> 30 </dd> 31 </dl> 32 <p> 33 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 34 <tr bgcolor="#ffc8d8"> 35 <td colspan=3 valign=bottom> <br> 36 <font color="#000000" face="helvetica, arial"><a name="MockFunctionCall">class <strong>MockFunctionCall</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 37 38 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 39 <td width="100%">Methods defined here:<br> 40 <dl><dt><a name="MockFunctionCall-VerifyEquals"><strong>VerifyEquals</strong></a>(self, got)</dt></dl> 41 42 <dl><dt><a name="MockFunctionCall-WhenCalled"><strong>WhenCalled</strong></a>(self, handler)</dt></dl> 43 44 <dl><dt><a name="MockFunctionCall-WillReturn"><strong>WillReturn</strong></a>(self, value)</dt></dl> 45 46 <dl><dt><a name="MockFunctionCall-WithArgs"><strong>WithArgs</strong></a>(self, *args)</dt></dl> 47 48 <dl><dt><a name="MockFunctionCall-__init__"><strong>__init__</strong></a>(self, name)</dt></dl> 49 50 <dl><dt><a name="MockFunctionCall-__repr__"><strong>__repr__</strong></a>(self)</dt></dl> 51 52 <hr> 53 Data descriptors defined here:<br> 54 <dl><dt><strong>__dict__</strong></dt> 55 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 56 </dl> 57 <dl><dt><strong>__weakref__</strong></dt> 58 <dd><tt>list of weak references to the object (if defined)</tt></dd> 59 </dl> 60 </td></tr></table> <p> 61 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 62 <tr bgcolor="#ffc8d8"> 63 <td colspan=3 valign=bottom> <br> 64 <font color="#000000" face="helvetica, arial"><a name="MockObject">class <strong>MockObject</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 65 66 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 67 <td width="100%">Methods defined here:<br> 68 <dl><dt><a name="MockObject-ExpectCall"><strong>ExpectCall</strong></a>(self, func_name, *args)</dt></dl> 69 70 <dl><dt><a name="MockObject-SetAttribute"><strong>SetAttribute</strong></a>(self, name, value)</dt></dl> 71 72 <dl><dt><a name="MockObject-__init__"><strong>__init__</strong></a>(self, parent_mock<font color="#909090">=None</font>)</dt></dl> 73 74 <dl><dt><a name="MockObject-__setattr__"><strong>__setattr__</strong></a>(self, name, value)</dt></dl> 75 76 <hr> 77 Data descriptors defined here:<br> 78 <dl><dt><strong>__dict__</strong></dt> 79 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 80 </dl> 81 <dl><dt><strong>__weakref__</strong></dt> 82 <dd><tt>list of weak references to the object (if defined)</tt></dd> 83 </dl> 84 </td></tr></table> <p> 85 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 86 <tr bgcolor="#ffc8d8"> 87 <td colspan=3 valign=bottom> <br> 88 <font color="#000000" face="helvetica, arial"><a name="MockTimer">class <strong>MockTimer</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 89 90 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 91 <td colspan=2><tt>A mock timer to fake out the timing for a module.<br> 92 Args:<br> 93 module: module to fake out the time<br> </tt></td></tr> 94 <tr><td> </td> 95 <td width="100%">Methods defined here:<br> 96 <dl><dt><a name="MockTimer-Restore"><strong>Restore</strong></a>(self)</dt></dl> 97 98 <dl><dt><a name="MockTimer-SetTime"><strong>SetTime</strong></a>(self, time)</dt></dl> 99 100 <dl><dt><a name="MockTimer-__del__"><strong>__del__</strong></a>(self)</dt></dl> 101 102 <dl><dt><a name="MockTimer-__init__"><strong>__init__</strong></a>(self, module<font color="#909090">=None</font>)</dt></dl> 103 104 <dl><dt><a name="MockTimer-sleep"><strong>sleep</strong></a>(self, time)</dt></dl> 105 106 <dl><dt><a name="MockTimer-time"><strong>time</strong></a>(self)</dt></dl> 107 108 <hr> 109 Data descriptors defined here:<br> 110 <dl><dt><strong>__dict__</strong></dt> 111 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 112 </dl> 113 <dl><dt><strong>__weakref__</strong></dt> 114 <dd><tt>list of weak references to the object (if defined)</tt></dd> 115 </dl> 116 </td></tr></table> <p> 117 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 118 <tr bgcolor="#ffc8d8"> 119 <td colspan=3 valign=bottom> <br> 120 <font color="#000000" face="helvetica, arial"><a name="MockTrace">class <strong>MockTrace</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 121 122 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 123 <td width="100%">Methods defined here:<br> 124 <dl><dt><a name="MockTrace-__init__"><strong>__init__</strong></a>(self)</dt></dl> 125 126 <hr> 127 Data descriptors defined here:<br> 128 <dl><dt><strong>__dict__</strong></dt> 129 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 130 </dl> 131 <dl><dt><strong>__weakref__</strong></dt> 132 <dd><tt>list of weak references to the object (if defined)</tt></dd> 133 </dl> 134 </td></tr></table></td></tr></table><p> 135 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 136 <tr bgcolor="#55aa55"> 137 <td colspan=3 valign=bottom> <br> 138 <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> 139 140 <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> 141 <td width="100%"><strong>DONT_CARE</strong> = ''</td></tr></table> 142 </body></html>