prepare_test_import: Prepare example import inside a git repo

View source: R/helper_testing.R

prepare_test_importR Documentation

Prepare example import inside a git repo

Description

Copies an example import to a new temp directory, sets up git for the directory and creates a test SQLite DB in the temp directory as test.sqlite.

Usage

prepare_test_import(
  example_dir = "example",
  dettl_config = "dettl_config.yml",
  create_db = TRUE,
  add_data = FALSE,
  add_job_table = FALSE,
  add_log_table = TRUE,
  add_fk_data = FALSE,
  add_cyclic_fks = FALSE
)

Arguments

example_dir

The example directory to copy to temp.

dettl_config

Path to the dettl config file.

create_db

If TRUE then test SQLite db will be created

add_data

If TRUE data is bootstrapped to people table in test DB.

add_job_table

If TRUE also bootstrap job table related to people table.

add_log_table

If TRUE then also bootstrap log table.

add_fk_data

If TRUE then bootstrap three tables with foreign key

add_cyclic_fks

If TRUE then bootstrap two tables with cyclic foreign key constraints. constraints for testing automatic reading of foreign key constraints from db.

Details

This should only be called from a test, vignette or roxygen example.

Examples

dettl:::prepare_test_import(
  system.file("examples", "person_information", package = "dettl"),
  system.file("examples", "dettl_config.yml", package = "dettl")
)

vimc/dettl documentation built on Oct. 6, 2022, 2:13 p.m.