From de5917e5f01374bb1a647f49ae85283241a2bea9 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 18 Jun 2011 04:42:52 +0200 Subject: Creation of the arborescence --- test/test.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 test/test.py (limited to 'test/test.py') diff --git a/test/test.py b/test/test.py new file mode 100755 index 0000000..f095157 --- /dev/null +++ b/test/test.py @@ -0,0 +1,31 @@ +''' + Class for the testing suite : + - get the list of all test files + - create a copy of them on start + - remove the copy on end +''' + +import shutil +import glob +import sys +import tempfile +import unittest +sys.path.append('..') +from lib import mat + +FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*')) + +class MATTest(unittest.TestCase): + def setUp(self): + '''create working copy of the clean and the dirty file in the TMP dir''' + self.file_list = [] + self.tmpdir = tempfile.mkdtemp() + + for clean, dirty in FILE_LIST: + shutil.copy2(clean, self.tmpdir + clean) + shutil.copy2(dirty, self.tmpdir + dirty) + self.file_list.append((self.tmpdir + clean, self.tmpdir + dirty)) + + def tearDown(self): + '''Remove the tmp folder''' + shutil.rmtree(self.tmpdir) -- cgit v1.3