Drop anyjson

oslo.serialization is a drop in replacement and already being used

Change-Id: I479221a9d4ec34cfef951d127af249e8c9432c29
This commit is contained in:
Abhishek Chanda 2014-12-13 20:59:56 +05:30
parent e3d6921715
commit 1cd9d727b2
3 changed files with 9 additions and 11 deletions

View File

@ -15,9 +15,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import anyjson
import mock
from oslo.config import fixture as fixture_config
from oslo.serialization import jsonutils
from oslotest import mockpatch
import requests
import six.moves.urllib.parse as urlparse
@ -27,7 +27,7 @@ from ceilometer.openstack.common import context
from ceilometer.tests import base as tests_base
DATA_JSON = anyjson.loads(
DATA_JSON = jsonutils.loads(
'{"current": "ALARM", "alarm_id": "foobar", "alarm_name": "testalarm",'
' "reason": "what ?", "reason_data": {"test": "test"},'
' "previous": "OK"}'
@ -120,7 +120,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
headers=mock.ANY)
args, kwargs = poster.call_args
self.assertEqual(self.HTTP_HEADERS, kwargs['headers'])
self.assertEqual(DATA_JSON, anyjson.loads(kwargs['data']))
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
def test_notify_alarm_rest_action_with_ssl_client_cert(self):
action = 'https://host/action'
@ -138,7 +138,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
cert=certificate, verify=True)
args, kwargs = poster.call_args
self.assertEqual(self.HTTP_HEADERS, kwargs['headers'])
self.assertEqual(DATA_JSON, anyjson.loads(kwargs['data']))
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
def test_notify_alarm_rest_action_with_ssl_client_cert_and_key(self):
action = 'https://host/action'
@ -159,7 +159,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
cert=(certificate, key), verify=True)
args, kwargs = poster.call_args
self.assertEqual(self.HTTP_HEADERS, kwargs['headers'])
self.assertEqual(DATA_JSON, anyjson.loads(kwargs['data']))
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
def test_notify_alarm_rest_action_with_ssl_verify_disable_by_cfg(self):
action = 'https://host/action'
@ -176,7 +176,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
verify=False)
args, kwargs = poster.call_args
self.assertEqual(self.HTTP_HEADERS, kwargs['headers'])
self.assertEqual(DATA_JSON, anyjson.loads(kwargs['data']))
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
def test_notify_alarm_rest_action_with_ssl_verify_disable(self):
action = 'https://host/action?ceilometer-alarm-ssl-verify=0'
@ -190,7 +190,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
verify=False)
args, kwargs = poster.call_args
self.assertEqual(self.HTTP_HEADERS, kwargs['headers'])
self.assertEqual(DATA_JSON, anyjson.loads(kwargs['data']))
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
def test_notify_alarm_rest_action_with_ssl_verify_enable_by_user(self):
action = 'https://host/action?ceilometer-alarm-ssl-verify=1'
@ -207,7 +207,7 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
verify=True)
args, kwargs = poster.call_args
self.assertEqual(self.HTTP_HEADERS, kwargs['headers'])
self.assertEqual(DATA_JSON, anyjson.loads(kwargs['data']))
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))
@staticmethod
def _fake_urlsplit(*args, **kwargs):
@ -261,4 +261,4 @@ class TestAlarmNotifier(tests_base.BaseTestCase):
url, data=mock.ANY, headers=mock.ANY)
args, kwargs = poster.call_args
self.assertEqual(headers, kwargs['headers'])
self.assertEqual(DATA_JSON, anyjson.loads(kwargs['data']))
self.assertEqual(DATA_JSON, jsonutils.loads(kwargs['data']))

View File

@ -3,7 +3,6 @@
# process, which may cause wedges in the gate later.
alembic>=0.6.4
anyjson>=0.3.3
argparse
croniter>=0.3.4 # MIT License
eventlet>=0.15.2

View File

@ -4,7 +4,6 @@
retrying>=1.2.2,!=1.3.0 # Apache-2.0
alembic>=0.6.4
anyjson>=0.3.3
argparse
croniter>=0.3.4 # MIT License
eventlet>=0.15.2