Fix unit tests for Python 2.5

This commit is contained in:
J. David Ibañez
2011-02-09 16:28:05 +01:00
parent f287cea350
commit 83a78dac5f
3 changed files with 4 additions and 4 deletions

BIN
test/data/testrepo.tar Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -29,9 +29,9 @@ __author__ = 'dborowitz@google.com (Dave Borowitz)'
import os
import shutil
import tarfile
import tempfile
import unittest
import zipfile
import pygit2
@@ -70,9 +70,9 @@ class RepoTestCase(BaseTestCase):
repo_dir = 'testrepo'
repo_path = os.path.join(os.path.dirname(__file__), 'data', repo_dir)
temp_dir = tempfile.mkdtemp()
z = zipfile.ZipFile(repo_path + '.zip')
z.extractall(temp_dir)
z.close()
tar = tarfile.open(repo_path + '.tar')
tar.extractall(temp_dir)
tar.close()
self._temp_dir = temp_dir
temp_repo_path = os.path.join(temp_dir, repo_dir, '.git')
self.repo = pygit2.Repository(temp_repo_path)