(console, monkeypatch, caplog)
| 19 | |
| 20 | |
| 21 | async def test_edit(console, monkeypatch, caplog): |
| 22 | MSGPACK_WITH_TRUE = b"\x81\xa5hello\xc3" |
| 23 | MSGPACK_WITH_FALSE = b"\x81\xa5hello\xc2" |
| 24 | f = tflow.tflow( |
| 25 | req=http.Request.make( |
| 26 | "POST", |
| 27 | "http://example.com", |
| 28 | MSGPACK_WITH_TRUE, |
| 29 | headers={"Content-Type": "application/msgpack"}, |
| 30 | ) |
| 31 | ) |
| 32 | await console.load_flow(f) |
| 33 | monkeypatch.setattr(console, "spawn_editor", _edit) |
| 34 | |
| 35 | console.type(':console.edit.focus "request-body (MsgPack)"<enter><enter>') |
| 36 | assert "hello: false" in console.screen_contents() |
| 37 | assert f.request.content == MSGPACK_WITH_FALSE |
| 38 | |
| 39 | |
| 40 | async def test_content_missing_returns_error(console): |
nothing calls this directly
no test coverage detected
searching dependent graphs…