Running ‘testthat.R’ [3s/7s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(WikidataR)
  > 
  > test_check("WikidataR")
  1. Error: Simple entity-based geo lookups work (@test_geo.R#5) -----------------
  Service Unavailable (HTTP 503).
  1: get_geo_entity("Q62") at testthat/test_geo.R:5
  2: clean_geo(sparql_query(query)$results$bindings)
  3: do.call("rbind", lapply(results, function(item) {
         point <- unlist(strsplit(gsub(x = item$coord$value, pattern = "(Point\\(|\\))", 
             replacement = ""), " "))
         wd_id <- gsub(x = item$item$value, pattern = "http://www.wikidata.org/entity/", 
             replacement = "", fixed = TRUE)
         return(data.frame(item = wd_id, name = ifelse(item$name$value == wd_id, NA, item$name$value), 
             latitutde = as.numeric(point[1]), longitude = as.numeric(point[2]), stringsAsFactors = FALSE))
     }))
  4: lapply(results, function(item) {
         point <- unlist(strsplit(gsub(x = item$coord$value, pattern = "(Point\\(|\\))", 
             replacement = ""), " "))
         wd_id <- gsub(x = item$item$value, pattern = "http://www.wikidata.org/entity/", 
             replacement = "", fixed = TRUE)
         return(data.frame(item = wd_id, name = ifelse(item$name$value == wd_id, NA, item$name$value), 
             latitutde = as.numeric(point[1]), longitude = as.numeric(point[2]), stringsAsFactors = FALSE))
     })
  5: sparql_query(query)
  6: httr::stop_for_status(result)
  
  2. Error: Radius restricted entity-based geo lookups work (@test_geo.R#21) -----
  Service Unavailable (HTTP 503).
  1: get_geo_entity("Q62", radius = 1) at testthat/test_geo.R:21
  2: clean_geo(sparql_query(query)$results$bindings)
  3: do.call("rbind", lapply(results, function(item) {
         point <- unlist(strsplit(gsub(x = item$coord$value, pattern = "(Point\\(|\\))", 
             replacement = ""), " "))
         wd_id <- gsub(x = item$item$value, pattern = "http://www.wikidata.org/entity/", 
             replacement = "", fixed = TRUE)
         return(data.frame(item = wd_id, name = ifelse(item$name$value == wd_id, NA, item$name$value), 
             latitutde = as.numeric(point[1]), longitude = as.numeric(point[2]), stringsAsFactors = FALSE))
     }))
  4: lapply(results, function(item) {
         point <- unlist(strsplit(gsub(x = item$coord$value, pattern = "(Point\\(|\\))", 
             replacement = ""), " "))
         wd_id <- gsub(x = item$item$value, pattern = "http://www.wikidata.org/entity/", 
             replacement = "", fixed = TRUE)
         return(data.frame(item = wd_id, name = ifelse(item$name$value == wd_id, NA, item$name$value), 
             latitutde = as.numeric(point[1]), longitude = as.numeric(point[2]), stringsAsFactors = FALSE))
     })
  5: sparql_query(query)
  6: httr::stop_for_status(result)
  
  3. Error: multi-entity geo lookups work (@test_geo.R#29) -----------------------
  Service Unavailable (HTTP 503).
  1: get_geo_entity(c("Q62", "Q64"), radius = 1) at testthat/test_geo.R:29
  2: do.call("rbind", mapply(function(query, entity, ...) {
         output <- clean_geo(sparql_query(query, ...)$results$bindings)
         output$entity <- entity
         return(output)
     }, query = query, entity = entity, ..., SIMPLIFY = FALSE))
  3: mapply(function(query, entity, ...) {
         output <- clean_geo(sparql_query(query, ...)$results$bindings)
         output$entity <- entity
         return(output)
     }, query = query, entity = entity, ..., SIMPLIFY = FALSE)
  4: (function (query, entity, ...) 
     {
         output <- clean_geo(sparql_query(query, ...)$results$bindings)
         output$entity <- entity
         return(output)
     })(query = dots[[1L]][[1L]], entity = dots[[2L]][[1L]])
  5: clean_geo(sparql_query(query, ...)$results$bindings)
  6: do.call("rbind", lapply(results, function(item) {
         point <- unlist(strsplit(gsub(x = item$coord$value, pattern = "(Point\\(|\\))", 
             replacement = ""), " "))
         wd_id <- gsub(x = item$item$value, pattern = "http://www.wikidata.org/entity/", 
             replacement = "", fixed = TRUE)
         return(data.frame(item = wd_id, name = ifelse(item$name$value == wd_id, NA, item$name$value), 
             latitutde = as.numeric(point[1]), longitude = as.numeric(point[2]), stringsAsFactors = FALSE))
     }))
  7: lapply(results, function(item) {
         point <- unlist(strsplit(gsub(x = item$coord$value, pattern = "(Point\\(|\\))", 
             replacement = ""), " "))
         wd_id <- gsub(x = item$item$value, pattern = "http://www.wikidata.org/entity/", 
             replacement = "", fixed = TRUE)
         return(data.frame(item = wd_id, name = ifelse(item$name$value == wd_id, NA, item$name$value), 
             latitutde = as.numeric(point[1]), longitude = as.numeric(point[2]), stringsAsFactors = FALSE))
     })
  8: sparql_query(query, ...)
  9: httr::stop_for_status(result)
  
  testthat results ================================================================
  OK: 18 SKIPPED: 0 FAILED: 3
  1. Error: Simple entity-based geo lookups work (@test_geo.R#5) 
  2. Error: Radius restricted entity-based geo lookups work (@test_geo.R#21) 
  3. Error: multi-entity geo lookups work (@test_geo.R#29) 
  
  Error: testthat unit tests failed
  Execution halted