Mark other API related tests with mox free
Change-Id: I991100bce99815bbd5af078e53b966c5cfc92233 Partially-Implements: blueprint mock-framework-in-unit-tests
This commit is contained in:
parent
5c5159bc09
commit
d3883a147b
@ -25,6 +25,8 @@ from openstack_dashboard.test import helpers as test
|
|||||||
|
|
||||||
class CinderRestTestCase(test.TestCase):
|
class CinderRestTestCase(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
#
|
#
|
||||||
# Volumes
|
# Volumes
|
||||||
#
|
#
|
||||||
|
@ -17,6 +17,9 @@ from openstack_dashboard.test import helpers as test
|
|||||||
|
|
||||||
|
|
||||||
class ConfigRestTestCase(test.TestCase):
|
class ConfigRestTestCase(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
def test_settings_config_get(self):
|
def test_settings_config_get(self):
|
||||||
request = self.mock_rest_request()
|
request = self.mock_rest_request()
|
||||||
response = config.Settings().get(request)
|
response = config.Settings().get(request)
|
||||||
|
@ -20,6 +20,9 @@ from openstack_dashboard.test import helpers as test
|
|||||||
|
|
||||||
|
|
||||||
class ImagesRestTestCase(test.ResetImageAPIVersionMixin, test.TestCase):
|
class ImagesRestTestCase(test.ResetImageAPIVersionMixin, test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(ImagesRestTestCase, self).setUp()
|
super(ImagesRestTestCase, self).setUp()
|
||||||
api.glance.VERSIONS.clear_active_cache()
|
api.glance.VERSIONS.clear_active_cache()
|
||||||
|
@ -20,6 +20,8 @@ from openstack_dashboard.test import helpers as test
|
|||||||
|
|
||||||
class PolicyRestTestCase(test.TestCase):
|
class PolicyRestTestCase(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
@override_settings(POLICY_CHECK_FUNCTION='openstack_auth.policy.check')
|
@override_settings(POLICY_CHECK_FUNCTION='openstack_auth.policy.check')
|
||||||
def _test_policy(self, body, expected=True):
|
def _test_policy(self, body, expected=True):
|
||||||
request = self.mock_rest_request(body=body)
|
request = self.mock_rest_request(body=body)
|
||||||
|
@ -17,6 +17,9 @@ from openstack_dashboard.test import helpers as test
|
|||||||
|
|
||||||
|
|
||||||
class RestUtilsTestCase(test.TestCase):
|
class RestUtilsTestCase(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
def test_api_success(self):
|
def test_api_success(self):
|
||||||
@utils.ajax()
|
@utils.ajax()
|
||||||
def f(self, request):
|
def f(self, request):
|
||||||
@ -169,6 +172,9 @@ class RestUtilsTestCase(test.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class JSONEncoderTestCase(test.TestCase):
|
class JSONEncoderTestCase(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
# NOTE(tsufiev): NaN numeric is "conventional" in a sense that the custom
|
# NOTE(tsufiev): NaN numeric is "conventional" in a sense that the custom
|
||||||
# NaNJSONEncoder encoder translates it to the same token that the standard
|
# NaNJSONEncoder encoder translates it to the same token that the standard
|
||||||
# JSONEncoder encoder does
|
# JSONEncoder encoder does
|
||||||
|
@ -59,6 +59,9 @@ class APIDict(api_base.APIDictWrapper):
|
|||||||
|
|
||||||
|
|
||||||
class APIVersionTests(test.TestCase):
|
class APIVersionTests(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
def test_equal(self):
|
def test_equal(self):
|
||||||
version = api_base.Version('1.0')
|
version = api_base.Version('1.0')
|
||||||
self.assertEqual(1, version)
|
self.assertEqual(1, version)
|
||||||
@ -105,6 +108,9 @@ class APIVersionTests(test.TestCase):
|
|||||||
|
|
||||||
# Wrapper classes that only define _attrs don't need extra testing.
|
# Wrapper classes that only define _attrs don't need extra testing.
|
||||||
class APIResourceWrapperTests(test.TestCase):
|
class APIResourceWrapperTests(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
def test_get_attribute(self):
|
def test_get_attribute(self):
|
||||||
resource = APIResource.get_instance()
|
resource = APIResource.get_instance()
|
||||||
self.assertEqual('foo', resource.foo)
|
self.assertEqual('foo', resource.foo)
|
||||||
@ -131,6 +137,9 @@ class APIResourceWrapperTests(test.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class APIDictWrapperTests(test.TestCase):
|
class APIDictWrapperTests(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
# APIDict allows for both attribute access and dictionary style [element]
|
# APIDict allows for both attribute access and dictionary style [element]
|
||||||
# style access. Test both
|
# style access. Test both
|
||||||
def test_get_item(self):
|
def test_get_item(self):
|
||||||
@ -198,6 +207,9 @@ class APIDictWrapperTests(test.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class ApiVersionTests(test.TestCase):
|
class ApiVersionTests(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(ApiVersionTests, self).setUp()
|
super(ApiVersionTests, self).setUp()
|
||||||
self.previous_settings = settings.OPENSTACK_API_VERSIONS
|
self.previous_settings = settings.OPENSTACK_API_VERSIONS
|
||||||
@ -235,6 +247,8 @@ class ApiVersionTests(test.TestCase):
|
|||||||
class ApiHelperTests(test.TestCase):
|
class ApiHelperTests(test.TestCase):
|
||||||
"""Tests for functions that don't use one of the api objects."""
|
"""Tests for functions that don't use one of the api objects."""
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
def test_url_for(self):
|
def test_url_for(self):
|
||||||
url = api_base.url_for(self.request, 'image')
|
url = api_base.url_for(self.request, 'image')
|
||||||
self.assertEqual('http://public.glance.example.com:9292', url)
|
self.assertEqual('http://public.glance.example.com:9292', url)
|
||||||
@ -290,6 +304,8 @@ class ApiHelperTests(test.TestCase):
|
|||||||
|
|
||||||
class QuotaSetTests(test.TestCase):
|
class QuotaSetTests(test.TestCase):
|
||||||
|
|
||||||
|
use_mox = False
|
||||||
|
|
||||||
def test_quotaset_add_with_plus(self):
|
def test_quotaset_add_with_plus(self):
|
||||||
quota_dict = {'foo': 1, 'bar': 10}
|
quota_dict = {'foo': 1, 'bar': 10}
|
||||||
other_quota_dict = {'my_test': 12}
|
other_quota_dict = {'my_test': 12}
|
||||||
|
Loading…
Reference in New Issue
Block a user