知识卡片
通过测试须核对检查范围
测试套件通过时,先看它实际启用了哪些检查。只断言没有服务器错误,无法证明状态码、响应类型、响应头和模式均符合契约;即使这些契约检查都通过,业务副作用仍需独立断言。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 12 章《Testing and validating APIs》(源文件:_epub-src/OEBPS/Text/12.htm)
- 结论依据:原文对比默认 not_a_server_error 与额外的状态码、内容类型、响应头及模式检查。
- 原始内容:By default, Schemathesis only checks that the API doesn’t raise server errors, but it can be configured to also verify that our API uses the right status codes, content types, headers, and schemas as documented in the API specification.