1 2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3 <html><head><title>Python: module telemetry.story.shared_state</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.story.html"><font color="#ffffff">story</font></a>.shared_state</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/story/shared_state.py">telemetry/story/shared_state.py</a></font></td></tr></table> 13 <p><tt># Copyright 2014 The Chromium Authors. All rights reserved.<br> 14 # Use of this source code is governed by a BSD-style license that can be<br> 15 # found in the LICENSE file.</tt></p> 16 <p> 17 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 18 <tr bgcolor="#ee77aa"> 19 <td colspan=3 valign=bottom> <br> 20 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 21 22 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 23 <td width="100%"><dl> 24 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 25 </font></dt><dd> 26 <dl> 27 <dt><font face="helvetica, arial"><a href="telemetry.story.shared_state.html#SharedState">SharedState</a> 28 </font></dt></dl> 29 </dd> 30 </dl> 31 <p> 32 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 33 <tr bgcolor="#ffc8d8"> 34 <td colspan=3 valign=bottom> <br> 35 <font color="#000000" face="helvetica, arial"><a name="SharedState">class <strong>SharedState</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 36 37 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 38 <td colspan=2><tt>A class that manages the test state across multiple stories.<br> 39 It's styled on unittest.TestCase for handling test setup & teardown logic.<br> </tt></td></tr> 40 <tr><td> </td> 41 <td width="100%">Methods defined here:<br> 42 <dl><dt><a name="SharedState-CanRunStory"><strong>CanRunStory</strong></a>(self, story)</dt><dd><tt>Indicate whether the story can be run in the current configuration.<br> 43 This is called after WillRunStory and before RunStory. Return True<br> 44 if the story should be run, and False if it should be skipped.<br> 45 Most subclasses will probably want to override this to always<br> 46 return True.<br> 47 Args:<br> 48 story: a story.Story instance.</tt></dd></dl> 49 50 <dl><dt><a name="SharedState-DidRunStory"><strong>DidRunStory</strong></a>(self, results)</dt><dd><tt>Override to do any action after running each of all stories that<br> 51 share this same state.<br> 52 This method is styled on unittest.TestCase.tearDown.</tt></dd></dl> 53 54 <dl><dt><a name="SharedState-RunStory"><strong>RunStory</strong></a>(self, results)</dt><dd><tt>Override to do any action before running each one of all stories<br> 55 that share this same state.<br> 56 This method is styled on unittest.TestCase.run.</tt></dd></dl> 57 58 <dl><dt><a name="SharedState-TearDownState"><strong>TearDownState</strong></a>(self)</dt><dd><tt>Override to do any action after running multiple stories that<br> 59 share this same state.<br> 60 This method is styled on unittest.TestCase.tearDownClass.</tt></dd></dl> 61 62 <dl><dt><a name="SharedState-WillRunStory"><strong>WillRunStory</strong></a>(self, story)</dt><dd><tt>Override to do any action before running each one of all stories<br> 63 that share this same state.<br> 64 This method is styled on unittest.TestCase.setUp.</tt></dd></dl> 65 66 <dl><dt><a name="SharedState-__init__"><strong>__init__</strong></a>(self, test, options, story_set)</dt><dd><tt>This method is styled on unittest.TestCase.setUpClass.<br> 67 Override to do any action before running stories that<br> 68 share this same state.<br> 69 Args:<br> 70 test: a page_test.PageTest or story_test.StoryTest instance.<br> 71 options: a BrowserFinderOptions instance that contains command line<br> 72 options.<br> 73 story_set: a story.StorySet instance.</tt></dd></dl> 74 75 <hr> 76 Data descriptors defined here:<br> 77 <dl><dt><strong>__dict__</strong></dt> 78 <dd><tt>dictionary for instance variables (if defined)</tt></dd> 79 </dl> 80 <dl><dt><strong>__weakref__</strong></dt> 81 <dd><tt>list of weak references to the object (if defined)</tt></dd> 82 </dl> 83 <dl><dt><strong>platform</strong></dt> 84 <dd><tt>Override to return the platform which stories that share this same<br> 85 state will be run on.</tt></dd> 86 </dl> 87 </td></tr></table></td></tr></table> 88 </body></html>