Fix unit tests for Python 2.5
This commit is contained in:
BIN
test/data/testrepo.tar
Normal file
BIN
test/data/testrepo.tar
Normal file
Binary file not shown.
Binary file not shown.
@@ -29,9 +29,9 @@ __author__ = 'dborowitz@google.com (Dave Borowitz)'
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import tarfile
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
import zipfile
|
|
||||||
|
|
||||||
import pygit2
|
import pygit2
|
||||||
|
|
||||||
@@ -70,9 +70,9 @@ class RepoTestCase(BaseTestCase):
|
|||||||
repo_dir = 'testrepo'
|
repo_dir = 'testrepo'
|
||||||
repo_path = os.path.join(os.path.dirname(__file__), 'data', repo_dir)
|
repo_path = os.path.join(os.path.dirname(__file__), 'data', repo_dir)
|
||||||
temp_dir = tempfile.mkdtemp()
|
temp_dir = tempfile.mkdtemp()
|
||||||
z = zipfile.ZipFile(repo_path + '.zip')
|
tar = tarfile.open(repo_path + '.tar')
|
||||||
z.extractall(temp_dir)
|
tar.extractall(temp_dir)
|
||||||
z.close()
|
tar.close()
|
||||||
self._temp_dir = temp_dir
|
self._temp_dir = temp_dir
|
||||||
temp_repo_path = os.path.join(temp_dir, repo_dir, '.git')
|
temp_repo_path = os.path.join(temp_dir, repo_dir, '.git')
|
||||||
self.repo = pygit2.Repository(temp_repo_path)
|
self.repo = pygit2.Repository(temp_repo_path)
|
||||||
|
Reference in New Issue
Block a user