def test_default_weekly_needs(self): """default calculated needs are as expected """ # 20 Happens to be the smallest number at which integer rounding # won't make a difference to the result result = evacuated_population_weekly_needs(20) assert (result['rice'] == 56 and result['drinking_water'] == 350 and result['water'] == 2100 and result['family_kits'] == 4 and result['toilets'] == 1)
def test_default_weekly_needs(self): """default calculated needs are as expected """ # 20 Happens to be the smallest number at which integer rounding # won't make a difference to the result result = evacuated_population_weekly_needs(20) assert (result['rice'] == 56 and result['drinking_water'] == 350 and result['water'] == 2100 and result['family_kits'] == 4 and result['toilets'] == 1)
def test_arbitrary_weekly_needs(self): """custom need ratios calculated are as expected """ minimum_needs = {'Rice': 4, 'Drinking Water': 3, 'Water': 2, 'Family Kits': 1, 'Toilets': 0.2} result = evacuated_population_weekly_needs(10, minimum_needs) assert (result['rice'] == 40 and result['drinking_water'] == 30 and result['water'] == 20 and result['family_kits'] == 10 and result['toilets'] == 2)
def test_arbitrary_weekly_needs(self): """custom need ratios calculated are as expected """ minimum_needs = { 'Rice': 4, 'Drinking Water': 3, 'Water': 2, 'Family Kits': 1, 'Toilets': 0.2 } result = evacuated_population_weekly_needs(10, minimum_needs) assert (result['rice'] == 40 and result['drinking_water'] == 30 and result['water'] == 20 and result['family_kits'] == 10 and result['toilets'] == 2)