Fixed json.dumps no longer works directly with benedict. #34

This commit is contained in:
Fabio Caccamo 2020-09-22 15:09:40 +02:00
parent e6f0f8486c
commit 51169d8a79
1 changed files with 29 additions and 0 deletions

View File

@ -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}}}')