inst/tests/testthat/helpers-custom_tests.R

req_and_expect <- function(
                           req, con, is, length, names) {
  req <- call_neo4j(req, con)
  expect_is(req, is)
  expect_length(req, length)
  expect_named(req, names)
}

req_and_expect_graph <- function(
                                 req, con) {
  req <- call_neo4j(req, con, type = "graph")
  expect_is(req, "neo")
  expect_is(req, "list")
  expect_length(req, 2)
  expect_named(req, c("nodes", "relationships"))
  expect_is(req$nodes, "data.frame")
  expect_is(req$relationships, "data.frame")
}
neo4j-rstats/neo4r documentation built on June 5, 2019, 4:36 p.m.