def test_get_cummulative_cases(self): country = Country("TEST") with open("./tests/data/australiadata.json", "r") as filehandler: country.data = json.loads(filehandler.readline()) country.get_cumulative_cases() self.assertEqual(country.cumulative_cases, [30, 39, 52, 55, 60])
def test_get_case_fatality_rate(self): country = Country("TEST") with open("./tests/data/australiadata.json", "r") as filehandler: country.data = json.loads(filehandler.readline()) country.get_cumulative_cases() country.get_cumulative_deaths() country.get_case_fatality_rate() self.assertEqual(country.case_fatality_rate, [ 1 / 30 * 100, 1 / 39 * 100, 2 / 52 * 100, 2 / 55 * 100, 2 / 60 * 100 ])