tests/testthat/test-acled_deletions_api.R

# Test for acled_deletions_api

# Basic check ----

test_that("number of columns is correct - date", {
  skip_on_cran()
  expect_equal(ncol(received_deleted_data_date), 2)
})


test_that("number of columns is correct - unix", {
  skip_on_cran()
  expect_equal(ncol(received_deleted_data_unix),2)
})

test_that("names of columns are correct - date", {
  skip_on_cran()
  expect_equal(names(received_deleted_data_date), columns_deleted)
})

test_that("names of columns are correct - unix", {
  skip_on_cran()
  expect_equal(names(received_deleted_data_unix), columns_deleted)
})

## Test that email and key are handled appropriately ----

test_that("Email and key are handled as expected without acled_access",{
  skip_on_cran()
  expect_true(grepl("t.billing@acleddata.com", received_deleted_log$email[1]))}
)

test_that("names of columns are correct - unix", {
  skip_on_cran()

  expect_true(all.equal(received_deleted_data_date, received_deleted_data_unix))
})

Try the acledR package in your browser

Any scripts or data that you put into this service are public.

acledR documentation built on Sept. 9, 2025, 5:38 p.m.