Adding a DirtyRepoTestCase to be able to test Repository.status().

Also, adding a dirty repository in the data directory.
This commit is contained in:
Julien Miotte 2011-07-21 12:03:15 +02:00
parent f4e75e5b6f
commit d313af21a0
2 changed files with 7 additions and 1 deletions

BIN
test/data/dirtyrepo.tar Normal file

Binary file not shown.

View File

@ -66,8 +66,10 @@ class BareRepoTestCase(BaseTestCase):
class RepoTestCase(BaseTestCase):
repo_dir = 'testrepo'
def setUp(self):
repo_dir = 'testrepo'
repo_dir = self.repo_dir
repo_path = os.path.join(os.path.dirname(__file__), 'data', repo_dir)
temp_dir = tempfile.mkdtemp()
tar = tarfile.open(repo_path + '.tar')
@ -76,3 +78,7 @@ class RepoTestCase(BaseTestCase):
self._temp_dir = temp_dir
temp_repo_path = os.path.join(temp_dir, repo_dir, '.git')
self.repo = pygit2.Repository(temp_repo_path)
class DirtyRepoTestCase(RepoTestCase):
repo_dir = 'dirtyrepo'