示例#1
0
文件: schema.py 项目: madEng84/pycon
 def countries(self, info) -> List[Country]:
     resp = get_countries()
     return [
         Country(code=country["code"], name=country["name"])
         for country in resp
     ]
示例#2
0
文件: schema.py 项目: madEng84/pycon
 def country(self, info, code: str = "") -> Country:
     resp = get_countries(code)
     return Country(code=resp["code"], name=resp["name"])
示例#3
0
def test_get_country():
    country = "IT"
    resp = get_countries(country)
    assert resp["code"] == "IT"
    assert resp["name"] == "Italy"