Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Side by Side Diff: appengine/third_party_local/depot_tools/auto_stub.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 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 # that can be found in the LICENSE file.
4 4
5 __version__ = '1.0' 5 __version__ = '1.0'
6 6
7 import collections 7 import collections
8 import inspect 8 import inspect
9 import unittest 9 import unittest
10 10
11 11
12 class AutoStubMixIn(object): 12 class AutoStubMixIn(object):
13 """Automatically restores stubbed functions on unit test teardDown. 13 """Automatically restores stubbed functions on unit test teardDown.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 class TestCase(unittest.TestCase, AutoStubMixIn): 65 class TestCase(unittest.TestCase, AutoStubMixIn):
66 """Adds self.mock() and self.has_failed() to a TestCase.""" 66 """Adds self.mock() and self.has_failed() to a TestCase."""
67 def tearDown(self): 67 def tearDown(self):
68 AutoStubMixIn.tearDown(self) 68 AutoStubMixIn.tearDown(self)
69 unittest.TestCase.tearDown(self) 69 unittest.TestCase.tearDown(self)
70 70
71 def has_failed(self): 71 def has_failed(self):
72 """Returns True if the test has failed.""" 72 """Returns True if the test has failed."""
73 return not self._resultForDoCleanups.wasSuccessful() 73 return not self._resultForDoCleanups.wasSuccessful()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698