1 ##############################################################################
2 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 from __future__ import absolute_import
12 from api.utils import common
15 class TranslateToStrTestCase(unittest.TestCase):
17 def test_translate_to_str_unicode(self):
19 output_str = common.translate_to_str(input_str)
22 self.assertEqual(result, output_str)
24 def test_translate_to_str_dict_list_unicode(self):
26 u'hello': {u'hello': [u'world']}
28 output_str = common.translate_to_str(input_str)
31 'hello': {'hello': ['world']}
33 self.assertEqual(result, output_str)
40 if __name__ == '__main__':