thunderbird / thunderbird/appointment
Mock and test background tests
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 552
- Forks
- 29
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 23
Description
Right now we're testing the mailers independently of the functions they're run in.
We should mock the background tasks and inject our mock into with_client. We can then assert that add_task has been called with the correct parameters.
https://docs.python.org/3/library/unittest.mock.html
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing mailer tests and the with_client entry point. Read how background tasks are currently invoked, then use the Python unittest.mock guidance to inject a mock and verify that add_task receives the correct parameters. Done means the tests cover these calls without running the background tasks themselves.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100