Fixed json.dumps no longer works directly with benedict. #34
This commit is contained in:
parent
e6f0f8486c
commit
51169d8a79
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from benedict import benedict
|
||||
|
||||
import json
|
||||
import unittest
|
||||
|
||||
|
||||
class github_issue_0034_test_case(unittest.TestCase):
|
||||
|
||||
"""
|
||||
https://github.com/fabiocaccamo/python-benedict/issues/34
|
||||
|
||||
To run this specific test:
|
||||
- For each method comment @unittest.skip decorator
|
||||
- Run python -m unittest tests.github.test_issue_0034
|
||||
"""
|
||||
|
||||
def test_json_dumps(self):
|
||||
b = benedict({
|
||||
'a': 1,
|
||||
'b': {
|
||||
'c': {
|
||||
'd': 2,
|
||||
},
|
||||
},
|
||||
})
|
||||
dumped = json.dumps(b)
|
||||
self.assertEqual(dumped, '{"a": 1, "b": {"c": {"d": 2}}}')
|
Loading…
Reference in New Issue