Skip to content

Commit abd095f

Browse files
committed
Ensure TypeErrors are being used in place of AssertionErrors for invalid parameter types
1 parent f49214f commit abd095f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ciscosparkapi/api/messages.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,17 @@ def __init__(self, session):
127127
API calls to the Cisco Spark service.
128128
129129
Raises:
130-
AssertionError: If the parameter types are incorrect.
130+
TypeError: If the parameter types are incorrect.
131131
132132
"""
133-
assert isinstance(session, RestSession)
133+
check_type(session, RestSession, may_be_none=False)
134134
super(MessagesAPI, self).__init__()
135135
self._session = session
136136

137137
@generator_container
138138
def list(self, roomId, mentionedPeople=None, before=None,
139139
beforeMessage=None, max=None, **request_parameters):
140-
"""Lists all messages in a room.
140+
"""Lists messages in a room.
141141
142142
Each message will include content attachments if present.
143143
@@ -199,7 +199,7 @@ def list(self, roomId, mentionedPeople=None, before=None,
199199

200200
def create(self, roomId=None, toPersonId=None, toPersonEmail=None,
201201
text=None, markdown=None, files=None, **request_parameters):
202-
"""Posts a message, and optionally a attachment, to a room.
202+
"""Post a message, and optionally a attachment, to a room.
203203
204204
The files parameter is a list, which accepts multiple values to allow
205205
for future expansion, but currently only one file may be included with

ciscosparkapi/api/people.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def delete(self, personId):
369369
personId(basestring): The ID of the person to be deleted.
370370
371371
Raises:
372-
AssertionError: If the parameter types are incorrect.
372+
TypeError: If the parameter types are incorrect.
373373
SparkApiError: If the Cisco Spark cloud returns an error.
374374
375375
"""

0 commit comments

Comments
 (0)