(self)
| 19 | |
| 20 | class TestWebhook(unittest.TestCase): |
| 21 | def setUp(self): |
| 22 | if not hasattr(self, "channel_id"): |
| 23 | token = os.environ[SLACK_SDK_TEST_BOT_TOKEN] |
| 24 | channel_name = os.environ[SLACK_SDK_TEST_INCOMING_WEBHOOK_CHANNEL_NAME].replace("#", "") |
| 25 | client = WebClient(token=token) |
| 26 | self.channel_id = None |
| 27 | for resp in client.conversations_list(limit=1000): |
| 28 | for c in resp["channels"]: |
| 29 | if c["name"] == channel_name: |
| 30 | self.channel_id = c["id"] |
| 31 | break |
| 32 | if self.channel_id is not None: |
| 33 | break |
| 34 | |
| 35 | def tearDown(self): |
| 36 | pass |
nothing calls this directly
no test coverage detected