def countries(self, info) -> List[Country]: resp = get_countries() return [ Country(code=country["code"], name=country["name"]) for country in resp ]
def country(self, info, code: str = "") -> Country: resp = get_countries(code) return Country(code=resp["code"], name=resp["name"])
def test_get_country(): country = "IT" resp = get_countries(country) assert resp["code"] == "IT" assert resp["name"] == "Italy"