T21 Write unit tests
Category: Code. Pass at at least 4/5.
Prompt
Write pytest unit tests for the attached function slugify() in slug.py covering normal text, accents, multiple spaces, punctuation and empty input. Do not change slug.py. Deliver test_slug.py.
Inputs
Files attached to the chat:
Checklist
Pass at at least 4/5.
- test_slug.py runs and passes against slug.py
- At least 5 test cases, covering all 5 cases in the prompt
- Fails against a broken version of slug.py (mutation test)
- slug.py unchanged
- No outside packages except pytest
The answer key is not published while the task set is in use.