File tree Expand file tree Collapse file tree 2 files changed +37
-12
lines changed Expand file tree Collapse file tree 2 files changed +37
-12
lines changed Original file line number Diff line number Diff line change @@ -128,19 +128,24 @@ async def list_subscriptions_cmd(ctx,
128128 pretty ):
129129 """Prints a sequence of JSON-encoded Subscription descriptions."""
130130 async with subscriptions_client (ctx ) as client :
131+ list_subscriptions_kwargs = {
132+ 'created' : created ,
133+ 'end_time' : end_time ,
134+ 'hosting' : hosting ,
135+ 'name__contains' : name_contains ,
136+ 'name' : name ,
137+ 'source_type' : source_type ,
138+ 'start_time' : start_time ,
139+ 'status' : status ,
140+ 'sort_by' : sort_by ,
141+ 'updated' : updated ,
142+ 'limit' : limit ,
143+ }
144+ if page_size is not None :
145+ list_subscriptions_kwargs ['page_size' ] = page_size
146+
131147 async for sub in client .list_subscriptions (
132- created = created ,
133- end_time = end_time ,
134- hosting = hosting ,
135- name__contains = name_contains ,
136- name = name ,
137- source_type = source_type ,
138- start_time = start_time ,
139- status = status ,
140- sort_by = sort_by ,
141- updated = updated ,
142- limit = limit ,
143- page_size = page_size ):
148+ ** list_subscriptions_kwargs ):
144149 echo_json (sub , pretty )
145150
146151
Original file line number Diff line number Diff line change @@ -562,6 +562,16 @@ async def test_list_subscriptions_cycle_break():
562562 _ = [sub async for sub in client .list_subscriptions ()]
563563
564564
565+ @pytest .mark .anyio
566+ @failing_api_mock
567+ async def test_get_summary_failure ():
568+ """ServerError is raised if there is an internal server error (500)."""
569+ with pytest .raises (ServerError ):
570+ async with Session () as session :
571+ client = SubscriptionsClient (session , base_url = TEST_URL )
572+ _ = await client .get_summary ()
573+
574+
565575@pytest .mark .anyio
566576@summary_mock
567577async def test_get_summary ():
@@ -601,6 +611,16 @@ def test_get_summary_sync():
601611 }
602612
603613
614+ @pytest .mark .anyio
615+ @failing_api_mock
616+ async def test_get_sub_summary_failure ():
617+ """ServerError is raised if there is an internal server error (500)."""
618+ with pytest .raises (ServerError ):
619+ async with Session () as session :
620+ client = SubscriptionsClient (session , base_url = TEST_URL )
621+ _ = await client .get_subscription_summary ("test" )
622+
623+
604624@pytest .mark .anyio
605625@sub_summary_mock
606626async def test_get_sub_summary ():
You can’t perform that action at this time.
0 commit comments