File tree 2 files changed +37
-12
lines changed
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,
128
128
pretty ):
129
129
"""Prints a sequence of JSON-encoded Subscription descriptions."""
130
130
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
+
131
147
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 ):
144
149
echo_json (sub , pretty )
145
150
146
151
Original file line number Diff line number Diff line change @@ -562,6 +562,16 @@ async def test_list_subscriptions_cycle_break():
562
562
_ = [sub async for sub in client .list_subscriptions ()]
563
563
564
564
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
+
565
575
@pytest .mark .anyio
566
576
@summary_mock
567
577
async def test_get_summary ():
@@ -601,6 +611,16 @@ def test_get_summary_sync():
601
611
}
602
612
603
613
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
+
604
624
@pytest .mark .anyio
605
625
@sub_summary_mock
606
626
async def test_get_sub_summary ():
You can’t perform that action at this time.
0 commit comments