Index: tests/gclient_scm_test.py |
=================================================================== |
--- tests/gclient_scm_test.py (revision 132543) |
+++ tests/gclient_scm_test.py (working copy) |
@@ -35,6 +35,11 @@ |
# pylint: disable=W0212 |
+def _DummyBinaryExists(unused): |
+ """Dummy implementation for BinaryExists() of SCMWrapper.""" |
+ return True |
+ |
+ |
class GCBaseTestCase(object): |
def assertRaisesError(self, msg, fn, *args, **kwargs): |
"""Like unittest's assertRaises() but checks for Gclient.Error.""" |
@@ -64,11 +69,14 @@ |
self.mox.StubOutWithMock(subprocess2, 'Popen') |
self._scm_wrapper = gclient_scm.CreateSCM |
gclient_scm.scm.SVN.current_version = None |
+ self._original_BinaryExists = gclient_scm.SCMWrapper.BinaryExists |
+ gclient_scm.SCMWrapper.BinaryExists = _DummyBinaryExists |
M-A Ruel
2012/04/17 12:15:55
you can simplify to:
gclient_scm.SCMWrapper.Binary
Jun Mukai
2012/04/18 02:46:36
Done.
|
# Absolute path of the fake checkout directory. |
self.base_path = join(self.root_dir, self.relpath) |
def tearDown(self): |
SuperMoxTestBase.tearDown(self) |
+ gclient_scm.SCMWrapper.BinaryExists = self._original_BinaryExists |
class SVNWrapperTestCase(BaseTestCase): |
@@ -94,6 +102,7 @@ |
def testDir(self): |
members = [ |
+ 'BinaryExists', |
'FullUrlForRelativeUrl', |
'GetRevisionDate', |
'GetUsableRev', |
@@ -750,16 +759,20 @@ |
self.base_path = join(self.root_dir, self.relpath) |
self.enabled = self.CreateGitRepo(self.sample_git_import, self.base_path) |
StdoutCheck.setUp(self) |
+ self._original_BinaryExists = gclient_scm.SCMWrapper.BinaryExists |
+ gclient_scm.SCMWrapper.BinaryExists = _DummyBinaryExists |
def tearDown(self): |
StdoutCheck.tearDown(self) |
TestCaseUtils.tearDown(self) |
unittest.TestCase.tearDown(self) |
rmtree(self.root_dir) |
+ gclient_scm.SCMWrapper.BinaryExists = self._original_BinaryExists |
class ManagedGitWrapperTestCase(BaseGitWrapperTestCase): |
def testDir(self): |
members = [ |
+ 'BinaryExists', |
'FullUrlForRelativeUrl', |
'GetRevisionDate', |
'GetUsableRev', |