Add workflow creation unit test in db layer

Change-Id: I71f409c3a746ddbedfc8a9e2a9b99446533cdc8d
This commit is contained in:
lawrancejing 2015-12-14 07:24:45 +00:00
parent 19c34a4e66
commit 4b3dbd9fa7
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,26 @@
# Copyright 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Tests for manipulating Bays via the DB API"""
from evoque.tests.unit import base
from evoque.tests.unit.db import utils
class DBWorkflowTestCase(base.DBTestCase):
def test_workflow_create(self):
workflow = utils.workflow_create(self.context)
self.assertEqual(workflow.name, 'test-workflow')

View File

@ -18,6 +18,7 @@
from evoque.db import api as db_api
# Tickets
def ticket_create(context):
values = {"name": "test-ticket"}
ticket = db_api.ticket_create(context, values)
@ -27,3 +28,10 @@ def ticket_create(context):
def ticket_list(context):
tickets = db_api.ticket_get_all(context)
return tickets
# Workflows
def workflow_create(context):
values = {"name": "test-workflow"}
workflow = db_api.workflow_create(context, values)
return workflow