aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testcase.py')
-rw-r--r--tests/testcase.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/testcase.py b/tests/testcase.py
new file mode 100644
index 0000000..cb9e576
--- /dev/null
+++ b/tests/testcase.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+"""
+ testcase.py
+ ~~~~~~~~~~~
+
+ Custom test-case class for g-octave. The g_octave.config test suite
+ SHOULD NOT inherit this class.
+
+ :copyright: (c) 2010 by Rafael Goncalves Martins
+ :license: GPL-2, see LICENSE for more details.
+"""
+
+import os
+import shutil
+import tempfile
+import unittest
+
+from g_octave.config import Config
+
+
+class TestCase(unittest.TestCase):
+
+ def setUp(self):
+ self._tempdir = tempfile.mkdtemp()
+ current_dir = os.path.dirname(os.path.abspath(__file__))
+ os.environ['GOCTAVE_DB'] = os.path.join(current_dir, 'files')
+ os.environ['GOCTAVE_OVERLAY'] = os.path.join(self._tempdir, 'overlay')
+ self._config = Config()
+
+ def tearDown(self):
+ shutil.rmtree(self._tempdir)
+ del os.environ['GOCTAVE_DB']
+ del os.environ['GOCTAVE_OVERLAY']