Exemplo n.º 1
0
import contextlib

from django.core import urlresolvers

from mock import patch, call  # noqa

from openstack_dashboard.test.test_data import utils
from tuskar_ui import api
from tuskar_ui.test import helpers as test
from tuskar_ui.test.test_data import heat_data
from tuskar_ui.test.test_data import tuskar_data


TEST_DATA = utils.TestDataContainer()
heat_data.data(TEST_DATA)
tuskar_data.data(TEST_DATA)
INDEX_URL = urlresolvers.reverse(
    'horizon:infrastructure:history:index')


class HistoryTest(test.BaseAdminViewTests):

    def test_index(self):
        plan = api.tuskar.OvercloudPlan(
            TEST_DATA.tuskarclient_plans.first())
        stack = api.heat.Stack(
            TEST_DATA.heatclient_stacks.first())
        events = TEST_DATA.heatclient_events.list()

        with contextlib.nested(
Exemplo n.º 2
0
#    under the License.

import contextlib

from django.core import urlresolvers

from mock import patch, call  # noqa

from openstack_dashboard.test.test_data import utils
from tuskar_ui import api
from tuskar_ui.test import helpers as test
from tuskar_ui.test.test_data import heat_data
from tuskar_ui.test.test_data import tuskar_data

TEST_DATA = utils.TestDataContainer()
heat_data.data(TEST_DATA)
tuskar_data.data(TEST_DATA)
INDEX_URL = urlresolvers.reverse('horizon:infrastructure:history:index')


class HistoryTest(test.BaseAdminViewTests):
    def test_index(self):
        plan = api.tuskar.OvercloudPlan(TEST_DATA.tuskarclient_plans.first())
        stack = api.heat.Stack(TEST_DATA.heatclient_stacks.first())
        events = TEST_DATA.heatclient_events.list()

        with contextlib.nested(
                patch('tuskar_ui.api.tuskar.OvercloudPlan.get_the_plan',
                      return_value=plan),
                patch('tuskar_ui.api.heat.Stack.get_by_plan',
                      return_value=stack),