Beispiel #1
0
def test_get_schema_fails_on_type():
    with pytest.raises(ValueError) as excinfo:
        Schema.read(1)
    assert (
        str(excinfo.value) ==
        '"1" is an unidentified schema source.\nA dict, a full s3 path or URL is expected'
    )
Beispiel #2
0
def test_read_schema_fails(mocker, source, downloaded_schema, expected_error):
    mocker.patch(
        "arche.readers.schema.Schema.from_url",
        return_value=downloaded_schema,
        autospec=True,
    )
    with pytest.raises(expected_error):
        Schema.read(source)
Beispiel #3
0
def test_read_schema(mocker, source, downloaded, expected):
    mocker.patch("arche.readers.schema.Schema.from_url",
                 return_value=downloaded,
                 autospec=True)
    assert Schema.read(source) == expected