Running 'testthat.R' [10s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(sgapi)
  > 
  > test_check("sgapi")
  Reading layer `OGRGeoJSON' from data source 
    `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/MSOA_Dec_2011_Boundaries_Generalised_Clipped_BGC_EW_V3_2022/FeatureServer/0/query?where=1%3D1&outFields=*&geometry=-1.282825%2C52.354169%2C0.206626%2C52.7106&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&outSR=4326&geometryPrecision=3&resultOffset=0&f=geojson' 
    using driver `GeoJSON'
  Simple feature collection with 191 features and 11 fields
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: -1.46 ymin: 52.231 xmax: 0.368 ymax: 52.887
  Geodetic CRS:  WGS 84
  Reading layer `OGRGeoJSON' from data source 
    `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/MSOA_Dec_2011_Boundaries_Generalised_Clipped_BGC_EW_V3_2022/FeatureServer/0/query?where=1%3D1&outFields=*&geometry=-1.282825%2C52.354169%2C0.206626%2C52.7106&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&outSR=4326&geometryPrecision=3&resultOffset=200&f=geojson' 
    using driver `GeoJSON'
  Simple feature collection with 0 features and 0 fields
  Bounding box:  xmin: NA ymin: NA xmax: NA ymax: NA
  Geodetic CRS:  WGS 84
  Reading layer `OGRGeoJSON' from data source 
    `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/Local_Authority_Districts_December_2022_UK_BGC_V2/FeatureServer/0/query?where=%20(LAD22NM%20%3D%20'Derbyshire%20Dales'%20OR%20LAD22NM%20%3D%20'Harrogate'%20OR%20LAD22NM%20%3D%20'West%20Northamptonshire')%20&outFields=*&outSR=4326&f=geojson' 
    using driver `GeoJSON'
  Simple feature collection with 3 features and 10 fields
  Geometry type: POLYGON
  Dimension:     XY
  Bounding box:  xmin: -2.004508 ymin: 51.97729 xmax: -0.7050439 ymax: 54.26161
  Geodetic CRS:  WGS 84
  Reading layer `OGRGeoJSON' from data source 
    `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/MSOA_Dec_2011_Boundaries_Generalised_Clipped_BGC_EW_V3_2022/FeatureServer/0/query?where=1%3D1&outFields=*&geometry=52.354169%2C-1.282825%2C52.7106%2C0.206626&geometryType=esriGeometryEnvelope&inSR=4326&spatialRel=esriSpatialRelIntersects&outSR=4326&geometryPrecision=3&resultOffset=0&f=geojson' 
    using driver `GeoJSON'
  Simple feature collection with 0 features and 0 fields
  Bounding box:  xmin: NA ymin: NA xmax: NA ymax: NA
  Geodetic CRS:  WGS 84
  Reading layer `GeoJSONSeq' from data source 
    `https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/Local_Authority_Districts_December_2022_UK_BGC_V2/FeatureServer/0/query?where=%20(L22NM%20%3D%20'Derbyshire%20Dales'%20OR%20L22NM%20%3D%20'Harrogate')%20&outFields=*&outSR=4326&f=geojson' 
    using driver `GeoJSONSeq'
  Re-reading with feature count reset from 1 to 0
  Simple feature collection with 0 features and 0 fields
  Bounding box:  xmin: NA ymin: NA xmax: NA ymax: NA
  Geodetic CRS:  WGS 84
  Chosen Nomis table id or dimension does not exist, see column 'id' in sgapi::nomisTables for available table ids
  [ FAIL 14 | WARN 0 | SKIP 0 | PASS 42 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_available_scales.R:4:13'): A valid table ID
            should return a list
             ──
  Error in `x$overview`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. ├─testthat::expect_type(get_available_scales("NM_1_1"), "list") at test-get_available_scales.R:4:13
   2. │ └─testthat::quasi_label(enquo(object), arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sgapi::get_available_scales("NM_1_1")
  ── Failure ('test-get_overview.R:2:5'): Error is returned for invalid table id ──
  `get_overview("N_1002_1")` did not throw the expected message.
  ── Failure ('test-get_overview.R:16:5'): Error is returned for invalid table id ──
  `get_table_info_brief("02_1")` did not throw the expected message.
  ── Failure ('test-get_structure.R:7:3'): No error is returned for valid table id ──
  Expected `get_structure("NM_187_1", "industry")` to run without any messages.
  i Actually got a <simpleMessage> with text:
    Chosen Nomis table id or dimension does not exist, see column 'id' in sgapi::nomisTables for available table ids
    
  ── Failure ('test-get_structure.R:12:3'): A valid table and dimension returns a list ──
  get_structure("NM_187_1", "industry") has type 'NULL', not 'list'.
  ── Failure ('test-get_structure.R:24:3'): No error is returned for valid table id ──
  Expected `get_structure("NM_4_1", "age_dur")` to run without any messages.
  i Actually got a <simpleMessage> with text:
    Chosen Nomis table id or dimension does not exist, see column 'id' in sgapi::nomisTables for available table ids
    
  ── Failure ('test-get_table.R:2:2'): Valid table ID returns a vector ───────────
  Expected `get_table("NM_1_1", options = list(geography = "TYPE480", time = "latest"))` to run without any errors.
  i Actually got a <simpleError> with text:
    API has failed, review the filters applied. The status code is: 406
  ── Error ('test-get_table.R:8:3'): Valid query returning over 25,000 rows sends a warning ──
  Error in `assert_function(raw_data$status_code >= 400L, paste0("API has failed, review the filters applied. The status code is: ", 
      raw_data$status_code))`: API has failed, review the filters applied. The status code is: 406
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(get_table("NM_105_1", options = paste0(time = "latest"))) at test-get_table.R:8:3
   2. │ └─testthat:::expect_condition_matching(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─sgapi::get_table("NM_105_1", options = paste0(time = "latest"))
   8.   └─sgapi::assert_function(...)
  ── Failure ('test-get_table.R:13:3'): Valid table ID returns a vector ──────────
  Expected `get_table(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    API has failed, review the filters applied. The status code is: 406
  ── Failure ('test-get_table.R:18:3'): Valid table ID returns a vector ──────────
  Expected `get_table(...)` to run without any errors.
  i Actually got a <simpleError> with text:
    API has failed, review the filters applied. The status code is: 406
  ── Error ('test-get_table.R:23:3'): Valid table ID returns a list ──────────────
  Error in `assert_function(raw_data$status_code >= 400L, paste0("API has failed, review the filters applied. The status code is: ", 
      raw_data$status_code))`: API has failed, review the filters applied. The status code is: 406
  Backtrace:
      ▆
   1. ├─testthat::expect_type(...) at test-get_table.R:23:3
   2. │ └─testthat::quasi_label(enquo(object), arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sgapi::get_table(...)
   5.   └─sgapi::assert_function(...)
  ── Error ('test-get_table_dimensions.R:14:3'): Valid table ID returns a list ───
  Error in `get_overview(id)$overview`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. ├─testthat::expect_type(get_table_dimensions("NM_102_1"), "list") at test-get_table_dimensions.R:14:3
   2. │ └─testthat::quasi_label(enquo(object), arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sgapi::get_table_dimensions("NM_102_1")
  ── Error ('test-get_table_dimensions.R:20:3'): Valid table ID returns a list ───
  Error in `get_overview(id)$overview`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. ├─testthat::expect_type(get_table_dimensions("NM_1042_1"), "list") at test-get_table_dimensions.R:20:3
   2. │ └─testthat::quasi_label(enquo(object), arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sgapi::get_table_dimensions("NM_1042_1")
  ── Error ('test-list_data_sources.R:2:3'): returns a list ──────────────────────
  Error in `y$contenttype`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. ├─testthat::expect_type(list_data_sources(), "list") at test-list_data_sources.R:2:3
   2. │ └─testthat::quasi_label(enquo(object), arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─sgapi::list_data_sources()
  
  [ FAIL 14 | WARN 0 | SKIP 0 | PASS 42 ]
  Error: Test failures
  Execution halted