| Index: tests/scm_unittest.py
|
| diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py
|
| index ff03c03e1b934ddd338d7e86ce1ce3acca62b8d6..9c8098e15ff6220cc7f1ee3d5ef1b961b5f9ad40 100755
|
| --- a/tests/scm_unittest.py
|
| +++ b/tests/scm_unittest.py
|
| @@ -90,6 +90,7 @@ class GitWrapperTestCase(BaseSCMTestCase):
|
| 'GetSha1ForSvnRev',
|
| 'GetSVNBranch',
|
| 'GetUpstreamBranch',
|
| + 'IsGit',
|
| 'IsGitSvn',
|
| 'IsValidRevision',
|
| 'MatchSvnGlob',
|
| @@ -169,6 +170,28 @@ class RealGitSvnTest(fake_repos.FakeReposTestBase):
|
| self._capture(['reset', '--hard', 'HEAD^'])
|
| self.assertEquals(scm.GIT.GetGitSvnHeadRev(cwd=self.clone_dir), 1)
|
|
|
| + def testIsGit(self):
|
| + if not self.enabled:
|
| + return
|
| + # Pure git
|
| + git_dir = scm.os.path.join(self.FAKE_REPOS.git_root, 'repo_1')
|
| + self.assertTrue(scm.GIT.IsGit(git_dir))
|
| + # Pure svn
|
| + svn_dir = scm.os.path.join(self.FAKE_REPOS.svn_checkout, 'trunk')
|
| + self.assertFalse(scm.GIT.IsGit(svn_dir))
|
| +
|
| + def testIsGitSvn(self):
|
| + if not self.enabled:
|
| + return
|
| + # Git-svn
|
| + self.assertTrue(scm.GIT.IsGitSvn(self.clone_dir))
|
| + # Pure git
|
| + git_dir = scm.os.path.join(self.FAKE_REPOS.git_root, 'repo_1')
|
| + self.assertFalse(scm.GIT.IsGitSvn(git_dir))
|
| + # Pure svn
|
| + svn_dir = scm.os.path.join(self.FAKE_REPOS.svn_checkout, 'trunk')
|
| + self.assertFalse(scm.GIT.IsGitSvn(svn_dir))
|
| +
|
| def testParseGitSvnSha1(self):
|
| test_sha1 = 'a5c63ce8671922e5c59c0dea49ef4f9d4a3020c9'
|
| expected_output = test_sha1 + '\n'
|
|
|