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

Unified Diff: tests/scm_unittest.py

Issue 2425003: Fix both gclient_scm_test.py and scm_unittest.py. (Closed)
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/gclient_scm_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/scm_unittest.py
diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py
index d4270bd1ddbdb12ffa0181dbcd7e48938a6542d7..d2acc04b9e637b99737474a17631c8679a08d2f5 100755
--- a/tests/scm_unittest.py
+++ b/tests/scm_unittest.py
@@ -9,12 +9,22 @@ from shutil import rmtree
import tempfile
# Fixes include path.
-from super_mox import mox, SuperMoxBaseTestBase
+from super_mox import mox, SuperMoxBaseTestBase, SuperMoxTestBase
-from gclient_test import BaseTestCase
import scm
+class BaseTestCase(SuperMoxTestBase):
+ # Like unittest's assertRaises, but checks for Gclient.Error.
+ def assertRaisesError(self, msg, fn, *args, **kwargs):
+ try:
+ fn(*args, **kwargs)
+ except scm.gclient_utils.Error, e:
+ self.assertEquals(e.args[0], msg)
+ else:
+ self.fail('%s not raised' % msg)
+
+
class BaseSCMTestCase(BaseTestCase):
def setUp(self):
BaseTestCase.setUp(self)
« no previous file with comments | « tests/gclient_scm_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698