Test for pygit2.discover_repository
This commit is contained in:
parent
7ad8f0a8f0
commit
b1cb51c9d1
@ -34,7 +34,8 @@ import unittest
|
|||||||
import os
|
import os
|
||||||
from os.path import join, realpath
|
from os.path import join, realpath
|
||||||
|
|
||||||
from pygit2 import GIT_OBJ_ANY, GIT_OBJ_BLOB, GIT_OBJ_COMMIT, init_repository
|
from pygit2 import GIT_OBJ_ANY, GIT_OBJ_BLOB, GIT_OBJ_COMMIT, init_repository, \
|
||||||
|
discover_repository
|
||||||
from . import utils
|
from . import utils
|
||||||
|
|
||||||
|
|
||||||
@ -145,5 +146,12 @@ class NewRepositoryTest(utils.NoRepoTestCase):
|
|||||||
|
|
||||||
assert os.path.exists(os.path.join(self._temp_dir, '.git'))
|
assert os.path.exists(os.path.join(self._temp_dir, '.git'))
|
||||||
|
|
||||||
|
class DiscoverRepositoryTest(utils.NoRepoTestCase):
|
||||||
|
def test_discover_repo(self):
|
||||||
|
repo = init_repository(self._temp_dir, False)
|
||||||
|
subdir = os.path.join(self._temp_dir, "test1","test2")
|
||||||
|
os.makedirs(subdir)
|
||||||
|
self.assertEqual(repo.path, discover_repository(subdir))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user