def METHOD_NAME(self, con100, tmp_path, requests_mock, status_code):
    source = tmp_path / "foo.txt"
    source.write_text("hello world\n")
    upload_mock = requests_mock.put(
        API_URL + "/files/foo.txt", status_code=status_code
    )
    with pytest.raises(OpenEoApiError, match=rf"\[{status_code}\]"):
        con100.upload_file(source=source)
    assert upload_mock.call_count == 1