mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
[sans-io] minor test improvements
This commit is contained in:
parent
a402bfed24
commit
4cd83ee0af
@ -7,7 +7,7 @@ from mitmproxy.proxy2 import context
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def tctx():
|
def tctx():
|
||||||
return context.Context(
|
return context.Context(
|
||||||
context.Client("client"),
|
context.Client(("client", 1234)),
|
||||||
context.Server("server"),
|
context.Server(("server", 42)),
|
||||||
options.Options()
|
options.Options()
|
||||||
)
|
)
|
||||||
|
@ -135,7 +135,9 @@ class playbook:
|
|||||||
|
|
||||||
def _str(x):
|
def _str(x):
|
||||||
arrow = ">" if isinstance(x, events.Event) else "<"
|
arrow = ">" if isinstance(x, events.Event) else "<"
|
||||||
x = str(x).replace('Placeholder:', '')
|
x = str(x)\
|
||||||
|
.replace('Placeholder:None', '<unset placeholder>')\
|
||||||
|
.replace('Placeholder:', '')
|
||||||
return f"{arrow} {x}"
|
return f"{arrow} {x}"
|
||||||
|
|
||||||
diff = "\n".join(difflib.ndiff(
|
diff = "\n".join(difflib.ndiff(
|
||||||
|
Loading…
Reference in New Issue
Block a user