Running 'testthat.R'
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > Sys.setenv("R_TESTS" = "") # Added based on suggestion here: https://github.com/r-lib/testthat/issues/86
  > library(testthat)
  > library(priceR)
  > 
  > test_check("priceR")
  
  Attaching package: 'dplyr'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  
  Attaching package: 'lubridate'
  
  The following objects are masked from 'package:base':
  
      date, intersect, setdiff, union
  
  
  Attaching package: 'purrr'
  
  The following object is masked from 'package:jsonlite':
  
      flatten
  
  The following object is masked from 'package:testthat':
  
      is_null
  
  Using libcurl 7.64.1 with Schannel
  Validating iso2Code for AU 
  Generating URL to request all 299 results
  Retrieving inflation data for AU 
  Generating URL to request all 61 results
  Generating URL to request all 299 results
  Generating URL to request all 299 results
  Validating iso2Code for AU 
  Generating URL to request all 299 results
  Retrieving inflation data for AU 
  Generating URL to request all 61 results
  Validating iso2Code for Australia 
  Generating URL to request all 299 results
  Validating iso2Code for AustraTESTlia 
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test_adjust_for_inflation.R:16:3): url_all_results() correctly converts URL to JSON ──
  Error in `open.connection(con, "rb")`: HTTP error 502.
  Backtrace:
       █
    1. ├─testthat::expect_gt(...) test_adjust_for_inflation.R:16:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─url_all_results(original_url) %>% fromJSON %>% .[[2]] %>% nrow
    5. ├─base::nrow(.)
    6. ├─jsonlite::fromJSON(.)
    7. ├─priceR::url_all_results(original_url)
    8. │ └─original_url %>% fromJSON %>% .[[1]] %>% .$total
    9. └─jsonlite::fromJSON(.)
   10.   └─jsonlite:::parse_and_simplify(...)
   11.     └─jsonlite:::parseJSON(txt, bigint_as_char)
   12.       └─jsonlite:::parse_con(txt, bigint_as_char)
   13.         ├─base::open(con, "rb")
   14.         └─base::open.connection(con, "rb")
  ── Error (test_adjust_for_inflation.R:32:3): url_all_results() correctly retreives WB API data ──
  Error in `open.connection(con, "rb")`: HTTP error 502.
  Backtrace:
       █
    1. ├─testthat::expect_gt(...) test_adjust_for_inflation.R:32:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─url_all_results(original_url) %>% fromJSON %>% .[[2]] %>% nrow
    5. ├─base::nrow(.)
    6. ├─jsonlite::fromJSON(.)
    7. ├─priceR::url_all_results(original_url)
    8. │ └─original_url %>% fromJSON %>% .[[1]] %>% .$total
    9. └─jsonlite::fromJSON(.)
   10.   └─jsonlite:::parse_and_simplify(...)
   11.     └─jsonlite:::parseJSON(txt, bigint_as_char)
   12.       └─jsonlite:::parse_con(txt, bigint_as_char)
   13.         ├─base::open(con, "rb")
   14.         └─base::open.connection(con, "rb")
  ── Error (test_adjust_for_inflation.R:86:3): Inflation data is retrieved as expected for country_name input ──
  Error in `open.connection(con, "rb")`: HTTP error 502.
  Backtrace:
       █
    1. ├─testthat::expect_gt(...) test_adjust_for_inflation.R:86:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─retrieve_inflation_data(country) %>% .[[2]] %>% nrow
    5. ├─base::nrow(.)
    6. ├─priceR::retrieve_inflation_data(country)
    7. │ └─priceR::show_countries()
    8. │   └─countries_url %>% fromJSON(.)
    9. └─jsonlite::fromJSON(.)
   10.   └─jsonlite:::parse_and_simplify(...)
   11.     └─jsonlite:::parseJSON(txt, bigint_as_char)
   12.       └─jsonlite:::parse_con(txt, bigint_as_char)
   13.         ├─base::open(con, "rb")
   14.         └─base::open.connection(con, "rb")
  ── Failure (test_adjust_for_inflation.R:91:3): Retrieval of inflation data for an invalid input fails with appropriate error message ──
  `retrieve_inflation_data(country) %>% .[[2]] %>% nrow` threw an error with unexpected message.
  Expected match: "'AustraTESTlia' is not a valid country input - select a valid country from show_countries()"
  Actual message: "HTTP error 502."
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test_adjust_for_inflation.R:91:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─retrieve_inflation_data(country) %>% .[[2]] %>% nrow
    7. ├─base::nrow(.)
    8. ├─priceR::retrieve_inflation_data(country)
    9. │ └─priceR::show_countries()
   10. │   └─"http://api.worldbank.org/v2/country?format=json" %>% url_all_results(.)
   11. ├─priceR::url_all_results(.)
   12. │ └─original_url %>% fromJSON %>% .[[1]] %>% .$total
   13. └─jsonlite::fromJSON(.)
   14.   └─jsonlite:::parse_and_simplify(...)
   15.     └─jsonlite:::parseJSON(txt, bigint_as_char)
   16.       └─jsonlite:::parse_con(txt, bigint_as_char)
   17.         ├─base::open(con, "rb")
   18.         └─base::open.connection(con, "rb")
  
  [ FAIL 4 | WARN 0 | SKIP 0 | PASS 22 ]
  Error: Test failures
  Execution halted