test_json.py
21 lines
| 389 B
| text/x-python
|
PythonLexer
Brian E. Granger
|
r4533 | import pprint | ||
Brian E. Granger
|
r4406 | from unittest import TestCase | ||
from ..nbjson import reads, writes | ||||
from .nbexamples import nb0 | ||||
class TestJSON(TestCase): | ||||
def test_roundtrip(self): | ||||
s = writes(nb0) | ||||
Brian E. Granger
|
r4533 | |||
# print pprint.pformat(nb0,indent=2) | ||||
# print pprint.pformat(reads(s),indent=2) | ||||
# print s | ||||
Brian E. Granger
|
r4406 | self.assertEquals(reads(s),nb0) | ||