tests/testthat/test-GetChart.R

context('GetChart')

test_that("'getURL' errors are handled gracefully", {
    set_zillow_web_service_id('ZWSID')

    with_mock(
        getURL = function(...) {stop('Cryptic getURL error')},
        expect_error(GetChart(zpid = 48749425), "Zillow API call with request '.+' failed with Error in RCurl::getURL\\(request\\): Cryptic getURL error"),
        .env = 'RCurl'
    )
})
fascinatingfingers/ZillowR documentation built on June 5, 2019, 9:27 a.m.