{"id":26974337,"url":"https://github.com/diegojromerolopez/slack-bolt-testcase","last_synced_at":"2026-02-25T11:07:13.970Z","repository":{"id":283862072,"uuid":"952701392","full_name":"diegojromerolopez/slack-bolt-testcase","owner":"diegojromerolopez","description":"A simple unittest TestCase class to use it in your Slack Bolt App unittest tests","archived":false,"fork":false,"pushed_at":"2025-03-22T19:11:27.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-11T20:31:18.064Z","etag":null,"topics":["chatbot","slack","slack-bolt","test","unittest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diegojromerolopez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-21T18:17:32.000Z","updated_at":"2025-03-22T19:13:15.000Z","dependencies_parsed_at":"2025-06-18T06:15:12.554Z","dependency_job_id":null,"html_url":"https://github.com/diegojromerolopez/slack-bolt-testcase","commit_stats":null,"previous_names":["diegojromerolopez/slack-bolt-testcase"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/diegojromerolopez/slack-bolt-testcase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegojromerolopez%2Fslack-bolt-testcase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegojromerolopez%2Fslack-bolt-testcase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegojromerolopez%2Fslack-bolt-testcase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegojromerolopez%2Fslack-bolt-testcase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diegojromerolopez","download_url":"https://codeload.github.com/diegojromerolopez/slack-bolt-testcase/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegojromerolopez%2Fslack-bolt-testcase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29819265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","slack","slack-bolt","test","unittest"],"created_at":"2025-04-03T10:34:01.996Z","updated_at":"2026-02-25T11:07:13.929Z","avatar_url":"https://github.com/diegojromerolopez.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-bolt-testcase\n\n![test](https://github.com/diegojromerolopez/slack-bolt-testcase/actions/workflows/test.yml/badge.svg)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/diegojromerolopez/slack-bolt-testcase/graphs/commit-activity)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/slack-bolt-testcase.svg)](https://pypi.python.org/pypi/slack-bolt-testcase/)\n[![PyPI version slack-bolt-testcase](https://badge.fury.io/py/slack-bolt-testcase.svg)](https://pypi.python.org/pypi/slack-bolt-testcase/)\n[![PyPI status](https://img.shields.io/pypi/status/slack-bolt-testcase.svg)](https://pypi.python.org/pypi/slack-bolt-testcase/)\n[![PyPI download month](https://img.shields.io/pypi/dm/slack-bolt-testcase.svg)](https://pypi.python.org/pypi/slack-bolt-testcase/)\n\nA simple unittest TestCase class to use it in your Slack Bolt App unittest tests\n\n## Introduction\n\nThe [Slack bolt library](https://github.com/slackapi/bolt-python) and the\n[Slack SDK](https://github.com/slackapi/python-slack-sdk) for Python are the best and official ways of implementing\nSlack bots in Python. However, there is a small piece missing there: no official documentation about how to do\ntests with the standard unittest library that allow developers to test that they have registered their handlers correctly.\nslack-bolt-testcase fixes that.\n\n## Requirements\n\n- Python \u003e= 3.9\n- slack_bolt~=1.23.0\n- slack_sdk~=3.35.0\n\n## Use\n\nTo use this TestCase, you just need to inherit from [EventTestCase](/slack_bolt_testcase/event_test_case.py)\nand make sure you have registered your event handlers\nin the [AppTestCase.app](/slack_bolt_testcase/app_test_case.py).\n\n```python\nfrom unittest.mock import call\n\nfrom slack_bolt import Say\n\nfrom slack_bolt_testcase.event_test_case import EventTestCase\n\n# Inherit from the EventTestCase\nclass TestEventExample(EventTestCase):\n    def test_handled_event(self):\n        # Make sure you have registered your events in a way with the self.app mocked Slack App object\n        # you can do it here or pass the self.app object to a register function.\n        @self.app.event('app_mention')\n        def handle_message_events(event: dict[str, str], say: Say):\n            # Ensure we are receiving the right text\n            if event.get('text') == 'hello':\n                event_type = event.get('type')\n                say(f'Hello the handler handled a(n) {event_type}!')\n\n        # Trigger the event\n        self.trigger_event(event_type='app_mention', text='hello', user='U12345')\n\n        # Check the assertions\n        self.assertEqual(\n            [call(f'Hello the handler handled a(n) app_mention!')],\n            self.mock_say.call_args_list,\n        )\n```\n\nMore examples in the [tests folder](/slack_bolt_testcase/tests).\n\n## License\n\n[MIT](/LICENSE)\n\n## Disclaimer\n\nSlack is a trademark of Slack Technologies, LLC. This project is not affiliated with, endorsed by, or sponsored by\nSlack Technologies, LLC. The use of the name \"Slack\" in this repository is solely for descriptive purposes and does\nnot imply any association or intent to infringe on any trademarks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegojromerolopez%2Fslack-bolt-testcase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiegojromerolopez%2Fslack-bolt-testcase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegojromerolopez%2Fslack-bolt-testcase/lists"}