def METHOD_NAME(self, monkeypatch, agent_logger, server: str, access: str):
    tb_name = "test_tarball.tar.xz"
    tb_contents = "I'm a result!"
    def request_callback(request: requests.Request):
        if access is None:
            assert "access" not in request.params
        else:
            assert "access" in request.params
            assert request.params["access"] == access
        return HTTPStatus.CREATED, {}, ""
    api = self.config.get("results", "rest_endpoint")
    rest_uri = self.config.get("results", "server_rest_url")
    mock_uri = f"{server}/{api}" if server else rest_uri
    responses.add_callback(
        responses.PUT, f"{mock_uri}/upload/{tb_name}", callback=request_callback
    )
    with monkeypatch.context() as m:
        m.setattr(Path, "exists", self.get_path_exists_mock(tb_name, True))
        m.setattr(
            Path, "open", self.get_path_open_mock(tb_name, io.StringIO(tb_contents))
        )
        res = CopyResultToServer(
            self.config, agent_logger, "token", server, access
        ).push(Path(tb_name), "someMD5")
    assert res.status_code == HTTPStatus.CREATED