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