fix invididual test coverage

This commit is contained in:
Thomas Kriechbaumer 2020-10-31 11:59:51 +01:00
parent a415c218ea
commit c0e846b700
2 changed files with 8 additions and 5 deletions

View File

@ -26,12 +26,9 @@ def run_tests(src, test, fail):
test
])
if e == 0:
if fail:
if e == 0 and fail:
print("FAIL DUE TO UNEXPECTED SUCCESS:", src, "Please remove this file from setup.cfg tool:individual_coverage/exclude.")
e = 42
else:
print("Success:", src)
else:
if fail:
print("Ignoring allowed fail:", src)

View File

@ -125,8 +125,14 @@ def test_echo_body():
d._echo_message(f.response, f)
t = sio.getvalue()
assert "cut off" in t
sio.truncate(0)
def test_echo_trailer():
sio = io.StringIO()
sio_err = io.StringIO()
d = dumper.Dumper(sio, sio_err)
with taddons.context(d) as ctx:
ctx.configure(d, flow_detail=3)
f = tflow.tflow(client_conn=True, server_conn=True, resp=True)
f.response.headers["content-type"] = "text/html"
f.response.headers["transfer-encoding"] = "chunked"