context("test01-caching")
test_that("Check that cache is automatically updated while registering or deleting cached entities", {
# cat("# Now connect to scidb\n")
e0 = tryCatch({rg_connect()}, error = function(e) {e})
if (!("error" %in% class(e0))) { # do not run this on EE installs, mainly targeted for Travis
init_db(arrays_to_init = get_entity_names(), force = TRUE, silent = TRUE)
# Get the existing ontology fields
ont1 = get_ontology()
# Register a dummy ontology field
dummy_val = "dummy"
new_ont_id = register_ontology_term(df = data.frame(term = dummy_val, source_name = "...", source_version = "..."))
# Check that cache is increased by 1 element
ont2 = get_ontology()
expect_equal(nrow(ont2), nrow(ont1) + 1)
# Verify that the dummy term was uploaded properly
expect_true(dummy_val %in% get_ontology()$term)
# Clean-up
init_db(arrays_to_init = get_entity_names(), force = TRUE, silent = TRUE)
}
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.