tests/testthat/test_check429.r

skip_on_cran()
if(Sys.getenv("OPENGWAS_X_TEST_MODE_KEY") == "") {
    test_that("no allowance", {
        a <- api_query("tophits", query=list(id="ieu-a-2"), override_429=TRUE)

        expect_warning(set_reset(a))
        expect_error(check_reset())
        expect_warning(check_reset(override_429=TRUE))
        expect_error(tophits("ieu-a-2"))
        expect_warning(expect_no_error(api_status()))
        expect_warning(expect_no_error(user()))
        expect_warning(expect_no_error(batches()))

        options(ieugwasr_reset=as.numeric(Sys.time())-1)

        expect_no_error(check_reset())

    })
}

Try the ieugwasr package in your browser

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

ieugwasr documentation built on July 2, 2024, 1:06 a.m.