Skip to content

Commit

Permalink
Adds some simple sanity unit-tests and related bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jakedialpad committed Jul 29, 2020
1 parent 39d0b02 commit 4f91af1
Show file tree
Hide file tree
Showing 11 changed files with 1,126 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@ ENV/

# Rope project settings
.ropeproject
test/.resources/
17 changes: 17 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
nose2 = "*"
openapi-core = "==0.12.0"
swagger-parser = "*"
swagger-stub = "*"

[packages]
requests = "*"
cached-property = "*"

[requires]
python_version = "2.7"
484 changes: 484 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions dialpad/resources/contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ def create_with_uid(self, first_name, last_name, uid, **kwargs):
emails (list<str>, optional): A list of email addresses associated with the contact.
extension (str, optional): The contact's extension number.
job_title (str, optional): The contact's job title.
owner_id (str, optional): The ID of the user who should own this contact. If no owner_id is
specified, then a company-level shared contact will be created.
phones (list<str>, optional): A list of e164 numbers that belong to this contact.
trunk_group (str, optional): The contact's trunk group.
urls (list<str>, optional): A list of urls that pertain to this contact.
Expand Down Expand Up @@ -97,8 +95,6 @@ def patch(self, contact_id, **kwargs):
emails (list<str>, optional): A list of email addresses associated with the contact.
extension (str, optional): The contact's extension number.
job_title (str, optional): The contact's job title.
owner_id (str, optional): The ID of the user who should own this contact. If no owner_id is
specified, then a company-level shared contact will be created.
phones (list<str>, optional): A list of e164 numbers that belong to this contact.
trunk_group (str, optional): The contact's trunk group.
urls (list<str>, optional): A list of urls that pertain to this contact.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion dialpad/resources/event_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def put_sms_event_subscription(self, subscription_id, url, direction, enabled=Tr
"""

return self.request(['sms', subscription_id], method='PUT',
data=dict(url=url, enabled=enabled, group_calls_only=group_calls_only,
data=dict(url=url, enabled=enabled, direction=direction,
**kwargs))

def delete_sms_event_subscription(self, subscription_id):
Expand Down
4 changes: 2 additions & 2 deletions dialpad/resources/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def post(self, coaching_group=False, days_ago_start=1, days_ago_end=30, is_today

data = {
'coaching_group': coaching_group,
'days_ago_start': days_ago_start,
'days_ago_end': days_ago_end,
'days_ago_start': str(days_ago_start),
'days_ago_end': str(days_ago_end),
'is_today': is_today,
'export_type': export_type,
'stat_type': stat_type,
Expand Down
2 changes: 1 addition & 1 deletion dialpad/resources/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def toggle_call_recording(self, user_id, **kwargs):
See Also:
https://developers.dialpad.com/reference#callapi_updateactivecall
"""
return self.request([user_id, 'activecall'], data=kwargs)
return self.request([user_id, 'activecall'], method='PATCH', data=kwargs)

def assign_number(self, user_id, **kwargs):
"""Assigns a new number to the user.
Expand Down
3 changes: 3 additions & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import utils

utils.prepare_test_resources()
Loading

0 comments on commit 4f91af1

Please sign in to comment.