aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2010-12-09 23:22:27 -0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2010-12-09 23:22:27 -0200
commitd0c6e156e471287ae0aa33150b01bba60362db57 (patch)
treeb53b7b8b9e58412356ab6b954010e912afb1c497 /tests/testcase.py
parentsmall fixes on the log class and some minor typos (diff)
downloadg-octave-d0c6e156e471287ae0aa33150b01bba60362db57.tar.gz
g-octave-d0c6e156e471287ae0aa33150b01bba60362db57.tar.bz2
g-octave-d0c6e156e471287ae0aa33150b01bba60362db57.zip
fixed a bunch of tests
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']