Mercurial > hg
comparison tests/dummysmtpd.py @ 50729:5644f6286618 stable
tests: show test-patchbomb-tls.t smtp server log
Improve test coverage by exposing what the smtp server actually receives.
Make dummystmtpd redirect stderr to a log file.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Thu, 23 Mar 2023 16:48:44 +0100 |
parents | 6000f5b25c9b |
children | cfb6ca77e6bc |
comparison
equal
deleted
inserted
replaced
50728:80c8dcfb73c6 | 50729:5644f6286618 |
---|---|
91 op.add_option('-p', '--port', type=int, default=8025) | 91 op.add_option('-p', '--port', type=int, default=8025) |
92 op.add_option('-a', '--address', default='localhost') | 92 op.add_option('-a', '--address', default='localhost') |
93 op.add_option('--pid-file', metavar='FILE') | 93 op.add_option('--pid-file', metavar='FILE') |
94 op.add_option('--tls', choices=['none', 'smtps'], default='none') | 94 op.add_option('--tls', choices=['none', 'smtps'], default='none') |
95 op.add_option('--certificate', metavar='FILE') | 95 op.add_option('--certificate', metavar='FILE') |
96 op.add_option('--logfile', metavar='FILE') | |
96 | 97 |
97 opts, args = op.parse_args() | 98 opts, args = op.parse_args() |
98 if opts.tls == 'smtps' and not opts.certificate: | 99 if opts.tls == 'smtps' and not opts.certificate: |
99 op.error('--certificate must be specified') | 100 op.error('--certificate must be specified') |
100 | 101 |
111 bytesvars(opts), | 112 bytesvars(opts), |
112 initfn=init, | 113 initfn=init, |
113 runfn=run, | 114 runfn=run, |
114 runargs=[pycompat.sysexecutable, pycompat.fsencode(__file__)] | 115 runargs=[pycompat.sysexecutable, pycompat.fsencode(__file__)] |
115 + pycompat.sysargv[1:], | 116 + pycompat.sysargv[1:], |
117 logfile=opts.logfile, | |
116 ) | 118 ) |
117 | 119 |
118 | 120 |
119 if __name__ == '__main__': | 121 if __name__ == '__main__': |
120 main() | 122 main() |