| Index: tests/gclient_scm_test.py
|
| diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
|
| index 65b4ba7bdd74b7c1c02bd3f78249c28327dc5951..828e6369b4a162e5f7a2b0142d23c2b28d928b16 100755
|
| --- a/tests/gclient_scm_test.py
|
| +++ b/tests/gclient_scm_test.py
|
| @@ -102,6 +102,7 @@ class SVNWrapperTestCase(BaseTestCase):
|
| 'BinaryExists',
|
| 'FullUrlForRelativeUrl',
|
| 'GetCheckoutRoot',
|
| + 'GetRemoteURL',
|
| 'GetRevisionDate',
|
| 'GetUsableRev',
|
| 'Svnversion',
|
| @@ -692,6 +693,35 @@ class SVNWrapperTestCase(BaseTestCase):
|
| self.assertRaises(gclient_scm.gclient_utils.Error,
|
| svn_scm.GetUsableRev, 'fake', options)
|
|
|
| + def testGetRemoteURL(self):
|
| + options = self.Options(verbose=True)
|
| + svn_scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
|
| + relpath=self.relpath)
|
| +
|
| + if svn_scm.relpath:
|
| + cwd = os.path.join(svn_scm._root_dir, svn_scm.relpath)
|
| + else:
|
| + cwd = svn_scm._root_dir
|
| +
|
| + gclient_scm.scm.SVN.Capture(['info', os.curdir], cwd).AndReturn(
|
| +"""
|
| +Path: .
|
| +URL: %s
|
| +Repository Root: https://dummy.repo.com/svn
|
| +Repository UUID: FAKE
|
| +Revision: 1234
|
| +Node Kind: directory
|
| +Schedule: normal
|
| +Last Changed Author: fakedev@chromium.org
|
| +Last Changed Rev: 1234
|
| +Last Changed Date: 2013-11-11 15:12:34 -0500 (Mon, 11 Nov 2013)
|
| +""" % svn_scm.url)
|
| +
|
| + self.mox.ReplayAll()
|
| +
|
| + self.assertEquals(svn_scm.GetRemoteURL(options), self.url)
|
| +
|
| +
|
| class BaseGitWrapperTestCase(GCBaseTestCase, StdoutCheck, TestCaseUtils,
|
| unittest.TestCase):
|
| """This class doesn't use pymox."""
|
| @@ -813,6 +843,7 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
|
| 'BinaryExists',
|
| 'FullUrlForRelativeUrl',
|
| 'GetCheckoutRoot',
|
| + 'GetRemoteURL',
|
| 'GetRevisionDate',
|
| 'GetUsableRev',
|
| 'RunCommand',
|
| @@ -1180,6 +1211,21 @@ class ManagedGitWrapperTestCaseMox(BaseTestCase):
|
| self.assertRaises(gclient_scm.gclient_utils.Error,
|
| git_svn_scm.GetUsableRev, too_big, options)
|
|
|
| + def testGetRemoteURL(self):
|
| + options = self.Options(verbose=True)
|
| + self.mox.StubOutWithMock(gclient_scm.GitWrapper, '_Capture', True)
|
| + git_scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
|
| + relpath=self.relpath)
|
| + git_scm._Capture(['remote', '-v']).AndReturn(
|
| +"""
|
| +origin %(url)s (fetch)
|
| +origin %(url)s (push)
|
| +""" % {'url': git_scm.url})
|
| +
|
| + self.mox.ReplayAll()
|
| +
|
| + self.assertEquals(git_scm.GetRemoteURL(options), self.url)
|
| +
|
|
|
| class UnmanagedGitWrapperTestCase(BaseGitWrapperTestCase):
|
| def testUpdateUpdate(self):
|
|
|