def calculate (url:str) -> dict: """ The main function of this package. Glues everything together. """ theJson = fetchReduceJson.fetchJSON(url) dataSet = fetchReduceJson.reduceJSON(theJson) return generateDict(dataSet)
def test_fetchJSON(self): """ Test on the structure of the JSON. In this case test that it contains certain values. """ self.assertEqual("water_point_geocode" in (fetchReduceJson.fetchJSON(jsonUrl))[0], True) self.assertEqual( fetchReduceJson.reduceJSON(TestFetchReduceJson.theJSON) , fetchReduceJson.reduceJSON(TestFetchReduceJson.reduced))