Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(essurvey)
  
  Please cite as: 
  
  Cimentada, Jorge (2019). Download Data from the European Social Survey on the Fly R package version 1.0.2.
  > 
  > test_check("essurvey")
  ── 1. Error: show_rounds returns correct output (@test-1-show_.R#23)  ──────────
  Service Unavailable (HTTP 503).
  Backtrace:
   1. essurvey::show_rounds()
   2. essurvey:::get_rounds_link(.global_vars$ess_website)
   3. essurvey:::safe_GET(paste0(ess_website, "/data/download.html?r="))
   4. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 2. Failure: show_rounds_country returns error when arguments are wrong (@test
  `show_rounds_country("whatever")` threw an error with unexpected message.
  Expected match: "ESS round whatever is not available. Check show_rounds()"
  Actual message: "Service Unavailable (HTTP 503)."
  Backtrace:
    1. testthat::expect_error(show_rounds_country("whatever"), "ESS round whatever is not available. Check show_rounds()")
    6. essurvey::show_rounds_country("whatever")
    7. essurvey:::check_rounds(rounds)
    9. essurvey::show_rounds()
   10. essurvey:::get_rounds_link(.global_vars$ess_website)
   11. essurvey:::safe_GET(paste0(ess_website, "/data/download.html?r="))
   12. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 3. Failure: show_rounds_country returns error when arguments are wrong (@test
  `show_rounds_country(100:110)` threw an error with unexpected message.
  Expected match: "ESS round 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110 is not available. Check show_rounds()"
  Actual message: "Service Unavailable (HTTP 503)."
  Backtrace:
    1. testthat::expect_error(show_rounds_country(100:110), "ESS round 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110 is not available. Check show_rounds()")
    6. essurvey::show_rounds_country(100:110)
    7. essurvey:::check_rounds(rounds)
    9. essurvey::show_rounds()
   10. essurvey:::get_rounds_link(.global_vars$ess_website)
   11. essurvey:::safe_GET(paste0(ess_website, "/data/download.html?r="))
   12. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 4. Error: show_rounds_country returns correct output (@test-1-show_.R#41)  ──
  Service Unavailable (HTTP 503).
  Backtrace:
   1. essurvey::show_rounds_country(1)
   2. essurvey:::check_rounds(rounds)
   4. essurvey::show_rounds()
   5. essurvey:::get_rounds_link(.global_vars$ess_website)
   6. essurvey:::safe_GET(paste0(ess_website, "/data/download.html?r="))
   7. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 5. Error: show_rounds_country returns non-duplicate rounds (@test-1-show_.R#5
  Service Unavailable (HTTP 503).
  Backtrace:
    1. testthat::expect_false(all(duplicated(show_rounds_country(1:6))))
    5. essurvey::show_rounds_country(1:6)
    6. essurvey:::check_rounds(rounds)
    8. essurvey::show_rounds()
    9. essurvey:::get_rounds_link(.global_vars$ess_website)
   10. essurvey:::safe_GET(paste0(ess_website, "/data/download.html?r="))
   11. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 6. Error: show_rounds_country returns correct countries always (@test-1-show_
  Service Unavailable (HTTP 503).
  Backtrace:
    1. testthat::expect_equal(show_rounds_country(1:3), one_to_three)
    4. essurvey::show_rounds_country(1:3)
    5. essurvey:::check_rounds(rounds)
    7. essurvey::show_rounds()
    8. essurvey:::get_rounds_link(.global_vars$ess_website)
    9. essurvey:::safe_GET(paste0(ess_website, "/data/download.html?r="))
   10. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 7. Error: show_countries returns correct output (@test-1-show_.R#75)  ───────
  Service Unavailable (HTTP 503).
  Backtrace:
   1. essurvey::show_countries()
   2. essurvey:::show_any(.global_vars$ess_website, .global_vars$country_index)
   3. essurvey:::table_to_list(ess_website, module_index)
   4. essurvey:::safe_GET(paste0(ess_website, module_index))
   5. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 8. Failure: show_country_rounds returns error when wrong country as argument 
  `show_country_rounds("whatever")` threw an error with unexpected message.
  Expected match: "Country whatever not available in ESS. Check show_countries()"
  Actual message: "Service Unavailable (HTTP 503)."
  Backtrace:
    1. testthat::expect_error(show_country_rounds("whatever"), "Country whatever not available in ESS. Check show_countries()")
    6. essurvey::show_country_rounds("whatever")
    7. essurvey:::check_country(country)
    9. essurvey::show_countries()
   10. essurvey:::show_any(.global_vars$ess_website, .global_vars$country_index)
   11. essurvey:::table_to_list(ess_website, module_index)
   12. essurvey:::safe_GET(paste0(ess_website, module_index))
   13. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 9. Error: show_country_rounds returns correct output (@test-1-show_.R#87)  ──
  Service Unavailable (HTTP 503).
  Backtrace:
   1. essurvey::show_country_rounds("Denmark")
   2. essurvey:::check_country(country)
   4. essurvey::show_countries()
   5. essurvey:::show_any(.global_vars$ess_website, .global_vars$country_index)
   6. essurvey:::table_to_list(ess_website, module_index)
   7. essurvey:::safe_GET(paste0(ess_website, module_index))
   8. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 10. Error: show_themes returns correct output (@test-1-show_.R#98)  ─────────
  Service Unavailable (HTTP 503).
  Backtrace:
   1. essurvey::show_themes()
   2. essurvey:::show_any(.global_vars$ess_website, .global_vars$theme_index)
   3. essurvey:::table_to_list(ess_website, module_index)
   4. essurvey:::safe_GET(paste0(ess_website, module_index))
   5. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 11. Failure: show_theme_rounds returns error when wrong theme as argument (@t
  `show_theme_rounds("whatever")` threw an error with unexpected message.
  Expected match: "ESS theme whatever not available. Check show_themes()"
  Actual message: "Service Unavailable (HTTP 503)."
  Backtrace:
    1. testthat::expect_error(show_theme_rounds("whatever"), "ESS theme whatever not available. Check show_themes()")
    6. essurvey::show_theme_rounds("whatever")
    7. essurvey:::check_theme(theme)
    9. essurvey::show_themes()
   10. essurvey:::show_any(.global_vars$ess_website, .global_vars$theme_index)
   11. essurvey:::table_to_list(ess_website, module_index)
   12. essurvey:::safe_GET(paste0(ess_website, module_index))
   13. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 12. Error: show_theme_rounds returns correct output for rounds  == 1 (@test-1
  Service Unavailable (HTTP 503).
  Backtrace:
   1. essurvey::show_theme_rounds("Democracy")
   2. essurvey:::check_theme(theme)
   4. essurvey::show_themes()
   5. essurvey:::show_any(.global_vars$ess_website, .global_vars$theme_index)
   6. essurvey:::table_to_list(ess_website, module_index)
   7. essurvey:::safe_GET(paste0(ess_website, module_index))
   8. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 13. Error: show_theme_rounds returns correct output for rounds > 1 (@test-1-s
  Service Unavailable (HTTP 503).
  Backtrace:
   1. essurvey::show_theme_rounds("Politics")
   2. essurvey:::check_theme(theme)
   4. essurvey::show_themes()
   5. essurvey:::show_any(.global_vars$ess_website, .global_vars$theme_index)
   6. essurvey:::table_to_list(ess_website, module_index)
   7. essurvey:::safe_GET(paste0(ess_website, module_index))
   8. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 14. Error: Test that all current ESS countries have equivalent country lookup
  Service Unavailable (HTTP 503).
  Backtrace:
   1. essurvey::show_countries()
   2. essurvey:::show_any(.global_vars$ess_website, .global_vars$country_index)
   3. essurvey:::table_to_list(ess_website, module_index)
   4. essurvey:::safe_GET(paste0(ess_website, module_index))
   5. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ── 15. Failure: authenticate works correctly for wrong emails (@test-7-set_email
  `authenticate("random@email.morerandom")` threw an error with unexpected message.
  Expected match: "email address you provided is not associated with any registered"
  Actual message: "Service Unavailable (HTTP 503)."
  Backtrace:
   1. testthat::expect_error(...)
   6. essurvey:::authenticate("random@email.morerandom")
   7. essurvey:::safe_GET(url_login, query = values)
   8. httr::stop_for_status(httr::GET(url = url, config = config, ...))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 5 | SKIPPED: 16 | WARNINGS: 5 | FAILED: 15 ]
  1. Error: show_rounds returns correct output (@test-1-show_.R#23) 
  2. Failure: show_rounds_country returns error when arguments are wrong (@test-1-show_.R#33) 
  3. Failure: show_rounds_country returns error when arguments are wrong (@test-1-show_.R#36) 
  4. Error: show_rounds_country returns correct output (@test-1-show_.R#41) 
  5. Error: show_rounds_country returns non-duplicate rounds (@test-1-show_.R#51) 
  6. Error: show_rounds_country returns correct countries always (@test-1-show_.R#70) 
  7. Error: show_countries returns correct output (@test-1-show_.R#75) 
  8. Failure: show_country_rounds returns error when wrong country as argument (@test-1-show_.R#82) 
  9. Error: show_country_rounds returns correct output (@test-1-show_.R#87) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted