Commit 4510d871 authored by Alexandre's avatar Alexandre
Browse files

Fix division by zero

parent cf2e7f89
......@@ -586,8 +586,11 @@ def run_default(name, connection, opts):
extra = ""
if not opts.check or opts.verbose:
time_tot = stop - start
time_per_request = time_tot / n_queries * 1000
print("\nTotal elapsed time: %.2f seconds (%.2f ms/request%s)" % (time_tot, time_per_request, extra))
if n_queries > 1:
time_per_request = " (%.2f ms/request%s)" % (time_tot / n_queries * 1000, extra)
else:
time_per_request = ""
print("\nTotal elapsed time: %.2f seconds%s" % (time_tot, time_per_request))
if opts.multistreams and opts.verbose:
for rcode, n in conn.finished['http'].items():
......
......@@ -717,6 +717,20 @@ tests:
retcode: 1
partstderr: 'certificate verify failed'
# Invalid behaviour - errors should be caught
###############################################################################
- name: '[doh] Invalide certificate'
exe: './homer.py'
markers:
- 'doh'
args:
- 'https://dot.bortzmeyer.fr'
- 'chatons.org'
retcode: 1
partstderr: 'does not match target host name'
partstdout: 'Total elapsed time'
# Use --check option
###############################################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment