Skip to content

Commit

Permalink
Move testdata out of code directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Jul 15, 2022
1 parent 64a1ae2 commit c1738f5
Show file tree
Hide file tree
Showing 84 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dulwich/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def can_symlink():

class IndexTestCase(TestCase):

datadir = os.path.join(os.path.dirname(__file__), "data/indexes")
datadir = os.path.join(os.path.dirname(__file__), "../../testdata/indexes")

def get_simple_index(self, name):
return Index(os.path.join(self.datadir, name))
Expand Down
4 changes: 2 additions & 2 deletions dulwich/tests/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class BlobReadTests(TestCase):
"""Test decompression of blobs"""

def get_sha_file(self, cls, base, sha):
dir = os.path.join(os.path.dirname(__file__), "data", base)
dir = os.path.join(os.path.dirname(__file__), "..", "..", "testdata", base)
return cls.from_path(hex_to_filename(dir, sha))

def get_blob(self, sha):
Expand Down Expand Up @@ -878,7 +878,7 @@ def test_tree_items_dir_sort(self):
self.assertEqual(_SORTED_TREE_ITEMS, x.items())

def _do_test_parse_tree(self, parse_tree):
dir = os.path.join(os.path.dirname(__file__), "data", "trees")
dir = os.path.join(os.path.dirname(__file__), "..", "..", "testdata", "trees")
o = Tree.from_path(hex_to_filename(dir, tree_sha))
self.assertEqual(
[(b"a", 0o100644, a_sha), (b"b", 0o100644, b_sha)],
Expand Down
2 changes: 1 addition & 1 deletion dulwich/tests/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def setUp(self):
self.tempdir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.tempdir)

datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data/packs"))
datadir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../testdata/packs"))

def get_pack_index(self, sha):
"""Returns a PackIndex from the datadir with the given sha"""
Expand Down
2 changes: 1 addition & 1 deletion dulwich/tests/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def test_clone(self):
def test_clone_no_head(self):
temp_dir = self.mkdtemp()
self.addCleanup(shutil.rmtree, temp_dir)
repo_dir = os.path.join(os.path.dirname(__file__), "data", "repos")
repo_dir = os.path.join(os.path.dirname(__file__), "..", "..", "testdata", "repos")
dest_dir = os.path.join(temp_dir, "a.git")
shutil.copytree(os.path.join(repo_dir, "a.git"), dest_dir, symlinks=True)
r = Repo(dest_dir)
Expand Down
2 changes: 1 addition & 1 deletion dulwich/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def open_repo(name, temp_dir=None):
"""
if temp_dir is None:
temp_dir = tempfile.mkdtemp()
repo_dir = os.path.join(os.path.dirname(__file__), "data", "repos", name)
repo_dir = os.path.join(os.path.dirname(__file__), "..", "..", "testdata", "repos", name)
temp_repo_dir = os.path.join(temp_dir, name)
shutil.copytree(repo_dir, temp_repo_dir, symlinks=True)
return Repo(temp_repo_dir)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c1738f5

Please sign in to comment.