Chromium Code Reviews| Index: tests/gclient_scm_test.py |
| diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py |
| index 3dd175c69e292c1bb203216530b5c3833214c91b..607602343a680536cca6bbceb1dd0aefa2542f4d 100755 |
| --- a/tests/gclient_scm_test.py |
| +++ b/tests/gclient_scm_test.py |
| @@ -88,6 +88,31 @@ class BaseTestCase(GCBaseTestCase, SuperMoxTestBase): |
| gclient_scm.GitWrapper.BinaryExists = self._original_GitBinaryExists |
| +class BasicTests(SuperMoxTestBase): |
| + def setUp(self): |
| + SuperMoxTestBase.setUp(self) |
| + |
| + def testGetFirstRemoteUrl(self): |
| + REMOTE_STRINGS = [('remote.origin.url E:\\foo\\bar', 'E:\\foo\\bar'), |
|
iannucci
2014/08/22 17:43:46
oh, can you do one with quotes? I think that's wha
|
| + ('remote.origin.url /b/foo/bar', '/b/foo/bar'), |
| + ('remote.origin.url https://foo/bar', 'https://foo/bar')] |
| + FAKE_PATH = '/fake/path' |
| + self.mox.StubOutWithMock(gclient_scm.scm.GIT, 'Capture') |
| + for question, _ in REMOTE_STRINGS: |
| + gclient_scm.scm.GIT.Capture( |
| + ['config', '--local', '--get-regexp', r'remote.*.url'], |
| + cwd=FAKE_PATH).AndReturn(question) |
| + |
| + self.mox.ReplayAll() |
| + |
| + for _, answer in REMOTE_STRINGS: |
| + self.assertEquals(gclient_scm.SCMWrapper._get_first_remote_url(FAKE_PATH), |
| + answer) |
| + |
| + def tearDown(self): |
| + SuperMoxTestBase.tearDown(self) |
| + |
| + |
| class SVNWrapperTestCase(BaseTestCase): |
| class OptionsObject(object): |
| def __init__(self, verbose=False, revision=None, force=False): |