def generateDict (dataSet: dict) -> dict: """ For testing on a smaller dataset and increased modularity. Returns a data structure with the following format: { number_functional: …, number_water_points: { communityA: …, }, community_ranking: … } """ return dict( number_functional= ci.sumFunctionalWaterPoints(dataSet) , number_water_points = ci.sumWaterPointsPerCommunity(dataSet) , community_ranking = ci.rankCommunitiesByPercentBrokenWaterPoints(dataSet) )
def test_rankCommunitiesByPercentBrokenWaterPoints(self): self.assertEqual (ci.rankCommunitiesByPercentBrokenWaterPoints(TestComputeWaterInfrastructure.dataSet) , dict(VilA=0, VilB=100, VilC=0))