Пример #1
0
def load_opts_schemas(opts):
    paths = opts["<schemas>"]
    if not paths:
        return []

    schemas = []
    for p in paths:
        schemas += kson.load_schemas(p)
    return schemas
Пример #2
0
def load_opts_schemas(opts):
    paths = opts['<schemas>']
    if not paths:
        return []

    schemas = []
    for p in paths:
        schemas += kson.load_schemas(p)
    return schemas
Пример #3
0
def test_load_file():
    kson.load_schemas(FIXTURES_PATH + "movie_schemas.kson")
    movies = kson.load(FIXTURES_PATH + "movies.kson")
    assert data_eq(movies, MOVIE_DATA)
Пример #4
0
def test_multi_schema_loading():
    kson.load_schemas(FIXTURES_PATH + "movie_schemas.kson")
    assert kson.SCHEMAS['movies-item'] == MOVIE_SCHEMAS[0]
    assert kson.SCHEMAS['movies-content'] == MOVIE_SCHEMAS[1]
    assert kson.SCHEMAS['movies-status'] == MOVIE_SCHEMAS[2]
    assert kson.SCHEMAS['movies'] == MOVIE_SCHEMAS[3]