From 5ab985a8d4a9bb8bc3b7ec4dd5c519aa44cbe3a6 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Wed, 25 Oct 2017 09:44:49 +0200 Subject: tests: Split TempDirTestCase into common module --- tests/test_recursiveloader.py | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'tests/test_recursiveloader.py') diff --git a/tests/test_recursiveloader.py b/tests/test_recursiveloader.py index 7889956..bc98fb7 100644 --- a/tests/test_recursiveloader.py +++ b/tests/test_recursiveloader.py @@ -4,33 +4,12 @@ # Licensed under the terms of 2-clause BSD license import datetime -import io import os -import tempfile -import unittest import gemato.exceptions import gemato.recursiveloader - -class TempDirTestCase(unittest.TestCase): - DIRS = [] - FILES = {} - - def setUp(self): - self.dir = tempfile.mkdtemp() - for k in self.DIRS: - os.mkdir(os.path.join(self.dir, k)) - for k, v in self.FILES.items(): - with io.open(os.path.join(self.dir, k), 'w', encoding='utf8') as f: - f.write(v) - - def tearDown(self): - for k in self.FILES: - os.unlink(os.path.join(self.dir, k)) - for k in reversed(self.DIRS): - os.rmdir(os.path.join(self.dir, k)) - os.rmdir(self.dir) +from tests.testutil import TempDirTestCase class BasicNestingTest(TempDirTestCase): -- cgit v1.2.3