summaryrefslogtreecommitdiff
path: root/tests/test_collection.py
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2020-12-07 13:49:26 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2020-12-07 13:49:26 +0100
commit714c30e429dab8083b9e5317209e44619d875d22 (patch)
treee6b4a7a4474320fff1f63388a96407a596cfff79 /tests/test_collection.py
parentd051e35086de44166fae87ed5edef32083d7e426 (diff)
Test compatibility with python < 3.8
Diffstat (limited to 'tests/test_collection.py')
-rw-r--r--tests/test_collection.py17
1 files changed, 9 insertions, 8 deletions
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)