introduce new cdist.test.CdistTestCase base class which handles common tasks

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-19 17:59:21 +02:00
commit 97ab6effa4
9 changed files with 25 additions and 69 deletions

View file

@ -19,9 +19,7 @@
#
#
import unittest
import os
import tempfile
import getpass
import shutil
import string
@ -31,6 +29,7 @@ import random
#logging.basicConfig(level=logging.DEBUG, format='%(levelname)s: %(message)s')
import cdist
from cdist import test
from cdist.exec import local
import os.path as op
@ -39,13 +38,7 @@ fixtures = op.join(my_dir, 'fixtures')
local_base_path = fixtures
class LocalTestCase(unittest.TestCase):
def mkdtemp(self, **kwargs):
return tempfile.mkdtemp(prefix='tmp.cdist.test.', **kwargs)
def mkstemp(self, **kwargs):
return tempfile.mkstemp(prefix='tmp.cdist.test.', **kwargs)
class LocalTestCase(test.CdistTestCase):
def setUp(self):
self.temp_dir = self.mkdtemp()