tests/testthat/test_make_output_nodes.R

test_that("make_output_nodes works correctly with 1 field", {
  onodes1 <- make_output_nodes(name = list("OutputField"), attributes = list(name = "name3", dataType = "double", optype = "continuous"))
  expect_equal(length(onodes1), 1)
  expect_equal(names(xmlToList(onodes1[[1]]))[1], "name")
  expect_equal(as.character(xmlToList(onodes1[[1]])[1]), "name3")
  expect_equal(names(xmlToList(onodes1[[1]]))[2], "dataType")
  expect_equal(as.character(xmlToList(onodes1[[1]]))[2], "double")
  expect_equal(names(xmlToList(onodes1[[1]]))[3], "optype")
  expect_equal(as.character(xmlToList(onodes1[[1]]))[3], "continuous")
})

Try the pmml package in your browser

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

pmml documentation built on March 18, 2022, 5:49 p.m.