MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_savehar

Function test_savehar

test/mitmproxy/addons/test_savehar.py:163–173  ·  view source on GitHub ↗
(log_file: Path, tmp_path: Path, monkeypatch)

Source from the content-addressed store, hash-verified

161 "log_file", [pytest.param(x, id=x.stem) for x in test_dir.glob("data/flows/*.mitm")]
162)
163def test_savehar(log_file: Path, tmp_path: Path, monkeypatch):
164 monkeypatch.setattr(version, "VERSION", "1.2.3")
165 s = SaveHar()
166
167 flows = io.read_flows_from_paths([log_file])
168
169 s.export_har(flows, types.Path(tmp_path / "testing_flow.har"))
170 expected_har = json.loads(log_file.with_suffix(".har").read_bytes())
171 actual_har = json.loads(Path(tmp_path / "testing_flow.har").read_bytes())
172
173 assert actual_har == expected_har
174
175
176def test_flow_entry():

Callers

nothing calls this directly

Calls 4

export_harMethod · 0.95
SaveHarClass · 0.90
PathClass · 0.85
loadsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…