| Index: tests/scm_unittest.py
|
| diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py
|
| index 4e97c73eebea7d4f78ebf987725372bb7ac2ddb0..0b03152e9955d56689a26c240aace22d752dcca9 100755
|
| --- a/tests/scm_unittest.py
|
| +++ b/tests/scm_unittest.py
|
| @@ -8,6 +8,7 @@
|
| import logging
|
| import os
|
| import sys
|
| +import tempfile
|
| import unittest
|
|
|
| sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
| @@ -141,6 +142,17 @@ class RealGitTest(fake_repos.FakeReposTestBase):
|
| self.assertTrue(scm.GIT.IsValidRevision(cwd=self.clone_dir, rev=first_rev))
|
| self.assertTrue(scm.GIT.IsValidRevision(cwd=self.clone_dir, rev='HEAD'))
|
|
|
| + # Verify that IsValidRevision returns False for non-commit objects.
|
| + tmp = tempfile.NamedTemporaryFile(delete=False)
|
| + try:
|
| + tmp.write('This is not a commit')
|
| + tmp.close()
|
| + hashval = scm.GIT.Capture(['hash-object', '-w', tmp.name],
|
| + cwd=self.clone_dir)
|
| + finally:
|
| + os.remove(tmp.name)
|
| + self.assertFalse(scm.GIT.IsValidRevision(cwd=self.clone_dir, rev=hashval))
|
| +
|
|
|
| class RealGitSvnTest(fake_repos.FakeReposTestBase):
|
| def setUp(self):
|
|
|