diff --git a/swh/loader/svn/tests/svn-test-repos/pkg-doc-linux-r10.tgz b/swh/loader/svn/tests/svn-test-repos/pkg-doc-linux-r10.tgz new file mode 100644 index 0000000..126a9e4 Binary files /dev/null and b/swh/loader/svn/tests/svn-test-repos/pkg-doc-linux-r10.tgz differ diff --git a/swh/loader/svn/tests/svn-test-repos/pkg-doc-linux-r11.tgz b/swh/loader/svn/tests/svn-test-repos/pkg-doc-linux-r11.tgz new file mode 100644 index 0000000..c438143 Binary files /dev/null and b/swh/loader/svn/tests/svn-test-repos/pkg-doc-linux-r11.tgz differ diff --git a/swh/loader/svn/tests/svn-test-repos/pkg-doc-linux-r12.tgz b/swh/loader/svn/tests/svn-test-repos/pkg-doc-linux-r12.tgz new file mode 100644 index 0000000..79cc761 Binary files /dev/null and b/swh/loader/svn/tests/svn-test-repos/pkg-doc-linux-r12.tgz differ diff --git a/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-edge-case-links-and-files.tgz b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-edge-case-links-and-files.tgz new file mode 100644 index 0000000..1b87c52 Binary files /dev/null and b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-edge-case-links-and-files.tgz differ diff --git a/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-eol-corner-cases.tgz b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-eol-corner-cases.tgz new file mode 100644 index 0000000..ec65fde Binary files /dev/null and b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-eol-corner-cases.tgz differ diff --git a/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-external-id.tgz b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-external-id.tgz new file mode 100644 index 0000000..1b438f8 Binary files /dev/null and b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-external-id.tgz differ diff --git a/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-updates.tgz b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-updates.tgz new file mode 100644 index 0000000..6478e2b Binary files /dev/null and b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-updates.tgz differ diff --git a/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-wrong-link-cases.tgz b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-wrong-link-cases.tgz new file mode 100644 index 0000000..fe929ed Binary files /dev/null and b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet-with-wrong-link-cases.tgz differ diff --git a/swh/loader/svn/tests/svn-test-repos/pkg-gourmet.tgz b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet.tgz new file mode 100644 index 0000000..9bf6534 Binary files /dev/null and b/swh/loader/svn/tests/svn-test-repos/pkg-gourmet.tgz differ diff --git a/swh/loader/svn/tests/test_base.py b/swh/loader/svn/tests/test_base.py index b0e456d..45d2a8d 100644 --- a/swh/loader/svn/tests/test_base.py +++ b/swh/loader/svn/tests/test_base.py @@ -1,93 +1,60 @@ # Copyright (C) 2016 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import os import shutil import subprocess import tempfile import unittest from nose.plugins.attrib import attr from swh.model import hashutil -PATH_TO_DATA = '../../../../..' - - @attr('fs') class BaseTestSvnLoader(unittest.TestCase): """Base test loader class. In its setup, it's uncompressing a local svn mirror to /tmp. """ def setUp(self, archive_name='pkg-gourmet.tgz', filename='pkg-gourmet'): self.tmp_root_path = tempfile.mkdtemp() start_path = os.path.dirname(__file__) svn_mirror_repo = os.path.join(start_path, - PATH_TO_DATA, - 'swh-storage-testdata', - 'svn-folders', + 'svn-test-repos', archive_name) # uncompress the sample folder subprocess.check_output( ['tar', 'xvf', svn_mirror_repo, '-C', self.tmp_root_path], ) self.svn_mirror_url = 'file://' + self.tmp_root_path + '/' + filename self.destination_path = os.path.join( self.tmp_root_path, 'working-copy') def tearDown(self): shutil.rmtree(self.tmp_root_path) def assertRevisionsOk(self, expected_revisions): # noqa: N802 """Check the loader's revisions match the expected revisions. Expects self.loader to be instantiated and ready to be inspected (meaning the loading took place). Args: expected_revisions (dict): Dict with key revision id, value the targeted directory id. """ # The last revision being the one used later to start back from for rev in self.loader.all_revisions: rev_id = hashutil.hash_to_hex(rev['id']) directory_id = hashutil.hash_to_hex(rev['directory']) self.assertEquals(expected_revisions[rev_id], directory_id) - - -class BaseTestTreeLoader(unittest.TestCase): - """Root class to ease walk and git hash testing without side-effecty - problems. - - """ - def setUp(self): - super().setUp() - self.tmp_root_path = tempfile.mkdtemp() - self.maxDiff = None - - start_path = os.path.dirname(__file__) - sample_folder = os.path.join(start_path, - PATH_TO_DATA, - 'swh-storage-testdata', - 'dir-folders', - 'sample-folder.tgz') - - self.root_path = os.path.join(self.tmp_root_path, 'sample-folder') - - # uncompress the sample folder - subprocess.check_output( - ['tar', 'xvf', sample_folder, '-C', self.tmp_root_path]) - - def tearDown(self): - if os.path.exists(self.tmp_root_path): - shutil.rmtree(self.tmp_root_path)