示例#1
0
def test_path():
    expected = '{"Path": ["bar", false]}'
    assert json.dumps(db_attrs.Path('bar'), cls=QueryEncoder) == expected
示例#2
0
def test_path_inverted():
    expected = '{"Path": ["bar", true]}'
    assert json.dumps(~db_attrs.Path('bar'), cls=QueryEncoder) == expected
示例#3
0
def test_decode_path():
    dump = '{"Path": ["bar", false]}'
    assert json.loads(dump, object_hook=query_decode) == db_attrs.Path('bar')