Skip to content

Commit

Permalink
removing deprecated pricing endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkahan committed Aug 26, 2023
1 parent a14ec29 commit 71e506c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
20 changes: 0 additions & 20 deletions src/vonage/account.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from .errors import PricingTypeError

from deprecated import deprecated


class Account:
account_auth_type = 'params'
Expand Down Expand Up @@ -53,24 +51,6 @@ def get_prefix_pricing(self, prefix: str, type: str = 'sms'):
auth_type=Account.pricing_auth_type,
)

@deprecated(version='3.0.0', reason='The "account/get-phone-pricing" endpoint is deprecated.')
def get_sms_pricing(self, number: str):
return self._client.get(
self._client.host(),
"/account/get-phone-pricing/outbound/sms",
{"phone": number},
auth_type=Account.pricing_auth_type,
)

@deprecated(version='3.0.0', reason='The "account/get-phone-pricing" endpoint is deprecated.')
def get_voice_pricing(self, number: str):
return self._client.get(
self._client.host(),
"/account/get-phone-pricing/outbound/voice",
{"phone": number},
auth_type=Account.pricing_auth_type,
)

def update_default_sms_webhook(self, params=None, **kwargs):
return self._client.post(
self._client.host(),
Expand Down
18 changes: 0 additions & 18 deletions tests/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,6 @@ def test_get_prefix_pricing(account, dummy_data):
assert "prefix=44" in request_query()


@responses.activate
def test_get_sms_pricing(account, dummy_data):
stub(responses.GET, "https://rest.nexmo.com/account/get-phone-pricing/outbound/sms")

assert isinstance(account.get_sms_pricing("447525856424"), dict)
assert request_user_agent() == dummy_data.user_agent
assert "phone=447525856424" in request_query()


@responses.activate
def test_get_voice_pricing(account, dummy_data):
stub(responses.GET, "https://rest.nexmo.com/account/get-phone-pricing/outbound/voice")

assert isinstance(account.get_voice_pricing("447525856424"), dict)
assert request_user_agent() == dummy_data.user_agent
assert "phone=447525856424" in request_query()


def test_invalid_pricing_type_throws_error(account):
with pytest.raises(PricingTypeError):
account.get_country_pricing('GB', 'not_a_valid_pricing_type')
Expand Down

0 comments on commit 71e506c

Please sign in to comment.