示例#1
0
 def test_encode_to_keys_to_camelcase(self):
     encoder = JsonEncoder(None)
     result = encoder.encode({'my_name': 1})
     assert 'myName' in result
示例#2
0
 def test_decode_dict_keys_from_camelcase(self):
     encoder = JsonEncoder(None)
     result = encoder.decode('{"myAge": 25}')
     assert 'my_age' in result
示例#3
0
 def test_decode_deep_keys_from_camelcase(self):
     encoder = JsonEncoder(None)
     result = encoder.decode('{"myAge":{"thisOneIsGood":true}}')
     assert 'my_age' in result
     assert 'this_one_is_good' in result['my_age']
示例#4
0
 def test_encode_deep_dict_to_camelcase(self):
     encoder = JsonEncoder(None)
     result = encoder.encode({'my_dict': {'another_dict': 1}})
     assert 'myDict' in result
     assert 'anotherDict' in result
示例#5
0
 def test_encode_to_keys_to_camelcase(self):
     encoder = JsonEncoder(None)
     result = encoder.encode({'my_name': 1})
     assert 'myName' in result
示例#6
0
 def test_decode_deep_keys_from_camelcase(self):
     encoder = JsonEncoder(None)
     result = encoder.decode('{"myAge":{"thisOneIsGood":true}}')
     assert 'my_age' in result
     assert 'this_one_is_good' in result['my_age']
示例#7
0
 def test_decode_dict_keys_from_camelcase(self):
     encoder = JsonEncoder(None)
     result = encoder.decode('{"myAge": 25}')
     assert 'my_age' in result
示例#8
0
 def test_encode_deep_dict_to_camelcase(self):
     encoder = JsonEncoder(None)
     result = encoder.encode({'my_dict': {'another_dict': 1}})
     assert 'myDict' in result
     assert 'anotherDict' in result