[sans-io] minor test improvements

This commit is contained in:
Maximilian Hils 2017-08-16 01:52:09 +02:00
parent a402bfed24
commit 4cd83ee0af
2 changed files with 5 additions and 3 deletions

View File

@ -7,7 +7,7 @@ from mitmproxy.proxy2 import context
@pytest.fixture
def tctx():
return context.Context(
context.Client("client"),
context.Server("server"),
context.Client(("client", 1234)),
context.Server(("server", 42)),
options.Options()
)

View File

@ -135,7 +135,9 @@ class playbook:
def _str(x):
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}"
diff = "\n".join(difflib.ndiff(