context("Scorecard precheck")
test_that("Precheck without file invalid", {
rv <- scorecard_precheck()
expect_false(rv$valid)
rv <- scorecard_precheck(NA)
expect_false(rv$valid)
})
test_that("Precheck with bogus file invalid",{
sf <- "testdata/missing.yml"
rv <- scorecard_precheck(sf)
expect_false(rv$valid)
})
test_that("Precheck with proper file valid",{
sf <- "testdata/scorecard.yml"
rv <- scorecard_precheck(sf)
expect_true(rv$valid)
})
test_that("Precheck catches missing configurations",{
sf <- "testdata/scorecard_missing_config.yml"
rv <- scorecard_precheck(sf)
expect_false(rv$valid)
expect_false(rv$has_model_files)
})
test_that("Precheck catches missing sections",{
sf <- "testdata/scorecard_missing_section.yml"
rv <- scorecard_precheck(sf)
expect_false(rv$valid)
expect_false(rv$has_candidate)
expect_false(rv$has_retired)
expect_true(rv$has_activated)
expect_true(rv$has_deactivated)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.