Skip to content

Commit a9922fe

Browse files
author
Rodney Urquhart
committed
Removing unnecessary log statements and more test cleanup
1 parent 49da54e commit a9922fe

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

slack/rtm/client.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,6 @@ async def _read_messages(self):
350350
async for message in self._websocket:
351351
if message.type == aiohttp.WSMsgType.TEXT:
352352
payload = message.json()
353-
self._logger.debug(
354-
f"The Websocket received a new message. {payload}"
355-
)
356353
event = payload.pop("type", "Unknown")
357354
self._dispatch_event(event, data=payload)
358355
elif message.type == aiohttp.WSMsgType.ERROR:

slack/web/base_client.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,6 @@ def api_call(
143143
"ssl": self.ssl,
144144
"proxy": self.proxy,
145145
}
146-
self._logger.debug(
147-
"Sending a '%s' request to '%s' with the following data: %s",
148-
http_verb,
149-
api_url,
150-
req_args,
151-
)
152146

153147
req_future = asyncio.ensure_future(
154148
self._send(http_verb=http_verb, api_url=api_url, req_args=req_args),

tests/rtm/test_rtm_client_functional.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ async def on_shutdown(self, app):
5151
def setUp(self):
5252
self.loop = asyncio.new_event_loop()
5353
asyncio.set_event_loop(self.loop)
54-
self.stop = self.loop.create_future()
5554
task = asyncio.ensure_future(self.mock_server(), loop=self.loop)
5655
self.loop.run_until_complete(asyncio.wait_for(task, 0.1))
5756
self.client = slack.RTMClient(loop=self.loop, auto_reconnect=False)

tests/web/test_web_client_functional.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ async def handler(self, request):
3232
assert request.content_type == "application/json"
3333
return web.json_response({"ok": True})
3434

35-
def test_api_test(self):
35+
def test_requests_with_use_session_turned_off(self):
36+
self.client.use_session = False
37+
resp = self.client.api_test()
38+
assert resp["ok"]
39+
40+
def test_subsequent_requests_with_a_session_succeeds(self):
41+
resp = self.client.api_test()
42+
assert resp["ok"]
3643
resp = self.client.api_test()
3744
assert resp["ok"]

0 commit comments

Comments
 (0)