minio.S3Error

Here are the examples of the python api minio.S3Error taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

3 Source : test_model.py
with GNU General Public License v3.0
from projectcaluma

def test_missing_file(db, file, mocker, should_raise):
    mocker.patch.object(
        Minio,
        "copy_object",
        side_effect=S3Error(
            code="SomeOtherError" if should_raise else "NoSuchKey",
            message="",
            resource="test_object",
            request_id="",
            host_id="",
            response=None,
        ),
    )

    if should_raise:
        with pytest.raises(S3Error):
            file.copy()
    else:
        file.copy()