/usr/share/doc/python-mailmanclient/html/src/mailmanclient/docs/testing.html is in python-mailmanclient-doc 3.1.1-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Developing MailmanClient — Mailman Client 3.1.1 documentation</title>
<link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '3.1.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="prev" title="API Reference" href="apiref.html" />
</head>
<body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="apiref.html" title="API Reference"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../README.html">Mailman Client 3.1.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="developing-mailmanclient">
<h1>Developing MailmanClient<a class="headerlink" href="#developing-mailmanclient" title="Permalink to this headline">¶</a></h1>
<div class="section" id="running-tests">
<h2>Running Tests<a class="headerlink" href="#running-tests" title="Permalink to this headline">¶</a></h2>
<p>The test suite is run with the <a class="reference external" href="https://testrun.org/tox/latest/">tox</a> tool, which allows it to be run against
multiple versions of Python. There are two modes to the test suite:</p>
<blockquote>
<div><ul class="simple">
<li><em>Record mode</em> which is used to record the HTTP traffic against a live
Mailman 3 REST server.</li>
<li><em>Replay mode</em> which allows you to run the test suite off-line, without
running the REST server.</li>
</ul>
</div></blockquote>
<p>Whenever you add tests for other parts of the REST API, you need to run the
suite once in record mode to generate the YAML file of HTTP requests and
responses.</p>
<p>Then you can run the test suite in replay mode as often as you want, and
Mailman 3 needn’t even be installed on your system.</p>
<p>Since this branch ships with a recording file, you don’t need to run in record
mode to start with.</p>
</div>
<div class="section" id="replay-mode">
<h2>Replay mode<a class="headerlink" href="#replay-mode" title="Permalink to this headline">¶</a></h2>
<p>To run the test suite in replay mode (the default), just run the following:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ tox
</pre></div>
</div>
<p>This will attempt to run the test suite against Python 2.7, 3.4, 3.5 and 3.6 or
whatever combination of those that are available on your system.</p>
</div>
<div class="section" id="record-mode">
<h2>Record mode<a class="headerlink" href="#record-mode" title="Permalink to this headline">¶</a></h2>
<p>Start by branching the Mailman 3 code base, then you should install it into a
virtual environment. The easiest way to do this is with <cite>tox</cite>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ tox --notest -r
</pre></div>
</div>
<p>Now, use the virtual environment that <cite>tox</cite> creates to create a template <cite>var</cite>
directory in the current directory:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ .tox/py34/bin/mailman info
</pre></div>
</div>
<p>Now you need to modify the <code class="docutils literal"><span class="pre">var/etc/mailman.cfg</span></code> configuration file, so that
it contains the following:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">devmode</span><span class="p">]</span>
<span class="n">enabled</span><span class="p">:</span> <span class="n">yes</span>
<span class="n">testing</span><span class="p">:</span> <span class="n">yes</span>
<span class="n">recipient</span><span class="p">:</span> <span class="n">you</span><span class="nd">@yourdomain</span><span class="o">.</span><span class="n">com</span>
<span class="p">[</span><span class="n">mta</span><span class="p">]</span>
<span class="n">smtp_port</span><span class="p">:</span> <span class="mi">9025</span>
<span class="n">lmtp_port</span><span class="p">:</span> <span class="mi">9024</span>
<span class="n">incoming</span><span class="p">:</span> <span class="n">mailman</span><span class="o">.</span><span class="n">testing</span><span class="o">.</span><span class="n">mta</span><span class="o">.</span><span class="n">FakeMTA</span>
<span class="p">[</span><span class="n">webservice</span><span class="p">]</span>
<span class="n">port</span><span class="p">:</span> <span class="mi">9001</span>
<span class="p">[</span><span class="n">archiver</span><span class="o">.</span><span class="n">mhonarc</span><span class="p">]</span>
<span class="n">enable</span><span class="p">:</span> <span class="n">yes</span>
<span class="p">[</span><span class="n">archiver</span><span class="o">.</span><span class="n">mail_archive</span><span class="p">]</span>
<span class="n">enable</span><span class="p">:</span> <span class="n">yes</span>
<span class="p">[</span><span class="n">archiver</span><span class="o">.</span><span class="n">prototype</span><span class="p">]</span>
<span class="n">enable</span><span class="p">:</span> <span class="n">yes</span>
</pre></div>
</div>
<p>Now you can start Mailman 3:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ .tox/py34/bin/mailman start
</pre></div>
</div>
<p>Back in your <code class="docutils literal"><span class="pre">mailmanclient</span></code> branch, run the test suite in record mode:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ tox -e record
</pre></div>
</div>
<p>You should now have an updated recording file (<code class="docutils literal"><span class="pre">tape.yaml</span></code>).</p>
<p>If you find you need to re-run the test suite, you <em>must</em> first stop the
Mailman REST server, and then delete the <code class="docutils literal"><span class="pre">mailman.db</span></code> file, since it
contains state that will mess up the <code class="docutils literal"><span class="pre">mailmanclient</span></code> test suite:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ cd <mailman3-branch>
$ .tox/py34/bin/mailman stop
$ rm -f var/data/mailman.db
$ .tox/py34/bin/mailman start
$ cd <mailmanclient-branch>
$ tox -e record
</pre></div>
</div>
<p>Once you’re done recording the HTTP traffic, you can stop the Mailman 3 server
and you won’t need it again. It’s a good idea to commit the <code class="docutils literal"><span class="pre">tape.yaml</span></code>
changes for other users of your branch.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../README.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Developing MailmanClient</a><ul>
<li><a class="reference internal" href="#running-tests">Running Tests</a></li>
<li><a class="reference internal" href="#replay-mode">Replay mode</a></li>
<li><a class="reference internal" href="#record-mode">Record mode</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="apiref.html"
title="previous chapter">API Reference</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/src/mailmanclient/docs/testing.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="apiref.html" title="API Reference"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../README.html">Mailman Client 3.1.1 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2012-2018, The Free Software Foundation.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.7.
</div>
</body>
</html>
|