1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.unittest.system_stub</title> 4</head><body bgcolor="#f0f0f8"> 5 6<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 7<tr bgcolor="#7799ee"> 8<td valign=bottom> <br> 9<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.unittest.html"><font color="#ffffff">unittest</font></a>.system_stub</strong></big></big></font></td 10><td align=right valign=bottom 11><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/unittest/system_stub.py">telemetry/unittest/system_stub.py</a></font></td></tr></table> 12 <p><tt>Provides stubs for os, sys and subprocess for testing<br> 13 <br> 14This test allows one to test code that itself uses os, sys, and subprocess.</tt></p> 15<p> 16<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 17<tr bgcolor="#aa55cc"> 18<td colspan=3 valign=bottom> <br> 19<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 20 21<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 22<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</a><br> 23</td><td width="25%" valign=top><a href="re.html">re</a><br> 24</td><td width="25%" valign=top><a href="shlex.html">shlex</a><br> 25</td><td width="25%" valign=top><a href="sys.html">sys</a><br> 26</td></tr></table></td></tr></table><p> 27<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 28<tr bgcolor="#ee77aa"> 29<td colspan=3 valign=bottom> <br> 30<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 31 32<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 33<td width="100%"><dl> 34<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 35</font></dt><dd> 36<dl> 37<dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#AdbCommandsModuleStub">AdbCommandsModuleStub</a> 38</font></dt><dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#CloudStorageModuleStub">CloudStorageModuleStub</a> 39</font></dt><dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#OpenFunctionStub">OpenFunctionStub</a> 40</font></dt><dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#OsModuleStub">OsModuleStub</a> 41</font></dt><dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#Override">Override</a> 42</font></dt><dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#PerfControlModuleStub">PerfControlModuleStub</a> 43</font></dt><dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#RawInputFunctionStub">RawInputFunctionStub</a> 44</font></dt><dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#SubprocessModuleStub">SubprocessModuleStub</a> 45</font></dt><dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#SysModuleStub">SysModuleStub</a> 46</font></dt><dt><font face="helvetica, arial"><a href="telemetry.unittest.system_stub.html#ThermalThrottleModuleStub">ThermalThrottleModuleStub</a> 47</font></dt></dl> 48</dd> 49</dl> 50 <p> 51<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 52<tr bgcolor="#ffc8d8"> 53<td colspan=3 valign=bottom> <br> 54<font color="#000000" face="helvetica, arial"><a name="AdbCommandsModuleStub">class <strong>AdbCommandsModuleStub</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 55 56<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 57<td width="100%">Methods defined here:<br> 58<dl><dt><a name="AdbCommandsModuleStub-CleanupLeftoverProcesses"><strong>CleanupLeftoverProcesses</strong></a>(self)</dt></dl> 59 60<dl><dt><a name="AdbCommandsModuleStub-GetAttachedDevices"><strong>GetAttachedDevices</strong></a>(self)</dt></dl> 61 62<dl><dt><a name="AdbCommandsModuleStub-SetupPrebuiltTools"><strong>SetupPrebuiltTools</strong></a>(self, _)</dt></dl> 63 64<dl><dt><a name="AdbCommandsModuleStub-__init__"><strong>__init__</strong></a>(self)</dt></dl> 65 66<hr> 67Static methods defined here:<br> 68<dl><dt><a name="AdbCommandsModuleStub-IsAndroidSupported"><strong>IsAndroidSupported</strong></a>()</dt></dl> 69 70<hr> 71Data descriptors defined here:<br> 72<dl><dt><strong>__dict__</strong></dt> 73<dd><tt>dictionary for instance variables (if defined)</tt></dd> 74</dl> 75<dl><dt><strong>__weakref__</strong></dt> 76<dd><tt>list of weak references to the object (if defined)</tt></dd> 77</dl> 78<hr> 79Data and other attributes defined here:<br> 80<dl><dt><strong>AdbCommandsStub</strong> = <class 'telemetry.unittest.system_stub.AdbCommandsStub'></dl> 81 82</td></tr></table> <p> 83<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 84<tr bgcolor="#ffc8d8"> 85<td colspan=3 valign=bottom> <br> 86<font color="#000000" face="helvetica, arial"><a name="CloudStorageModuleStub">class <strong>CloudStorageModuleStub</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 87 88<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 89<td width="100%">Methods defined here:<br> 90<dl><dt><a name="CloudStorageModuleStub-GetHash"><strong>GetHash</strong></a>(self, file_path)</dt></dl> 91 92<dl><dt><a name="CloudStorageModuleStub-Insert"><strong>Insert</strong></a>(self, bucket, remote_path, local_path)</dt></dl> 93 94<dl><dt><a name="CloudStorageModuleStub-List"><strong>List</strong></a>(self, _)</dt></dl> 95 96<dl><dt><a name="CloudStorageModuleStub-__init__"><strong>__init__</strong></a>(self)</dt></dl> 97 98<hr> 99Data descriptors defined here:<br> 100<dl><dt><strong>__dict__</strong></dt> 101<dd><tt>dictionary for instance variables (if defined)</tt></dd> 102</dl> 103<dl><dt><strong>__weakref__</strong></dt> 104<dd><tt>list of weak references to the object (if defined)</tt></dd> 105</dl> 106<hr> 107Data and other attributes defined here:<br> 108<dl><dt><strong>CloudStorageError</strong> = <class 'telemetry.unittest.system_stub.CloudStorageError'></dl> 109 110<dl><dt><strong>INTERNAL_BUCKET</strong> = None</dl> 111 112<dl><dt><strong>PUBLIC_BUCKET</strong> = None</dl> 113 114</td></tr></table> <p> 115<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 116<tr bgcolor="#ffc8d8"> 117<td colspan=3 valign=bottom> <br> 118<font color="#000000" face="helvetica, arial"><a name="OpenFunctionStub">class <strong>OpenFunctionStub</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 119 120<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 121<td width="100%">Methods defined here:<br> 122<dl><dt><a name="OpenFunctionStub-__call__"><strong>__call__</strong></a>(self, name, *args, **kwargs)</dt></dl> 123 124<dl><dt><a name="OpenFunctionStub-__init__"><strong>__init__</strong></a>(self)</dt></dl> 125 126<hr> 127Data 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<hr> 135Data and other attributes defined here:<br> 136<dl><dt><strong>FileStub</strong> = <class 'telemetry.unittest.system_stub.FileStub'></dl> 137 138</td></tr></table> <p> 139<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 140<tr bgcolor="#ffc8d8"> 141<td colspan=3 valign=bottom> <br> 142<font color="#000000" face="helvetica, arial"><a name="OsModuleStub">class <strong>OsModuleStub</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 143 144<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 145<td width="100%">Methods defined here:<br> 146<dl><dt><a name="OsModuleStub-__init__"><strong>__init__</strong></a>(self, sys_module<font color="#909090">=<module 'sys' (built-in)></font>)</dt></dl> 147 148<dl><dt><a name="OsModuleStub-access"><strong>access</strong></a>(self, path, _)</dt></dl> 149 150<dl><dt><a name="OsModuleStub-getenv"><strong>getenv</strong></a>(self, name)</dt></dl> 151 152<hr> 153Data descriptors defined here:<br> 154<dl><dt><strong>__dict__</strong></dt> 155<dd><tt>dictionary for instance variables (if defined)</tt></dd> 156</dl> 157<dl><dt><strong>__weakref__</strong></dt> 158<dd><tt>list of weak references to the object (if defined)</tt></dd> 159</dl> 160<hr> 161Data and other attributes defined here:<br> 162<dl><dt><strong>OsPathModuleStub</strong> = <class 'telemetry.unittest.system_stub.OsPathModuleStub'></dl> 163 164<dl><dt><strong>X_OK</strong> = 1</dl> 165 166</td></tr></table> <p> 167<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 168<tr bgcolor="#ffc8d8"> 169<td colspan=3 valign=bottom> <br> 170<font color="#000000" face="helvetica, arial"><a name="Override">class <strong>Override</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 171 172<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 173<td width="100%">Methods defined here:<br> 174<dl><dt><a name="Override-Restore"><strong>Restore</strong></a>(self)</dt></dl> 175 176<dl><dt><a name="Override-__del__"><strong>__del__</strong></a>(self)</dt></dl> 177 178<dl><dt><a name="Override-__init__"><strong>__init__</strong></a>(self, base_module, module_list)</dt></dl> 179 180<hr> 181Data descriptors defined here:<br> 182<dl><dt><strong>__dict__</strong></dt> 183<dd><tt>dictionary for instance variables (if defined)</tt></dd> 184</dl> 185<dl><dt><strong>__weakref__</strong></dt> 186<dd><tt>list of weak references to the object (if defined)</tt></dd> 187</dl> 188</td></tr></table> <p> 189<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 190<tr bgcolor="#ffc8d8"> 191<td colspan=3 valign=bottom> <br> 192<font color="#000000" face="helvetica, arial"><a name="PerfControlModuleStub">class <strong>PerfControlModuleStub</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 193 194<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 195<td width="100%">Methods defined here:<br> 196<dl><dt><a name="PerfControlModuleStub-__init__"><strong>__init__</strong></a>(self)</dt></dl> 197 198<hr> 199Data descriptors defined here:<br> 200<dl><dt><strong>__dict__</strong></dt> 201<dd><tt>dictionary for instance variables (if defined)</tt></dd> 202</dl> 203<dl><dt><strong>__weakref__</strong></dt> 204<dd><tt>list of weak references to the object (if defined)</tt></dd> 205</dl> 206<hr> 207Data and other attributes defined here:<br> 208<dl><dt><strong>PerfControlStub</strong> = <class 'telemetry.unittest.system_stub.PerfControlStub'></dl> 209 210</td></tr></table> <p> 211<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 212<tr bgcolor="#ffc8d8"> 213<td colspan=3 valign=bottom> <br> 214<font color="#000000" face="helvetica, arial"><a name="RawInputFunctionStub">class <strong>RawInputFunctionStub</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 215 216<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 217<td width="100%">Methods defined here:<br> 218<dl><dt><a name="RawInputFunctionStub-__call__"><strong>__call__</strong></a>(self, name, *args, **kwargs)</dt></dl> 219 220<dl><dt><a name="RawInputFunctionStub-__init__"><strong>__init__</strong></a>(self)</dt></dl> 221 222<hr> 223Data descriptors defined here:<br> 224<dl><dt><strong>__dict__</strong></dt> 225<dd><tt>dictionary for instance variables (if defined)</tt></dd> 226</dl> 227<dl><dt><strong>__weakref__</strong></dt> 228<dd><tt>list of weak references to the object (if defined)</tt></dd> 229</dl> 230</td></tr></table> <p> 231<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 232<tr bgcolor="#ffc8d8"> 233<td colspan=3 valign=bottom> <br> 234<font color="#000000" face="helvetica, arial"><a name="SubprocessModuleStub">class <strong>SubprocessModuleStub</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 235 236<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 237<td width="100%">Methods defined here:<br> 238<dl><dt><a name="SubprocessModuleStub-__init__"><strong>__init__</strong></a>(self)</dt></dl> 239 240<dl><dt><a name="SubprocessModuleStub-call"><strong>call</strong></a>(self, *args, **kwargs)</dt></dl> 241 242<hr> 243Data descriptors defined here:<br> 244<dl><dt><strong>__dict__</strong></dt> 245<dd><tt>dictionary for instance variables (if defined)</tt></dd> 246</dl> 247<dl><dt><strong>__weakref__</strong></dt> 248<dd><tt>list of weak references to the object (if defined)</tt></dd> 249</dl> 250<hr> 251Data and other attributes defined here:<br> 252<dl><dt><strong>PopenStub</strong> = <class 'telemetry.unittest.system_stub.PopenStub'></dl> 253 254</td></tr></table> <p> 255<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 256<tr bgcolor="#ffc8d8"> 257<td colspan=3 valign=bottom> <br> 258<font color="#000000" face="helvetica, arial"><a name="SysModuleStub">class <strong>SysModuleStub</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 259 260<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 261<td width="100%">Methods defined here:<br> 262<dl><dt><a name="SysModuleStub-__init__"><strong>__init__</strong></a>(self)</dt></dl> 263 264<hr> 265Data descriptors defined here:<br> 266<dl><dt><strong>__dict__</strong></dt> 267<dd><tt>dictionary for instance variables (if defined)</tt></dd> 268</dl> 269<dl><dt><strong>__weakref__</strong></dt> 270<dd><tt>list of weak references to the object (if defined)</tt></dd> 271</dl> 272</td></tr></table> <p> 273<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 274<tr bgcolor="#ffc8d8"> 275<td colspan=3 valign=bottom> <br> 276<font color="#000000" face="helvetica, arial"><a name="ThermalThrottleModuleStub">class <strong>ThermalThrottleModuleStub</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 277 278<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 279<td width="100%">Methods defined here:<br> 280<dl><dt><a name="ThermalThrottleModuleStub-__init__"><strong>__init__</strong></a>(self)</dt></dl> 281 282<hr> 283Data descriptors defined here:<br> 284<dl><dt><strong>__dict__</strong></dt> 285<dd><tt>dictionary for instance variables (if defined)</tt></dd> 286</dl> 287<dl><dt><strong>__weakref__</strong></dt> 288<dd><tt>list of weak references to the object (if defined)</tt></dd> 289</dl> 290<hr> 291Data and other attributes defined here:<br> 292<dl><dt><strong>ThermalThrottleStub</strong> = <class 'telemetry.unittest.system_stub.ThermalThrottleStub'></dl> 293 294</td></tr></table></td></tr></table> 295</body></html>