コード例 #1
0
ファイル: test_slackest.py プロジェクト: usserysig1/slackest
 def test_post_thread_to_message_error(self, mock_requests):
     json_to_text = json.dumps(stubs.bad_post_thread_to_message_response)
     mock_requests.post.return_value = Mock(
         status_code=200, text=json_to_text,
     )
     sc = Slackest(token='aaa')
     error = sc.post_thread_to_message('slimer', "Here's a message for you", '1503435956.000247').body['error']
     self.assertEqual('is_archived', error)
コード例 #2
0
ファイル: test_slackest.py プロジェクト: usserysig1/slackest
 def test_post_thread_to_message(self, mock_requests):
     json_to_text = json.dumps(stubs.good_post_thread_to_message_response)
     mock_requests.post.return_value = Mock(
         status_code=200, text=json_to_text,
     )
     sc = Slackest(token='aaa')
     username = sc.post_thread_to_message('slimer', "Here's a message for you", '1503435956.000247').body['message'].get('username')
     self.assertEqual('ecto1', username)