Running ‘testthat.R’ [5s/12s]
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) -----------------
  Internal Server Error (HTTP 500).
  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: Language-variant entity-based geo lookups work (@test_geo.R#13) ------
  Internal Server Error (HTTP 500).
  1: get_geo_entity("Q62", language = "fr") at testthat/test_geo.R:13
  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)
  
  testthat results ================================================================
  OK: 21 SKIPPED: 0 FAILED: 2
  1. Error: Simple entity-based geo lookups work (@test_geo.R#5) 
  2. Error: Language-variant entity-based geo lookups work (@test_geo.R#13) 
  
  Error: testthat unit tests failed
  Execution halted