Merge "Update json module to jsonutils"
This commit is contained in:
@@ -10,9 +10,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
from oslo_serialization import jsonutils
|
||||||
|
|
||||||
from osc_lib.tests import utils
|
from osc_lib.tests import utils
|
||||||
from senlinclient.common import format_utils
|
from senlinclient.common import format_utils
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ class TestFormats(utils.TestCommand):
|
|||||||
def test_json_format(self):
|
def test_json_format(self):
|
||||||
self.cmd = ShowJson(self.app, None)
|
self.cmd = ShowJson(self.app, None)
|
||||||
parsed_args = self.check_parser(self.cmd, [], [])
|
parsed_args = self.check_parser(self.cmd, [], [])
|
||||||
expected = json.dumps(dict(zip(columns, data)), indent=2)
|
expected = jsonutils.dumps(dict(zip(columns, data)), indent=2)
|
||||||
|
|
||||||
self.cmd.run(parsed_args)
|
self.cmd.run(parsed_args)
|
||||||
|
|
||||||
|
@@ -12,12 +12,11 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import json
|
|
||||||
import mock
|
import mock
|
||||||
from osc_lib.tests import utils
|
from osc_lib.tests import utils
|
||||||
import requests
|
import requests
|
||||||
import six
|
|
||||||
|
|
||||||
|
from oslo_serialization import jsonutils
|
||||||
|
|
||||||
AUTH_TOKEN = "foobar"
|
AUTH_TOKEN = "foobar"
|
||||||
AUTH_URL = "http://0.0.0.0"
|
AUTH_URL = "http://0.0.0.0"
|
||||||
@@ -158,9 +157,7 @@ class FakeResponse(requests.Response):
|
|||||||
self.status_code = status_code
|
self.status_code = status_code
|
||||||
|
|
||||||
self.headers.update(headers)
|
self.headers.update(headers)
|
||||||
self._content = json.dumps(data)
|
self._content = jsonutils.dump_as_bytes(data)
|
||||||
if not isinstance(self._content, six.binary_type):
|
|
||||||
self._content = self._content.encode()
|
|
||||||
|
|
||||||
|
|
||||||
class FakeClusteringv1Client(object):
|
class FakeClusteringv1Client(object):
|
||||||
|
Reference in New Issue
Block a user