示例#1
0
def test_storage_write_resource_existent_error(options):
    resource = Resource(path="data/table.csv")
    storage = resource.to_bigquery(force=True, **options)
    with pytest.raises(FrictionlessException) as excinfo:
        storage.write_resource(resource)
    error = excinfo.value.error
    assert error.code == "storage-error"
    assert error.note.count("already exists")
    # Cleanup storage
    storage.delete_package(list(storage))
示例#2
0
def test_storage_big_file(options):
    source = Resource(name="table", data=[[1]] * 1500)
    storage = source.to_bigquery(force=True, **options)
    target = Resource.from_bigquery(name="table", **options)
    assert len(target.read_rows()) == 1500
    storage.delete_package(list(storage))