forked from slackapi/python-slack-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
118 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import unittest | ||
|
||
import slack_sdk.errors as err | ||
from slack_sdk.web import WebClient | ||
from tests.slack_sdk.web.mock_web_api_server import ( | ||
setup_mock_web_api_server, | ||
cleanup_mock_web_api_server, | ||
) | ||
|
||
|
||
class TestWebClient_Issue_829(unittest.TestCase): | ||
def setUp(self): | ||
setup_mock_web_api_server(self) | ||
|
||
def tearDown(self): | ||
cleanup_mock_web_api_server(self) | ||
|
||
def test_html_response_body_issue_829(self): | ||
client = WebClient(base_url="http://localhost:8888") | ||
try: | ||
client.users_list(token="xoxb-error_html_response") | ||
self.fail("SlackApiError expected here") | ||
except err.SlackApiError as e: | ||
self.assertTrue( | ||
str(e).startswith("Failed to parse the response body: Expecting value: "), | ||
e, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import unittest | ||
|
||
import slack_sdk.errors as err | ||
from slack_sdk.web.async_client import AsyncWebClient | ||
from tests.helpers import async_test | ||
from tests.slack_sdk.web.mock_web_api_server import ( | ||
setup_mock_web_api_server, | ||
cleanup_mock_web_api_server, | ||
) | ||
|
||
|
||
class TestWebClient_Issue_829(unittest.TestCase): | ||
def setUp(self): | ||
setup_mock_web_api_server(self) | ||
|
||
def tearDown(self): | ||
cleanup_mock_web_api_server(self) | ||
|
||
@async_test | ||
async def test_html_response_body_issue_829_async(self): | ||
client = AsyncWebClient(base_url="http://localhost:8888") | ||
try: | ||
await client.users_list(token="xoxb-error_html_response") | ||
self.fail("SlackApiError expected here") | ||
except err.SlackApiError as e: | ||
self.assertEqual( | ||
"The request to the Slack API failed.\n" | ||
"The server responded with: {}", | ||
str(e) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters