File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 2424dispatch = Dispatch (app )
2525
2626
27- @dispatch .function ()
28- def get_repo_info (repo_owner : str , repo_name : str ):
27+ @dispatch .function
28+ async def get_repo_info (repo_owner : str , repo_name : str ):
2929 url = f"https://api.github.com/repos/{ repo_owner } /{ repo_name } "
3030 api_response = httpx .get (url )
3131 api_response .raise_for_status ()
3232 repo_info = api_response .json ()
3333 return repo_info
3434
3535
36- @dispatch .function ()
37- def get_contributors (repo_info : dict ):
36+ @dispatch .function
37+ async def get_contributors (repo_info : dict ):
3838 contributors_url = repo_info ["contributors_url" ]
3939 response = httpx .get (contributors_url )
4040 response .raise_for_status ()
4141 contributors = response .json ()
4242 return contributors
4343
4444
45- @dispatch .coroutine ()
45+ @dispatch .function
4646async def main ():
4747 repo_info = await get_repo_info ("stealthrocket" , "coroutine" )
4848 print (
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ def test_foo(self):
3636 response = http_client .get ("/" )
3737 self .assertEqual (response .status_code , 200 )
3838
39- server .execute (app_client )
4039 server .execute (app_client )
4140
4241 self .assertEqual (len (servicer .responses ), 1 )
You can’t perform that action at this time.
0 commit comments