Esempio n. 1
0
def test_modelize_double_quote_string():
    s = "'"
    assert loads(dumps(modelize(s), dumper=ModelDumper())) == s
Esempio n. 2
0
def test_modelize_nan():
    obj = math.nan
    assert loads(dumps(modelize(obj), dumper=ModelDumper())) is obj
Esempio n. 3
0
def test_repr_does_not_contain_wsc():
    model = modelize({'foo': 'bar'})
    assert 'wsc' not in repr(model)
Esempio n. 4
0
def test_modelize_objects(obj):
    assert loads(dumps(modelize(obj), dumper=ModelDumper())) == obj
Esempio n. 5
0
def test_modelizing_unknown_object_raises_error():
    class Foo:
        ...
    f = Foo()
    with pytest.raises(NotImplementedError):
        modelize(f)