def test_generate_data_plot_confirmed_exception2(setup_function): file = open("covid_data/test_hospital_vs_confirmed.json", "rb") jsonObejct = json.load(file) with pytest.raises(ValueError): generate_data_plot_confirmed(jsonObejct, sex='male', max_age=65, status="total")
def test_wrong_input_generate_data_plot_confirmed(): with pytest.raises(ValueError): generate_data_plot_confirmed([3, 4, 5], sex=[2, 3])
def test_incorrect_max_age_generate_data_plot_confirm_3(): assert generate_data_plot_confirmed( data_er, max_ages=(1, 2, 3)) == 'Input max_age is error'
def test_incorrect_sex_generate_data_plot_confirm_3(): assert generate_data_plot_confirmed(data_er, sex=(1, 2, 3)) == 'Input sex is error'
def test_incorrect_sex_generate_data_plot_confirm_2(): assert generate_data_plot_confirmed(data_er, sex='abc') == 'Input sex is error'
def test_incorrect_sex_generate_data_plot_confirm_1( ): #throws a meaningful error when an input argument is not correct(e.g., sex=4) assert generate_data_plot_confirmed(data_er, sex=4) == 'Input sex is error'