Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Commit a5a9d96

Browse files
committed
Add Room Messages API
1 parent e2fefa3 commit a5a9d96

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

upwork/routers/messages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ def get_room_details(self, company, room_id, params = {}):
3939
"""
4040
url = '{0}/rooms/{1}'.format(company, room_id)
4141
result = self.get(url, data=params)
42+
return result.get(url, result)
4243

4344
def get_room_messages(self, company, room_id, params = {}):
4445
"""
45-
Get a specific room information
46+
Get messages from a specific room
4647
4748
*Parameters:*
4849
:company: Company ID

upwork/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,14 @@ def test_get_room_details():
861861
assert messages.get_room_details("testcompany", "room-id") ==\
862862
room_dict, messages.get_room_details("testcompany", "room-id")
863863

864+
@patch('urllib3.PoolManager.urlopen', patched_urlopen_room)
865+
def test_get_room_messages():
866+
messages = get_client().messages
867+
868+
#test get_room_messages
869+
assert messages.get_room_messages("testcompany", "room-id") ==\
870+
room_dict, messages.get_room_messages("testcompany", "room-id")
871+
864872
@patch('urllib3.PoolManager.urlopen', patched_urlopen_room)
865873
def test_get_room_by_offer():
866874
messages = get_client().messages

0 commit comments

Comments
 (0)