| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import unittest | 5 import unittest |
| 6 | 6 |
| 7 from telemetry.results import user_story_run | 7 from telemetry.results import user_story_run |
| 8 from telemetry.story import shared_state |
| 8 from telemetry import user_story as user_story_module | 9 from telemetry import user_story as user_story_module |
| 9 from telemetry.user_story import shared_user_story_state | |
| 10 from telemetry.user_story import user_story_set | 10 from telemetry.user_story import user_story_set |
| 11 from telemetry.value import failure | 11 from telemetry.value import failure |
| 12 from telemetry.value import scalar | 12 from telemetry.value import scalar |
| 13 from telemetry.value import skip | 13 from telemetry.value import skip |
| 14 | 14 |
| 15 | 15 |
| 16 # pylint: disable=abstract-method | 16 # pylint: disable=abstract-method |
| 17 class SharedUserStoryStateBar(shared_user_story_state.SharedUserStoryState): | 17 class SharedStateBar(shared_state.SharedState): |
| 18 pass | 18 pass |
| 19 | 19 |
| 20 class UserStoryFoo(user_story_module.UserStory): | 20 class UserStoryFoo(user_story_module.UserStory): |
| 21 def __init__(self, name='', labels=None): | 21 def __init__(self, name='', labels=None): |
| 22 super(UserStoryFoo, self).__init__( | 22 super(UserStoryFoo, self).__init__( |
| 23 SharedUserStoryStateBar, name, labels) | 23 SharedStateBar, name, labels) |
| 24 | 24 |
| 25 class UserStoryRunTest(unittest.TestCase): | 25 class UserStoryRunTest(unittest.TestCase): |
| 26 def setUp(self): | 26 def setUp(self): |
| 27 self.user_story_set = user_story_set.UserStorySet() | 27 self.user_story_set = user_story_set.UserStorySet() |
| 28 self.user_story_set.AddUserStory(UserStoryFoo()) | 28 self.user_story_set.AddUserStory(UserStoryFoo()) |
| 29 | 29 |
| 30 @property | 30 @property |
| 31 def user_stories(self): | 31 def user_stories(self): |
| 32 return self.user_story_set.user_stories | 32 return self.user_story_set.user_stories |
| 33 | 33 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 64 run = user_story_run.UserStoryRun(self.user_stories[0]) | 64 run = user_story_run.UserStoryRun(self.user_stories[0]) |
| 65 self.assertTrue(run.ok) | 65 self.assertTrue(run.ok) |
| 66 self.assertFalse(run.failed) | 66 self.assertFalse(run.failed) |
| 67 self.assertFalse(run.skipped) | 67 self.assertFalse(run.skipped) |
| 68 | 68 |
| 69 run = user_story_run.UserStoryRun(self.user_stories[0]) | 69 run = user_story_run.UserStoryRun(self.user_stories[0]) |
| 70 run.AddValue(scalar.ScalarValue(self.user_stories[0], 'a', 's', 1)) | 70 run.AddValue(scalar.ScalarValue(self.user_stories[0], 'a', 's', 1)) |
| 71 self.assertTrue(run.ok) | 71 self.assertTrue(run.ok) |
| 72 self.assertFalse(run.failed) | 72 self.assertFalse(run.failed) |
| 73 self.assertFalse(run.skipped) | 73 self.assertFalse(run.skipped) |
| OLD | NEW |