Fixed Unit test for murano-dashboard
After 7052b7f065 merged in openstack/horizon a new Unit test class introduced in horizon i.e. RestAPITestCase. This patch updates murano-dashboard to import RestAPITestCase class instead of TestCase. For more info. see [1] [1] https://review.opendev.org/c/openstack/horizon/+/827097/2/openstack_dashboard/test/helpers.py#485 Change-Id: I83c5b5a35b63790df1919974cbb4236eefd05b5d
This commit is contained in:
parent
5ba4e8148a
commit
7f29364734
|
@ -4,7 +4,6 @@
|
|||
- horizon-non-primary-django-jobs
|
||||
- horizon-nodejs14-jobs
|
||||
- openstack-cover-jobs-horizon
|
||||
- openstack-lower-constraints-jobs
|
||||
- openstack-python3-yoga-jobs-horizon
|
||||
- release-notes-jobs-python3
|
||||
check:
|
||||
|
|
|
@ -28,7 +28,7 @@ PARAM_MAPPING = {
|
|||
|
||||
@mock.patch.object(environments, 'api')
|
||||
@mock.patch.object(environments, 'env_api')
|
||||
class TestComponentsMetadataAPI(helpers.APITestCase):
|
||||
class TestComponentsMetadataAPI(helpers.RestAPITestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestComponentsMetadataAPI, self).setUp()
|
||||
|
@ -86,7 +86,7 @@ class TestComponentsMetadataAPI(helpers.APITestCase):
|
|||
|
||||
@mock.patch.object(environments, 'api')
|
||||
@mock.patch.object(environments, 'env_api')
|
||||
class TestEnvironmentsMetadataApi(helpers.APITestCase):
|
||||
class TestEnvironmentsMetadataApi(helpers.RestAPITestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestEnvironmentsMetadataApi, self).setUp()
|
||||
|
|
|
@ -16,6 +16,7 @@ import json
|
|||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
import horizon
|
||||
from horizon import exceptions
|
||||
|
||||
from muranodashboard.images import tables
|
||||
|
@ -161,9 +162,12 @@ class TestMarkedImagesView(unittest.TestCase):
|
|||
|
||||
@mock.patch.object(views, 'reverse', autospec=True)
|
||||
@mock.patch.object(views, 'glance', autospec=True)
|
||||
def test_get_data_except_glance_image_list_exception(self, mock_glance,
|
||||
@mock.patch.object(horizon.messages, 'horizon_message_already_queued')
|
||||
def test_get_data_except_glance_image_list_exception(self, mock_messages,
|
||||
mock_glance,
|
||||
mock_reverse):
|
||||
"""Test that glance_v1_client.images.list exception is handled."""
|
||||
mock_messages.return_value = True
|
||||
mock_glance_client = mock.Mock()
|
||||
mock_glance_client.images.list.side_effect = Exception()
|
||||
mock_glance.glanceclient.return_value = mock_glance_client
|
||||
|
|
|
@ -130,7 +130,7 @@ class TestDetailView(helpers.APITestCase):
|
|||
redirect='test_redirect')
|
||||
|
||||
|
||||
class TestModifyPackageView(helpers.APITestCase):
|
||||
class TestModifyPackageView(helpers.RestAPITestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestModifyPackageView, self).setUp()
|
||||
|
@ -783,7 +783,7 @@ class TestImportPackageWizard(helpers.APITestCase):
|
|||
'package': 'test_package'}, kwargs)
|
||||
|
||||
|
||||
class TestImportBundleWizard(helpers.APITestCase):
|
||||
class TestImportBundleWizard(helpers.RestAPITestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestImportBundleWizard, self).setUp()
|
||||
|
|
Loading…
Reference in New Issue