44
55import planet .clients .subscriptions
66from planet .clients .subscriptions import SubscriptionsClient
7- from planet .exceptions import ClientError
7+ from planet .exceptions import APIError
88from planet .http import Session
99
1010
1111@pytest .mark .xfail (reason = "Client/server interaction not yet implemented" )
1212@pytest .mark .asyncio
1313async def test_list_subscriptions_failure (monkeypatch ):
14- """ClientError is raised if there is a server error."""
14+ """APIError is raised if there is a server error."""
1515 monkeypatch .setattr (planet .clients .subscriptions , "_fake_subs" , 0 )
16- with pytest .raises (ClientError ):
16+ with pytest .raises (APIError ):
1717 async with Session () as session :
1818 client = SubscriptionsClient (session )
1919 _ = [sub async for sub in client .list_subscriptions ()]
@@ -41,9 +41,9 @@ async def test_list_subscriptions_success(status, count, monkeypatch):
4141@pytest .mark .xfail (reason = "Client/server interaction not yet implemented" )
4242@pytest .mark .asyncio
4343async def test_create_subscription_failure (monkeypatch ):
44- """ClientError is raised if there is a server error."""
44+ """APIError is raised if there is a server error."""
4545 monkeypatch .setattr (planet .clients .subscriptions , "_fake_subs" , {})
46- with pytest .raises (ClientError ):
46+ with pytest .raises (APIError ):
4747 async with Session () as session :
4848 client = SubscriptionsClient (session )
4949 _ = await client .create_subscription ({"lol" : "wut" })
@@ -65,9 +65,9 @@ async def test_create_subscription_success(monkeypatch):
6565@pytest .mark .xfail (reason = "Client/server interaction not yet implemented" )
6666@pytest .mark .asyncio
6767async def test_cancel_subscription_failure (monkeypatch ):
68- """ClientError is raised if there is a server error."""
68+ """APIError is raised if there is a server error."""
6969 monkeypatch .setattr (planet .clients .subscriptions , "_fake_subs" , {})
70- with pytest .raises (ClientError ):
70+ with pytest .raises (APIError ):
7171 async with Session () as session :
7272 client = SubscriptionsClient (session )
7373 _ = await client .cancel_subscription ("lolwut" )
@@ -93,9 +93,9 @@ async def test_cancel_subscription_success(monkeypatch):
9393@pytest .mark .xfail (reason = "Client/server interaction not yet implemented" )
9494@pytest .mark .asyncio
9595async def test_update_subscription_failure (monkeypatch ):
96- """ClientError is raised if there is a server error."""
96+ """APIError is raised if there is a server error."""
9797 monkeypatch .setattr (planet .clients .subscriptions , "_fake_subs" , {})
98- with pytest .raises (ClientError ):
98+ with pytest .raises (APIError ):
9999 async with Session () as session :
100100 client = SubscriptionsClient (session )
101101 _ = await client .update_subscription ("lolwut" , {})
@@ -124,9 +124,9 @@ async def test_update_subscription_success(monkeypatch):
124124@pytest .mark .xfail (reason = "Client/server interaction not yet implemented" )
125125@pytest .mark .asyncio
126126async def test_get_subscription_failure (monkeypatch ):
127- """ClientError is raised if there is a server error."""
127+ """APIError is raised if there is a server error."""
128128 monkeypatch .setattr (planet .clients .subscriptions , "_fake_subs" , {})
129- with pytest .raises (ClientError ):
129+ with pytest .raises (APIError ):
130130 async with Session () as session :
131131 client = SubscriptionsClient (session )
132132 _ = await client .get_subscription ("lolwut" )
@@ -152,9 +152,9 @@ async def test_get_subscription_success(monkeypatch):
152152@pytest .mark .xfail (reason = "Client/server interaction not yet implemented" )
153153@pytest .mark .asyncio
154154async def test_get_results_failure (monkeypatch ):
155- """ClientError is raised if there is a server error."""
155+ """APIError is raised if there is a server error."""
156156 monkeypatch .setattr (planet .clients .subscriptions , "_fake_sub_results" , {})
157- with pytest .raises (ClientError ):
157+ with pytest .raises (APIError ):
158158 async with Session () as session :
159159 client = SubscriptionsClient (session )
160160 _ = [res async for res in client .get_results ("lolwut" )]
0 commit comments