graphql-python / graphql-python/gql-next

Good support for mocking responses, tests

未关闭
#18 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
78
派生
6
PR 合并指标
30 天内没有已合并 PR

描述

I think this should be high in the roadmap:
Make it easy/fun for application writers to write mock gql responses, to support their tests.

This includes:
- Check the mock used in the test matches the query & schema used.
- Allow a mocked response to contain "don't-care" values (which the test writer knows aren't important for the specific test) and [sentinel](https://docs.python.org/3/library/unittest.mock.html#unittest.mock.sentinel) values (which the author will want to check for identity).
- Allow a basic mocked response to be written for a test class, and then 'patched" in place for each test with specific changes.
- Maybe automagically generate a mocked response, à la https://github.com/marak/Faker.js/ ?

贡献指南

这个仓库没有索引到贡献指南

调研方向

没有指定文件或测试。首先检查仓库中现有的 GraphQL 客户端测试以及任何 response-mocking 支持,然后将所请求的行为映射到可测试的接口。完成的标准是:可以根据 queries 和 schemas 检查 mocks,支持 Don't-care 值和 sentinel 值,允许按测试进行 patching,并明确是否包含自动生成。

由索引模型根据 Issue 内容生成。

评估

技术栈
graphql, python
领域
api, testing
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。