Mercurial > hg
comparison tests/dummysmtpd.py @ 50731:8823e4d411ba stable
tests: fix dummysmtpd argument check
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Mon, 26 Jun 2023 16:45:13 +0200 |
parents | cfb6ca77e6bc |
children | b3a5af04da35 |
comparison
equal
deleted
inserted
replaced
50730:cfb6ca77e6bc | 50731:8823e4d411ba |
---|---|
97 op.add_option('--tls', choices=['none', 'smtps'], default='none') | 97 op.add_option('--tls', choices=['none', 'smtps'], default='none') |
98 op.add_option('--certificate', metavar='FILE') | 98 op.add_option('--certificate', metavar='FILE') |
99 op.add_option('--logfile', metavar='FILE') | 99 op.add_option('--logfile', metavar='FILE') |
100 | 100 |
101 opts, args = op.parse_args() | 101 opts, args = op.parse_args() |
102 if opts.tls == 'smtps' and not opts.certificate: | 102 if (opts.tls == 'smtps') != bool(opts.certificate): |
103 op.error('--certificate must be specified') | 103 op.error('--certificate must be specified with --tls=smtps') |
104 | 104 |
105 addr = (opts.address, opts.port) | 105 addr = (opts.address, opts.port) |
106 | 106 |
107 def init(): | 107 def init(): |
108 if opts.tls == 'none': | 108 if opts.tls == 'none': |