All tests should call the base class setUp()

Change-Id: Ib15e0a3a96df690b0bfccb93c05348167619babb
This commit is contained in:
Angus Salkeld 2014-06-11 12:18:36 +10:00
parent 86c0f73ed3
commit 08b76f6563
4 changed files with 5 additions and 0 deletions

View File

@ -104,12 +104,14 @@ class BaseTest(unittest2.TestCase):
class DbTestCase(BaseTest): class DbTestCase(BaseTest):
def setUp(self): def setUp(self):
super(DbTestCase, self).setUp()
self.db_fd, self.db_path = tempfile.mkstemp() self.db_fd, self.db_path = tempfile.mkstemp()
cfg.CONF.set_default('connection', 'sqlite:///' + self.db_path, cfg.CONF.set_default('connection', 'sqlite:///' + self.db_path,
group='database') group='database')
db_api.setup_db() db_api.setup_db()
def tearDown(self): def tearDown(self):
super(DbTestCase, self).tearDown()
db_api.drop_db() db_api.drop_db()
os.close(self.db_fd) os.close(self.db_fd)
os.unlink(self.db_path) os.unlink(self.db_path)

View File

@ -51,6 +51,7 @@ REMOTE_SMTP = False
class SendEmailActionTest(base.BaseTest): class SendEmailActionTest(base.BaseTest):
def setUp(self): def setUp(self):
super(SendEmailActionTest, self).setUp()
self.params = { self.params = {
'to': ["dz@example.com, deg@example.com", "xyz@example.com"], 'to': ["dz@example.com, deg@example.com", "xyz@example.com"],
'subject': "Multi word subject с русскими буквами", 'subject': "Multi word subject с русскими буквами",

View File

@ -28,6 +28,7 @@ from mistral.workbook import tasks
class GetOnStateTest(base.BaseTest): class GetOnStateTest(base.BaseTest):
def setUp(self): def setUp(self):
super(GetOnStateTest, self).setUp()
self.task = tasks.TaskSpec(SAMPLE_TASK_SPEC) self.task = tasks.TaskSpec(SAMPLE_TASK_SPEC)
def test_state_finish(self): def test_state_finish(self):

View File

@ -28,6 +28,7 @@ Workflow:
class DSLModelTest(base.BaseTest): class DSLModelTest(base.BaseTest):
def setUp(self): def setUp(self):
super(DSLModelTest, self).setUp()
self.doc = base.get_resource("test_rest.yaml") self.doc = base.get_resource("test_rest.yaml")
def test_load_dsl(self): def test_load_dsl(self):