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