Exemplo n.º 1
0
def generate_reports_usa(
    *, workers, kernel_name, wwwroot, force, disable_pbar, debug
):
    _ = oscovida.fetch_cases_US()
    _ = oscovida.fetch_deaths_US()

    #  TODO: The get_x_list methods should be part of Reporter class
    states = oscovida.get_US_region_list()

    usre = ReportExecutor(
        Reporter=USAReport,
        kernel_name=kernel_name,
        wwwroot=wwwroot,
        expiry_hours=2,
        attempts=3,
        workers=workers,
        force=force,
        disable_pbar=disable_pbar,
        debug=debug,
    )

    if debug:
        states = states[:10]

    usre.create_html_reports(states)

    usre.create_markdown_index_page()
Exemplo n.º 2
0
def test_get_US_region_list():
    x = c.get_US_region_list()
    assert x[0] == "Alabama"
    assert "Hawaii" in x
    assert len(x) > 50  # at least 50 states, plus diamond Princess