4444from base import TestCaseBackendArchive
4545
4646
47- SLACK_API_URL = 'https://slack.com/api'
48- SLACK_CHANNEL_INFO_URL = SLACK_API_URL + '/channels.info'
49- SLACK_CHANNEL_HISTORY_URL = SLACK_API_URL + '/channels.history'
50- SLACK_CONVERSATION_MEMBERS = SLACK_API_URL + '/conversations.members'
51- SLACK_USER_INFO_URL = SLACK_API_URL + '/users.info'
47+ SLACK_API_URL = 'https://slack.com/api/ '
48+ SLACK_CHANNEL_INFO_URL = SLACK_API_URL + SlackClient . RCONVERSATION_INFO
49+ SLACK_CHANNEL_HISTORY_URL = SLACK_API_URL + SlackClient . RCONVERSATION_HISTORY
50+ SLACK_CONVERSATION_MEMBERS = SLACK_API_URL + SlackClient . RCONVERSATION_MEMBERS
51+ SLACK_USER_INFO_URL = SLACK_API_URL + SlackClient . RUSER_INFO
5252
5353
5454def read_file (filename , mode = 'r' ):
@@ -703,7 +703,7 @@ def test_conversation_members(self):
703703
704704 req = http_requests [0 ]
705705 self .assertEqual (req .method , 'GET' )
706- self .assertRegex (req .path , '/conversations.members' )
706+ self .assertRegex (req .path , SlackClient . RCONVERSATION_MEMBERS )
707707
708708 for i in range (len (expected )):
709709 self .assertIn ((SlackClient .AUTHORIZATION_HEADER , 'Bearer aaaa' ), http_requests [i ].headers ._headers )
@@ -727,7 +727,7 @@ def test_channel_info(self):
727727
728728 req = http_requests [0 ]
729729 self .assertEqual (req .method , 'GET' )
730- self .assertRegex (req .path , '/channels.info' )
730+ self .assertRegex (req .path , SlackClient . RCONVERSATION_INFO )
731731 self .assertDictEqual (req .querystring , expected )
732732 self .assertIn ((SlackClient .AUTHORIZATION_HEADER , 'Bearer aaaa' ), req .headers ._headers )
733733
@@ -754,7 +754,7 @@ def test_history(self):
754754
755755 req = http_requests [0 ]
756756 self .assertEqual (req .method , 'GET' )
757- self .assertRegex (req .path , '/channels.history' )
757+ self .assertRegex (req .path , SlackClient . RCONVERSATION_HISTORY )
758758 self .assertDictEqual (req .querystring , expected )
759759 self .assertIn ((SlackClient .AUTHORIZATION_HEADER , 'Bearer aaaa' ), req .headers ._headers )
760760
@@ -781,7 +781,7 @@ def test_history_format_latest(self):
781781
782782 req = http_requests [0 ]
783783 self .assertEqual (req .method , 'GET' )
784- self .assertRegex (req .path , '/channels.history' )
784+ self .assertRegex (req .path , SlackClient . RCONVERSATION_HISTORY )
785785 self .assertDictEqual (req .querystring , expected )
786786 self .assertIn ((SlackClient .AUTHORIZATION_HEADER , 'Bearer aaaa' ), req .headers ._headers )
787787
@@ -804,7 +804,7 @@ def test_user(self):
804804
805805 req = http_requests [0 ]
806806 self .assertEqual (req .method , 'GET' )
807- self .assertRegex (req .path , '/users.info' )
807+ self .assertRegex (req .path , SlackClient . RUSER_INFO )
808808 self .assertDictEqual (req .querystring , expected )
809809 self .assertIn ((SlackClient .AUTHORIZATION_HEADER , 'Bearer aaaa' ), req .headers ._headers )
810810
0 commit comments