Giter VIP home page Giter VIP logo

Comments (3)

Bisaloo avatar Bisaloo commented on July 19, 2024

A first set of tests that could be applied to all countries is the column type. This could be either run on get_regional_data() output or directly in the low-level function :

expect_s3_class(adm_level_2, "data.frame")

expect_s3_class(adm_level_2$date, "Date")

expect_type(adm_level_2$region_level_1, "character")
expect_type(adm_level_2$region_level_2, "character")
expect_type(adm_level_2$level_1_region_code, "character")
expect_type(adm_level_2$level_2_region_code, "character")

expect_type(adm_level_2$cases_new, "double")
expect_type(adm_level_2$deaths_new, "double")
expect_type(adm_level_2$hosp_new, "double")
expect_type(adm_level_2$tested_new, "double")
expect_type(adm_level_2$recovered_new, "double")

expect_type(adm_level_2$cases_new, "double")
expect_type(adm_level_2$deaths_new, "double")
expect_type(adm_level_2$hosp_new, "double")
expect_type(adm_level_2$tested_new, "double")
expect_type(adm_level_2$recovered_new, "double")

(Note that I used expect_s3_class() and expect_type() rather than expect_is() on purpose to simplify transition to testthat v3 if this is ever needed.)

I can give it a go at some point if you'd like.

from covidregionaldata.

kathsherratt avatar kathsherratt commented on July 19, 2024

Thanks again @Bisaloo and sorry I haven't got back to you on this issue. Thanks so much for providing sample code! I will have a go at setting up a simple structure to do this, and we can look at strengthening further later on.

from covidregionaldata.

seabbs avatar seabbs commented on July 19, 2024

Should be largely resolved in #141

from covidregionaldata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.