blob: cb9e5765084bdba12bc3c57f6669bc1c5da842d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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']
|