def test_get_data(self): """ The dict contains the keys `communities_villages` and `water_functioning` and no others. """ reducedDict = data.get_data("water_functioning", "communities_villages", jsonUrl).pop() requiredSet = set(["communities_villages", "water_functioning"]) # Assert that the resulting set is empty. If it is not empty there were other values in the dict. assert requiredSet - set(reducedDict.keys()) == set()
def percent_water_functioning_by(split_key: str) -> dict: dataSet = data.get_data("water_functioning", split_key, url) return compute.rank("water_functioning", split_key, dataSet)
def percent_boolean_key_by(boolean_key, split_key): dataSet = data.get_data(boolean_key, split_key, url) return compute.rank(boolean_key, split_key, dataSet)
def calculate (url): dataSet = data.get_data("water_functioning", "communities_villages", url) return generateDict(dataSet)