MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_spawn_editor

Function test_spawn_editor

test/mitmproxy/tools/console/test_master.py:4–23  ·  view source on GitHub ↗
(monkeypatch, console)

Source from the content-addressed store, hash-verified

2
3
4def test_spawn_editor(monkeypatch, console):
5 text_data = "text"
6 binary_data = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09"
7
8 console.get_editor = Mock()
9 console.get_editor.return_value = "editor"
10 console.get_hex_editor = Mock()
11 console.get_hex_editor.return_value = "editor"
12 monkeypatch.setattr("subprocess.call", (lambda _: None))
13
14 console.loop = Mock()
15 console.loop.stop = Mock()
16 console.loop.start = Mock()
17 console.loop.draw_screen = Mock()
18
19 console.spawn_editor(text_data)
20 console.get_editor.assert_called_once()
21
22 console.spawn_editor(binary_data)
23 console.get_hex_editor.assert_called_once()
24
25
26def test_get_hex_editor(monkeypatch, console):

Callers

nothing calls this directly

Calls 1

spawn_editorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…