Skip to content

Commit 1adcd59

Browse files
committed
neaten up test_block.py
1 parent 1365886 commit 1adcd59

2 files changed

Lines changed: 48 additions & 46 deletions

File tree

tests/fixtures/README.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<p><a href="https://travis-ci.org/textile/python-textile"><img alt="" src="https://travis-ci.org/textile/python-textile.svg" /></a> <a href="https://coveralls.io/github/textile/python-textile?branch=master"><img alt="" src="https://coveralls.io/repos/github/textile/python-textile/badge.svg" /></a> <a href="https://codecov.io/github/textile/python-textile"><img alt="" src="https://codecov.io/github/textile/python-textile/coverage.svg" /></a></p>
2+
3+
<h1>python-textile</h1>
4+
5+
<p>python-textile is a Python port of <a href="http://txstyle.org/">Textile</a>, Dean Allen&#8217;s humane web text generator.</p>
6+
7+
<h2>Installation</h2>
8+
9+
<p><code>pip install textile</code></p>
10+
11+
<p>Optional dependencies include:
12+
<ul>
13+
<li><a href="http://python-pillow.github.io/"><span class="caps">PIL</span>/Pillow</a> (for checking images size)</li>
14+
<li><a href="https://pypi.python.org/pypi/regex">regex</a> (for faster unicode-aware string matching).</li>
15+
</ul></p>
16+
17+
<h2>Usage</h2>
18+
19+
<pre><code>import textile
20+
&gt;&gt;&gt; s = &quot;&quot;&quot;
21+
... _This_ is a *test.*
22+
...
23+
... * One
24+
... * Two
25+
... * Three
26+
...
27+
... Link to &quot;Slashdot&quot;:http://slashdot.org/
28+
... &quot;&quot;&quot;
29+
&gt;&gt;&gt; html = textile.textile(s)
30+
&gt;&gt;&gt; print html
31+
&lt;p&gt;&lt;em&gt;This&lt;/em&gt; is a &lt;strong&gt;test.&lt;/strong&gt;&lt;/p&gt;
32+
33+
&lt;ul&gt;
34+
&lt;li&gt;One&lt;/li&gt;
35+
&lt;li&gt;Two&lt;/li&gt;
36+
&lt;li&gt;Three&lt;/li&gt;
37+
&lt;/ul&gt;
38+
39+
&lt;p&gt;Link to &lt;a href=&quot;http://slashdot.org/&quot;&gt;Slashdot&lt;/a&gt;&lt;/p&gt;
40+
&gt;&gt;&gt;</code></pre>
41+
42+
<h3>Notes:</h3>
43+
44+
<ul>
45+
<li>Active development supports Python 2.6 or later (including Python 3.2+).</li>
46+
</ul>

tests/test_block.py

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -59,50 +59,6 @@ def test_blockcode_in_README():
5959
with open('README.textile') as f:
6060
readme = ''.join(f.readlines())
6161
result = textile.textile(readme)
62-
expect = """ <p><a href="https://travis-ci.org/textile/python-textile"><img alt="" src="https://travis-ci.org/textile/python-textile.svg" /></a> <a href="https://coveralls.io/github/textile/python-textile?branch=master"><img alt="" src="https://coveralls.io/repos/github/textile/python-textile/badge.svg" /></a> <a href="https://codecov.io/github/textile/python-textile"><img alt="" src="https://codecov.io/github/textile/python-textile/coverage.svg" /></a></p>
63-
64-
<h1>python-textile</h1>
65-
66-
<p>python-textile is a Python port of <a href="http://txstyle.org/">Textile</a>, Dean Allen&#8217;s humane web text generator.</p>
67-
68-
<h2>Installation</h2>
69-
70-
<p><code>pip install textile</code></p>
71-
72-
<p>Optional dependencies include:
73-
<ul>
74-
<li><a href="http://python-pillow.github.io/"><span class="caps">PIL</span>/Pillow</a> (for checking images size)</li>
75-
<li><a href="https://pypi.python.org/pypi/regex">regex</a> (for faster unicode-aware string matching).</li>
76-
</ul></p>
77-
78-
<h2>Usage</h2>
79-
80-
<pre><code>import textile
81-
&gt;&gt;&gt; s = &quot;&quot;&quot;
82-
... _This_ is a *test.*
83-
...
84-
... * One
85-
... * Two
86-
... * Three
87-
...
88-
... Link to &quot;Slashdot&quot;:http://slashdot.org/
89-
... &quot;&quot;&quot;
90-
&gt;&gt;&gt; html = textile.textile(s)
91-
&gt;&gt;&gt; print html
92-
&lt;p&gt;&lt;em&gt;This&lt;/em&gt; is a &lt;strong&gt;test.&lt;/strong&gt;&lt;/p&gt;
93-
94-
&lt;ul&gt;
95-
&lt;li&gt;One&lt;/li&gt;
96-
&lt;li&gt;Two&lt;/li&gt;
97-
&lt;li&gt;Three&lt;/li&gt;
98-
&lt;/ul&gt;
99-
100-
&lt;p&gt;Link to &lt;a href=&quot;http://slashdot.org/&quot;&gt;Slashdot&lt;/a&gt;&lt;/p&gt;
101-
&gt;&gt;&gt;</code></pre>
102-
103-
<h3>Notes:</h3>
104-
105-
<ul>
106-
<li>Active development supports Python 2.6 or later (including Python 3.2+).</li>
107-
</ul>"""
62+
with open('tests/fixtures/README.txt') as f:
63+
expect = ''.join(f.readlines())
10864
assert result == expect

0 commit comments

Comments
 (0)