Skip to content

Commit 376c09d

Browse files
be-haseokdtsk
authored andcommitted
trivial fix. (#57)
1 parent d7e36c6 commit 376c09d

File tree

3 files changed

+22
-30
lines changed

3 files changed

+22
-30
lines changed

linebot/api.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self, channel_access_token, endpoint=DEFAULT_API_ENDPOINT,
3838
:param str endpoint: (optional) Default is https://api.line.me
3939
:param timeout: (optional) How long to wait for the server
4040
to send data before giving up, as a float,
41-
or a (connect timeout, readtimeout) float tuple.
41+
or a (connect timeout, read timeout) float tuple.
4242
Default is linebot.http_client.HttpClient.DEFAULT_TIMEOUT
4343
:type timeout: float | tuple(float, float)
4444
:param http_client: (optional) Default is
@@ -78,7 +78,7 @@ def reply_message(self, reply_token, messages, timeout=None):
7878
list[T <= :py:class:`linebot.models.send_messages.SendMessage`]
7979
:param timeout: (optional) How long to wait for the server
8080
to send data before giving up, as a float,
81-
or a (connect timeout, readtimeout) float tuple.
81+
or a (connect timeout, read timeout) float tuple.
8282
Default is self.http_client.timeout
8383
:type timeout: float | tuple(float, float)
8484
"""
@@ -108,7 +108,7 @@ def push_message(self, to, messages, timeout=None):
108108
list[T <= :py:class:`linebot.models.send_messages.SendMessage`]
109109
:param timeout: (optional) How long to wait for the server
110110
to send data before giving up, as a float,
111-
or a (connect timeout, readtimeout) float tuple.
111+
or a (connect timeout, read timeout) float tuple.
112112
Default is self.http_client.timeout
113113
:type timeout: float | tuple(float, float)
114114
"""
@@ -140,7 +140,7 @@ def multicast(self, to, messages, timeout=None):
140140
list[T <= :py:class:`linebot.models.send_messages.SendMessage`]
141141
:param timeout: (optional) How long to wait for the server
142142
to send data before giving up, as a float,
143-
or a (connect timeout, readtimeout) float tuple.
143+
or a (connect timeout, read timeout) float tuple.
144144
Default is self.http_client.timeout
145145
:type timeout: float | tuple(float, float)
146146
"""
@@ -166,7 +166,7 @@ def get_profile(self, user_id, timeout=None):
166166
:param str user_id: User ID
167167
:param timeout: (optional) How long to wait for the server
168168
to send data before giving up, as a float,
169-
or a (connect timeout, readtimeout) float tuple.
169+
or a (connect timeout, read timeout) float tuple.
170170
Default is self.http_client.timeout
171171
:type timeout: float | tuple(float, float)
172172
:rtype: :py:class:`linebot.models.responses.Profile`
@@ -188,21 +188,18 @@ def get_group_member_profile(self, group_id, user_id, timeout=None):
188188
the bot is in. This can be the user ID of a user who has
189189
not added the bot as a friend or has blocked the bot.
190190
191-
:param str user_id: User ID
192191
:param str group_id: Group ID
192+
:param str user_id: User ID
193193
:param timeout: (optional) How long to wait for the server
194194
to send data before giving up, as a float,
195-
or a (connect timeout, readtimeout) float tuple.
195+
or a (connect timeout, read timeout) float tuple.
196196
Default is self.http_client.timeout
197197
:type timeout: float | tuple(float, float)
198198
:rtype: :py:class:`linebot.models.responses.Profile`
199199
:return: Profile instance
200200
"""
201201
response = self._get(
202-
'/v2/bot/group/{group_id}/member/{user_id}'.format(
203-
user_id=user_id,
204-
group_id=group_id
205-
),
202+
'/v2/bot/group/{group_id}/member/{user_id}'.format(group_id=group_id, user_id=user_id),
206203
timeout=timeout
207204
)
208205

@@ -217,21 +214,18 @@ def get_room_member_profile(self, room_id, user_id, timeout=None):
217214
the bot is in. This can be the user ID of a user who has
218215
not added the bot as a friend or has blocked the bot.
219216
220-
:param str user_id: User ID
221217
:param str room_id: Room ID
218+
:param str user_id: User ID
222219
:param timeout: (optional) How long to wait for the server
223220
to send data before giving up, as a float,
224-
or a (connect timeout, readtimeout) float tuple.
221+
or a (connect timeout, read timeout) float tuple.
225222
Default is self.http_client.timeout
226223
:type timeout: float | tuple(float, float)
227224
:rtype: :py:class:`linebot.models.responses.Profile`
228225
:return: Profile instance
229226
"""
230227
response = self._get(
231-
'/v2/bot/room/{room_id}/member/{user_id}'.format(
232-
user_id=user_id,
233-
room_id=room_id
234-
),
228+
'/v2/bot/room/{room_id}/member/{user_id}'.format(room_id=room_id, user_id=user_id),
235229
timeout=timeout
236230
)
237231

@@ -247,7 +241,7 @@ def get_message_content(self, message_id, timeout=None):
247241
:param str message_id: Message ID
248242
:param timeout: (optional) How long to wait for the server
249243
to send data before giving up, as a float,
250-
or a (connect timeout, readtimeout) float tuple.
244+
or a (connect timeout, read timeout) float tuple.
251245
Default is self.http_client.timeout
252246
:type timeout: float | tuple(float, float)
253247
:rtype: :py:class:`linebot.models.responses.MessageContent`
@@ -270,7 +264,7 @@ def leave_group(self, group_id, timeout=None):
270264
:param str group_id: Group ID
271265
:param timeout: (optional) How long to wait for the server
272266
to send data before giving up, as a float,
273-
or a (connect timeout, readtimeout) float tuple.
267+
or a (connect timeout, read timeout) float tuple.
274268
Default is self.http_client.timeout
275269
:type timeout: float | tuple(float, float)
276270
"""
@@ -289,7 +283,7 @@ def leave_room(self, room_id, timeout=None):
289283
:param str room_id: Room ID
290284
:param timeout: (optional) How long to wait for the server
291285
to send data before giving up, as a float,
292-
or a (connect timeout, readtimeout) float tuple.
286+
or a (connect timeout, read timeout) float tuple.
293287
Default is self.http_client.timeout
294288
:type timeout: float | tuple(float, float)
295289
"""

tests/api/test_get_group_member_profile.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import unittest
1818

1919
import responses
20+
2021
from linebot import (
2122
LineBotApi
2223
)
@@ -27,11 +28,10 @@ def setUp(self):
2728
self.tested = LineBotApi('channel_secret')
2829

2930
@responses.activate
30-
def test_get_profile(self):
31+
def test_get_group_member_profile(self):
3132
responses.add(
3233
responses.GET,
33-
LineBotApi.DEFAULT_API_ENDPOINT + '/v2/bot/group/group_id/' +
34-
'member/user_id',
34+
LineBotApi.DEFAULT_API_ENDPOINT + '/v2/bot/group/group_id/member/user_id',
3535
json={
3636
"displayName": "LINE taro",
3737
"userId": "Uxxxxxxxxxxxxxx...",
@@ -46,8 +46,7 @@ def test_get_profile(self):
4646
self.assertEqual(request.method, 'GET')
4747
self.assertEqual(
4848
request.url,
49-
LineBotApi.DEFAULT_API_ENDPOINT + '/v2/bot/group/group_id/' +
50-
'member/user_id')
49+
LineBotApi.DEFAULT_API_ENDPOINT + '/v2/bot/group/group_id/member/user_id')
5150
self.assertEqual(profile.display_name, 'LINE taro')
5251
self.assertEqual(profile.user_id, 'Uxxxxxxxxxxxxxx...')
5352
self.assertEqual(profile.picture_url, 'http://obs.line-apps.com/...')

tests/api/test_get_room_member_profile.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import unittest
1818

1919
import responses
20+
2021
from linebot import (
2122
LineBotApi
2223
)
@@ -27,11 +28,10 @@ def setUp(self):
2728
self.tested = LineBotApi('channel_secret')
2829

2930
@responses.activate
30-
def test_get_profile(self):
31+
def test_get_room_member_profile(self):
3132
responses.add(
3233
responses.GET,
33-
LineBotApi.DEFAULT_API_ENDPOINT + '/v2/bot/room/room_id/' +
34-
'member/user_id',
34+
LineBotApi.DEFAULT_API_ENDPOINT + '/v2/bot/room/room_id/member/user_id',
3535
json={
3636
"displayName": "LINE taro",
3737
"userId": "Uxxxxxxxxxxxxxx...",
@@ -46,8 +46,7 @@ def test_get_profile(self):
4646
self.assertEqual(request.method, 'GET')
4747
self.assertEqual(
4848
request.url,
49-
LineBotApi.DEFAULT_API_ENDPOINT + '/v2/bot/room/room_id/' +
50-
'member/user_id')
49+
LineBotApi.DEFAULT_API_ENDPOINT + '/v2/bot/room/room_id/member/user_id')
5150
self.assertEqual(profile.display_name, 'LINE taro')
5251
self.assertEqual(profile.user_id, 'Uxxxxxxxxxxxxxx...')
5352
self.assertEqual(profile.picture_url, 'http://obs.line-apps.com/...')

0 commit comments

Comments
 (0)