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