Error in `utils::download.file(qm, method = "wininet", headers = c(Accept = acceptype), 
    tempfile)`: cannot open URL 'http://example.org/sparql?query=SELECT%20%2A%20WHERE%20%7B%3Fs%20%3Fp%20%3Fo%7D'

query <- "PREFIX up: <http://purl.uniprot.org/core/>
test_that("Calls sparql2list and assings a list to output.var when output.type = 'list'", {
results = "markup" # required to avoid 'missing value' error
test_that("Calls sparql2df and assings a data.frame to output.var when output.type = 'dataframe'", {
results = "markup"     # required to avoid 'missing value' error
test_that("Automatically assigns output.type and output.var when not defined, but triggers sparql2df", {
test_that("sparql2list throws error with sprintf when content access fails", {
# Force get_outcontent to return a string instead of list
# Create a mock for get_outcontent that returns a broken object
# Stub get_outcontent inside sparql2list
sparql2list("http://example.org", "SELECT * WHERE {?s ?p ?o}"),
regexp = "There is something wrong with the retrieved data: not_a_list"
test_that("return is of correct type", {
skip_on_cran()  # if network access is needed
query <- "PREFIX schema: <http://schema.org/>
proxy_config <- httr::use_proxy(url = NULL)
expect_type(get_outcontent(endpoint, query, acceptype, proxy_config), "list")
test_that("Windows fallback is used when httr::GET fails", {
stub(get_outcontent, "httr::GET", function(...) stop("Simulated GET failure"))
# Stub download.file and related functions
stub(get_outcontent, "readLines", function(...) "mock response")
test_that("fallback block is triggered when content is NULL", {
# Mock httr::GET to return a response that leads to NULL content
mock_get <- mock(list(status = 200), cycle = TRUE)
mock_content <- mock(NULL, cycle = TRUE)  # Simulate NULL content
# Check that fallback content is returned (e.g., from download.file or NULL)

"PREFIX up: <http://purl.uniprot.org/core/>
SELECT ?taxon
FROM <http://sparql.uniprot.org/taxonomy>
WHERE {
	?taxon a up:Taxon .
} LIMIT 500"
"Calls sparql2list and assings a list to output.var when output.type = 'list'"
# required to avoid 'missing value' error
"Calls sparql2df and assings a data.frame to output.var when output.type = 'dataframe'"
"Automatically assigns output.type and output.var when not defined, but triggers sparql2df"
"sparql2list throws error with sprintf when content access fails"
"There is something wrong with the retrieved data: not_a_list"
"PREFIX schema: <http://schema.org/>
	   SELECT * WHERE {
	   ?sub a schema:DataCatalog .
     ?subtype a schema:DataType .
	}"
"Windows fallback is used when httr::GET fails"
"fallback block is triggered when content is NULL"

fallback block is triggered when content is NULL