Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 | |
| 6 class SharedUserStoryState(object): | |
| 7 """A class styled on unittest.TestCase for handling test setup & teardown. | |
|
chrishenry
2014/11/20 19:01:24
The fact that the class (or methods below) are sty
nednguyen
2014/11/20 21:08:27
Done.
| |
| 8 | |
| 9 Args: | |
| 10 platform: an instance of telemetry.platform.Platform. | |
| 11 options: | |
|
chrishenry
2014/11/20 19:01:24
Missing doc?
Shouldn't this be under __init__ pyd
nednguyen
2014/11/20 21:08:27
Done.
| |
| 12 """ | |
| 13 | |
| 14 def __init__(self, test, options, user_story_set): | |
| 15 """ This method is styled on unittest.TestCase.setUpClass. | |
| 16 Override to do any action before running user stories that | |
| 17 share this same state. | |
| 18 """ | |
| 19 pass | |
| 20 | |
| 21 @property | |
| 22 def platform(self): | |
| 23 """ Override to return the platform which user stories that share this same | |
| 24 state will be run on. | |
| 25 """ | |
| 26 raise NotImplementedError() | |
| 27 | |
| 28 def WillRunUserStory(self, user_story): | |
|
chrishenry
2014/11/20 19:01:24
nit: Let's have WillRun/Run/DidRun next to each ot
nednguyen
2014/11/20 21:08:27
Done.
| |
| 29 """ This method is styled on unittest.TestCase.setUp. | |
| 30 Override to do any action before running each one of all user stories that | |
| 31 share this same state. """ | |
| 32 raise NotImplementedError() | |
| 33 | |
| 34 def GetTestExpectationAndSkipValue(self, expectations): | |
| 35 """ Return test expectation and skip value instance in case expectation | |
| 36 is 'skip'. This is run after WillRunUserStory and before RunUserStory. | |
| 37 """ | |
| 38 raise NotImplementedError() | |
| 39 | |
| 40 def RunUserStory(self, results): | |
| 41 """ This method is styled on unittest.TestCase.run. | |
| 42 Override to do any action before running each one of all user stories that | |
| 43 share this same state. """ | |
| 44 raise NotImplementedError() | |
| 45 | |
| 46 def DidRunUserStory(self, results): | |
| 47 """ This method is styled on unittest.TestCase.tearDown. | |
| 48 Override to do any action after running each of all user stories that | |
| 49 share this same state. | |
| 50 """ | |
| 51 raise NotImplementedError() | |
| 52 | |
| 53 def TearDown(self, results): | |
| 54 """ This method is styled on unittest.TestCase.tearDownClass. | |
|
chrishenry
2014/11/20 19:01:24
The naming of TearDown for something that means Te
nednguyen
2014/11/20 21:08:27
Done.
| |
| 55 Override to do any action after running multiple user stories that | |
| 56 share this same state. """ | |
| 57 raise NotImplementedError() | |
| OLD | NEW |