Python 函数测试设计
要求模型为一个边界丰富的函数设计测试集。
Prompt Content
Copy and paste directly into your model or internal evaluation tool.
函数 normalize_email(email: str) 会去掉首尾空格、把域名转小写、拒绝缺少 @ 的输入。请设计不少于 8 个单元测试,覆盖正常、异常、边界和国际化相关情况,并说明每类测试目的。
Use Cases
Reference Output
应覆盖空格、域名大小写、本地部分大小写、缺 @、多个 @、空字符串、unicode、子域名等。
Scoring Rubric
看覆盖面、断言明确性和是否误改本地部分大小写。
Try & save
Fill variables and copy, or save as a personal template.
This template has no variables and is ready to copy.
User Rating
0 ratingsYour rating
Log in to rate
Comments
0Log in to comment
Related Prompts
Create Python Dev Container
Set up a lightweight Python development environment with Docker and VS Code Remote Containers using the official slim-bookworm image.
Competitive Programming Assistant
Helps write time and space optimized C++, Java, and Python competitive programs.
Senior Python Code Auditor (Spanish Output)
Act as a senior software architect and Python expert to perform a comprehensive code audit and complete refactoring of the provided script, with output in Spanish.
Test Python Algorithmic Trading Project
As a QA engineer, review the algorithmic trading project for logic correctness, efficiency, historical data validation, and compliance, providing improvement recommendations.