Skip to content

Commit

Permalink
v1.3.0 updates (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-telnyx authored Mar 29, 2021
1 parent 9119a8e commit 8dc5978
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.2
1.3.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def run_tests(self):

setup(
name="telnyx",
version="1.2.2",
version="1.3.0",
description="Python bindings for the Telnyx API",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion telnyx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
log = None


__version__ = "1.2.2"
__version__ = "1.3.0"


# Sets some basic information about the running application that's sent along
Expand Down
8 changes: 2 additions & 6 deletions telnyx/api_resources/abstract/api_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ def class_url(cls):
)
# Namespaces are separated in object names with periods (.) and in URLs
# with forward slashes (/), so replace the former with the latter.
if cls.OBJECT_NAME == "fax":
base = cls.OBJECT_NAME.replace(".", "/")
return "/v2/%ses" % (base,)
else:
base = cls.OBJECT_NAME.replace(".", "/")
return "/v2/%ss" % (base,)
base = cls.OBJECT_NAME.replace(".", "/")
return "/v2/%ss" % (base,)

def instance_url(self):
id = self.get("id")
Expand Down
4 changes: 4 additions & 0 deletions telnyx/api_resources/fax.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ class Fax(
UpdateableAPIResource,
):
OBJECT_NAME = "fax"

@classmethod
def class_url(cls):
return "/v2/faxes"
4 changes: 4 additions & 0 deletions telnyx/api_resources/phone_number_regulatory_requirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ def retrieve(cls, id, api_key=None, **params):
raise error.InvalidRequestError(
"%s does not support retrieve()" % cls.class_url()
)

@classmethod
def class_url(cls):
return "/v2/phone_numbers_regulatory_requirements"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class TestPhoneNumberRegulatoryRequirement(object):
def test_is_listable(self, request_mock):
resources = telnyx.PhoneNumberRegulatoryRequirement.list()
request_mock.assert_requested("get", "/v2/phone_number_regulatory_requirements")
request_mock.assert_requested(
"get", "/v2/phone_numbers_regulatory_requirements"
)
assert isinstance(resources.data, list)
assert isinstance(resources.data[0], telnyx.PhoneNumberRegulatoryRequirement)

Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ commands = python setup.py test -a "{posargs:-n auto}"

[testenv:fmt]
description = run code formatting using black
basepython = python3.7
deps =
black
isort
Expand Down

0 comments on commit 8dc5978

Please sign in to comment.