hyperjson 0.2.4

A hyper-fast Python module for reading/writing JSON data
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest
import hyperjson
from io import StringIO
import json


def test_dump():
    sio = StringIO()
    hyperjson.dump(['streaming API'], sio)
    assert sio.getvalue() == '["streaming API"]'


def test_dump_invalid_writer():
    with pytest.raises(AttributeError):
        json.dump([], '')
    with pytest.raises(AttributeError):
        hyperjson.dump([], '')