@@ -15,6 +15,8 @@ def setUp(self):
1515 setup_mock_web_api_server_async (self , MockHandler )
1616 self .client = AsyncWebClient (token = "xoxb-api_test" , base_url = "http://localhost:8888" )
1717 self .client_base_url_slash = AsyncWebClient (token = "xoxb-api_test" , base_url = "http://localhost:8888/" )
18+ self .client_api = AsyncWebClient (token = "xoxb-api_test" , base_url = "http://localhost:8888/api" )
19+ self .client_api_slash = AsyncWebClient (token = "xoxb-api_test" , base_url = "http://localhost:8888/api/" )
1820
1921 def tearDown (self ):
2022 cleanup_mock_web_api_server_async (self )
@@ -43,3 +45,23 @@ async def test_base_url_with_slash_api_method_with_slash(self):
4345 async def test_base_url_without_slash_api_method_with_slash_and_trailing_slash (self ):
4446 await self .client .api_call ("/chat.postMessage/" )
4547 await assert_received_request_count_async (self , "/chat.postMessage/" , 1 )
48+
49+ @async_test
50+ async def test_base_url_with_api (self ):
51+ await self .client_api .api_call ("chat.postMessage" )
52+ assert_received_request_count_async (self , "/api/chat.postMessage" , 1 )
53+
54+ @async_test
55+ async def test_base_url_with_api_method_without_slash_method_with_slash (self ):
56+ await self .client_api .api_call ("/chat.postMessage" )
57+ assert_received_request_count_async (self , "/api/chat.postMessage" , 1 )
58+
59+ @async_test
60+ async def test_base_url_with_api_slash (self ):
61+ await self .client_api_slash .api_call ("chat.postMessage" )
62+ await assert_received_request_count_async (self , "/api/chat.postMessage" , 1 )
63+
64+ @async_test
65+ async def test_base_url_with_api_slash_and_method_with_slash (self ):
66+ await self .client_api_slash .api_call ("/chat.postMessage" )
67+ await assert_received_request_count_async (self , "/api/chat.postMessage" , 1 )
0 commit comments