From 714c30e429dab8083b9e5317209e44619d875d22 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Mon, 7 Dec 2020 13:49:26 +0100 Subject: Test compatibility with python < 3.8 --- tests/test_collection.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'tests/test_collection.py') diff --git a/tests/test_collection.py b/tests/test_collection.py index 6a65ff3..4aa0dfe 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -8,12 +8,13 @@ import git import ruamel.yaml import lesana +from . import utils class testEntries(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() - shutil.copytree('tests/data/simple', self.tmpdir, dirs_exist_ok=True) + utils.copytree('tests/data/simple', self.tmpdir, dirs_exist_ok=True) self.collection = lesana.Collection(self.tmpdir) self.basepath = self.collection.itemdir self.filenames = [] @@ -120,7 +121,7 @@ class testEntries(unittest.TestCase): class testEmptyCollection(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() - shutil.copytree('tests/data/empty', self.tmpdir, dirs_exist_ok=True) + utils.copytree('tests/data/empty', self.tmpdir, dirs_exist_ok=True) self.collection = lesana.Collection(self.tmpdir) def tearDown(self): @@ -136,7 +137,7 @@ class testEmptyCollection(unittest.TestCase): class testSimpleCollection(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() - shutil.copytree('tests/data/simple', self.tmpdir, dirs_exist_ok=True) + utils.copytree('tests/data/simple', self.tmpdir, dirs_exist_ok=True) self.collection = lesana.Collection(self.tmpdir) def tearDown(self): @@ -261,7 +262,7 @@ class testSimpleCollection(unittest.TestCase): class testComplexCollection(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() - shutil.copytree('tests/data/complex', self.tmpdir, dirs_exist_ok=True) + utils.copytree('tests/data/complex', self.tmpdir, dirs_exist_ok=True) self.collection = lesana.Collection(self.tmpdir) def tearDown(self): @@ -360,7 +361,7 @@ class testComplexCollection(unittest.TestCase): class testCollectionWithErrors(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() - shutil.copytree('tests/data/wrong', self.tmpdir, dirs_exist_ok=True) + utils.copytree('tests/data/wrong', self.tmpdir, dirs_exist_ok=True) self.collection = lesana.Collection(self.tmpdir) def tearDown(self): @@ -480,7 +481,7 @@ class testCollectionCreation(unittest.TestCase): def test_deletion(self): shutil.copy('tests/data/simple/settings.yaml', self.tmpdir) - shutil.copytree( + utils.copytree( 'tests/data/simple/items', os.path.join(self.tmpdir, 'items'), ) collection = lesana.Collection.init(self.tmpdir) @@ -506,7 +507,7 @@ class testCollectionCreation(unittest.TestCase): def test_partial_eid_deletion(self): shutil.copy('tests/data/simple/settings.yaml', self.tmpdir) - shutil.copytree( + utils.copytree( 'tests/data/simple/items', os.path.join(self.tmpdir, 'items'), ) collection = lesana.Collection.init(self.tmpdir) @@ -540,7 +541,7 @@ class testCollectionCreation(unittest.TestCase): def test_git_adding(self): shutil.copy('tests/data/simple/settings.yaml', self.tmpdir) - shutil.copytree( + utils.copytree( 'tests/data/simple/items', os.path.join(self.tmpdir, 'items'), ) collection = lesana.Collection.init(self.tmpdir) -- cgit v1.2.3