Bad Test
还没有人认领这个 Issue。
评估
调研方向
从 tests/test_graphqlview.py 中第 481 行附近链接的测试开始,将其名称、设置和断言与提议的上下文重新映射行为进行比较。根据需要重命名或替换该测试,然后运行相关的 pytest 测试,以确认响应包含 request 而不是 CUSTOM CONTEXT。
由索引模型根据 Issue 内容生成。
描述
FYI: this test will never run (or it will always run, but it shouldn't).
I'm in the process of porting this to aiohttp and found this...
I believe the test is all kinds of wrong.
- its name doesn't match what it does (it has nothing to do with pretty printing)
- I don't understand why 'request' would resolve to
{}. I'd assume it'd be repr'd to<Request ...>
I believe the test ought to test that 'CUSTOM CONTEXT' is replaced with an empty dict. at least that's what the code will do when get_context(request) is called and it discovers that self.context is not a dict.
Here's my replacement test (note, this isn't written for sanic, but the premise holds):
@pytest.mark.asyncio
async def test_context_remapped(self, client, url_builder):
response = await client.get(url_builder(query='{context}'))
_json = await response.json()
assert response.status == 200
assert 'request' in _json['data']['context']
assert 'CUSTOM CONTEXT' not in _json['data']['context']
- 主要语言
- Python
- 星标
- 148
- 派生
- 17
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
graphql-python/sanic-graphql 的其他 Issue
-
难度 5/5 一周以上 新手友好度 20/100
graphql-python/sanic-graphql#25 · 4 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 30/100
graphql-python/sanic-graphql#24 · 1 条评论 · 1 个 reaction ·
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 30/100
graphql-python/sanic-graphql#19 · 5 条评论 ·
-
难度 4/5 3-5 天 新手友好度 20/100
查看 graphql-python/sanic-graphql 的全部 Issue
相似的 Issue
-
area: harness bug status: needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
Human-Agent-Society/reef#625 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 80/100
learningequality/kolibri#15351 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Name consistency 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eellak/triplestore#65 · 1 条评论 ·