Add unit tests for bytes and unicode Repositories

Add unit test for bytes repository paths
Add a unicode path test for Repositories
This commit is contained in:
Thom Wiggers
2016-02-27 23:43:44 +01:00
parent 3470fbc1c6
commit bc424e342f

View File

@@ -39,6 +39,8 @@ import os
from os.path import join, realpath
import sys
import six
# Import from pygit2
from pygit2 import GIT_OBJ_ANY, GIT_OBJ_BLOB, GIT_OBJ_COMMIT
from pygit2 import init_repository, clone_repository, discover_repository
@@ -482,12 +484,17 @@ class EmptyRepositoryTest(utils.EmptyRepoTestCase):
self.assertFalse(self.repo.head_is_detached)
class BytesStringRepositoryTest(utils.NoRepoTestCase):
class StringTypesRepositoryTest(utils.NoRepoTestCase):
def test_bytes_string(self):
repo_path = b'./test/data/testrepo.git/'
pygit2.Repository(repo_path)
def test_unicode_string(self):
# String is unicode because of unicode_literals
repo_path = './test/data/testrepo.git/'
pygit2.Repository(repo_path)
class CloneRepositoryTest(utils.NoRepoTestCase):