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
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
<title>Coverage for cogapp/test_makefiles.py: 23.38%</title>
<link rel="icon" sizes="32x32" href="favicon_32.png">
<link rel="stylesheet" href="style.css" type="text/css">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.hotkeys.js"></script>
<script type="text/javascript" src="jquery.isonscreen.js"></script>
<script type="text/javascript" src="coverage_html.js"></script>
<script type="text/javascript">
jQuery(document).ready(coverage.pyfile_ready);
</script>
</head>
<body class="pyfile">
<div id="header">
<div class="content">
<h1>Coverage for <b>cogapp/test_makefiles.py</b> :
<span class="pc_cov">23.38%</span>
</h1>
<img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" />
<h2 class="stats">
71 statements
<button type="button" class="run shortkey_r button_toggle_run" title="Toggle lines run">18 run</button>
<button type="button" class="mis show_mis shortkey_m button_toggle_mis" title="Toggle lines missing">53 missing</button>
<button type="button" class="exc show_exc shortkey_x button_toggle_exc" title="Toggle lines excluded">0 excluded</button>
<button type="button" class="par run show_par shortkey_p button_toggle_par" title="Toggle lines partially run">0 partial</button>
</h2>
</div>
</div>
<div class="help_panel">
<img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" />
<p class="legend">Hot-keys on this page</p>
<div>
<p class="keyhelp">
<span class="key">r</span>
<span class="key">m</span>
<span class="key">x</span>
<span class="key">p</span> toggle line displays
</p>
<p class="keyhelp">
<span class="key">j</span>
<span class="key">k</span> next/prev highlighted chunk
</p>
<p class="keyhelp">
<span class="key">0</span> (zero) top of page
</p>
<p class="keyhelp">
<span class="key">1</span> (one) first highlighted chunk
</p>
</div>
</div>
<div id="source">
<p id="t1" class="pln"><span class="n"><a href="#t1">1</a></span><span class="t"><span class="str">""" Test the cogapp.makefiles modules</span> </span><span class="r"></span></p>
<p id="t2" class="pln"><span class="n"><a href="#t2">2</a></span><span class="t"><span class="str"> http://nedbatchelder.com/code/cog</span> </span><span class="r"></span></p>
<p id="t3" class="pln"><span class="n"><a href="#t3">3</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t4" class="pln"><span class="n"><a href="#t4">4</a></span><span class="t"><span class="str"> Copyright 2004-2019, Ned Batchelder.</span> </span><span class="r"></span></p>
<p id="t5" class="pln"><span class="n"><a href="#t5">5</a></span><span class="t"><span class="str">"""</span> </span><span class="r"></span></p>
<p id="t6" class="pln"><span class="n"><a href="#t6">6</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t7" class="run"><span class="n"><a href="#t7">7</a></span><span class="t"><span class="key">from</span> <span class="nam">__future__</span> <span class="key">import</span> <span class="nam">absolute_import</span> </span><span class="r"></span></p>
<p id="t8" class="pln"><span class="n"><a href="#t8">8</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t9" class="run"><span class="n"><a href="#t9">9</a></span><span class="t"><span class="key">import</span> <span class="nam">shutil</span> </span><span class="r"></span></p>
<p id="t10" class="run"><span class="n"><a href="#t10">10</a></span><span class="t"><span class="key">import</span> <span class="nam">os</span> </span><span class="r"></span></p>
<p id="t11" class="run"><span class="n"><a href="#t11">11</a></span><span class="t"><span class="key">import</span> <span class="nam">random</span> </span><span class="r"></span></p>
<p id="t12" class="run"><span class="n"><a href="#t12">12</a></span><span class="t"><span class="key">import</span> <span class="nam">tempfile</span> </span><span class="r"></span></p>
<p id="t13" class="pln"><span class="n"><a href="#t13">13</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t14" class="run"><span class="n"><a href="#t14">14</a></span><span class="t"><span class="key">from</span> <span class="op">.</span> <span class="key">import</span> <span class="nam">makefiles</span> </span><span class="r"></span></p>
<p id="t15" class="run"><span class="n"><a href="#t15">15</a></span><span class="t"><span class="key">from</span> <span class="op">.</span><span class="nam">backward</span> <span class="key">import</span> <span class="nam">TestCase</span> </span><span class="r"></span></p>
<p id="t16" class="pln"><span class="n"><a href="#t16">16</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t17" class="pln"><span class="n"><a href="#t17">17</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t18" class="run"><span class="n"><a href="#t18">18</a></span><span class="t"><span class="key">class</span> <span class="nam">SimpleTests</span><span class="op">(</span><span class="nam">TestCase</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t19" class="pln"><span class="n"><a href="#t19">19</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t20" class="run"><span class="n"><a href="#t20">20</a></span><span class="t"> <span class="key">def</span> <span class="nam">setUp</span><span class="op">(</span><span class="nam">self</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t21" class="pln"><span class="n"><a href="#t21">21</a></span><span class="t"> <span class="com"># Create a temporary directory.</span> </span><span class="r"></span></p>
<p id="t22" class="mis show_mis"><span class="n"><a href="#t22">22</a></span><span class="t"> <span class="nam">my_dir</span> <span class="op">=</span> <span class="str">'testmakefiles_tempdir_'</span> <span class="op">+</span> <span class="nam">str</span><span class="op">(</span><span class="nam">random</span><span class="op">.</span><span class="nam">random</span><span class="op">(</span><span class="op">)</span><span class="op">)</span><span class="op">[</span><span class="num">2</span><span class="op">:</span><span class="op">]</span> </span><span class="r"></span></p>
<p id="t23" class="mis show_mis"><span class="n"><a href="#t23">23</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span> <span class="op">=</span> <span class="nam">os</span><span class="op">.</span><span class="nam">path</span><span class="op">.</span><span class="nam">join</span><span class="op">(</span><span class="nam">tempfile</span><span class="op">.</span><span class="nam">gettempdir</span><span class="op">(</span><span class="op">)</span><span class="op">,</span> <span class="nam">my_dir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t24" class="mis show_mis"><span class="n"><a href="#t24">24</a></span><span class="t"> <span class="nam">os</span><span class="op">.</span><span class="nam">mkdir</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t25" class="pln"><span class="n"><a href="#t25">25</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t26" class="run"><span class="n"><a href="#t26">26</a></span><span class="t"> <span class="key">def</span> <span class="nam">tearDown</span><span class="op">(</span><span class="nam">self</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t27" class="pln"><span class="n"><a href="#t27">27</a></span><span class="t"> <span class="com"># Get rid of the temporary directory.</span> </span><span class="r"></span></p>
<p id="t28" class="mis show_mis"><span class="n"><a href="#t28">28</a></span><span class="t"> <span class="nam">shutil</span><span class="op">.</span><span class="nam">rmtree</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t29" class="pln"><span class="n"><a href="#t29">29</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t30" class="run"><span class="n"><a href="#t30">30</a></span><span class="t"> <span class="key">def</span> <span class="nam">exists</span><span class="op">(</span><span class="nam">self</span><span class="op">,</span> <span class="nam">dname</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t31" class="mis show_mis"><span class="n"><a href="#t31">31</a></span><span class="t"> <span class="key">return</span> <span class="nam">os</span><span class="op">.</span><span class="nam">path</span><span class="op">.</span><span class="nam">exists</span><span class="op">(</span><span class="nam">os</span><span class="op">.</span><span class="nam">path</span><span class="op">.</span><span class="nam">join</span><span class="op">(</span><span class="nam">dname</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t32" class="pln"><span class="n"><a href="#t32">32</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t33" class="run"><span class="n"><a href="#t33">33</a></span><span class="t"> <span class="key">def</span> <span class="nam">checkFilesExist</span><span class="op">(</span><span class="nam">self</span><span class="op">,</span> <span class="nam">d</span><span class="op">,</span> <span class="nam">dname</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t34" class="mis show_mis"><span class="n"><a href="#t34">34</a></span><span class="t"> <span class="key">for</span> <span class="nam">fname</span> <span class="key">in</span> <span class="nam">d</span><span class="op">.</span><span class="nam">keys</span><span class="op">(</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t35" class="mis show_mis"><span class="n"><a href="#t35">35</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">exists</span><span class="op">(</span><span class="nam">dname</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t36" class="mis show_mis"><span class="n"><a href="#t36">36</a></span><span class="t"> <span class="key">if</span> <span class="nam">type</span><span class="op">(</span><span class="nam">d</span><span class="op">[</span><span class="nam">fname</span><span class="op">]</span><span class="op">)</span> <span class="op">==</span> <span class="nam">type</span><span class="op">(</span><span class="op">{</span><span class="op">}</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t37" class="mis show_mis"><span class="n"><a href="#t37">37</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesExist</span><span class="op">(</span><span class="nam">d</span><span class="op">[</span><span class="nam">fname</span><span class="op">]</span><span class="op">,</span> <span class="nam">os</span><span class="op">.</span><span class="nam">path</span><span class="op">.</span><span class="nam">join</span><span class="op">(</span><span class="nam">dname</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t38" class="pln"><span class="n"><a href="#t38">38</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t39" class="run"><span class="n"><a href="#t39">39</a></span><span class="t"> <span class="key">def</span> <span class="nam">checkFilesDontExist</span><span class="op">(</span><span class="nam">self</span><span class="op">,</span> <span class="nam">d</span><span class="op">,</span> <span class="nam">dname</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t40" class="mis show_mis"><span class="n"><a href="#t40">40</a></span><span class="t"> <span class="key">for</span> <span class="nam">fname</span> <span class="key">in</span> <span class="nam">d</span><span class="op">.</span><span class="nam">keys</span><span class="op">(</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t41" class="mis show_mis"><span class="n"><a href="#t41">41</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="key">not</span> <span class="nam">self</span><span class="op">.</span><span class="nam">exists</span><span class="op">(</span><span class="nam">dname</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t42" class="pln"><span class="n"><a href="#t42">42</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t43" class="run"><span class="n"><a href="#t43">43</a></span><span class="t"> <span class="key">def</span> <span class="nam">testOneFile</span><span class="op">(</span><span class="nam">self</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t44" class="mis show_mis"><span class="n"><a href="#t44">44</a></span><span class="t"> <span class="nam">fname</span> <span class="op">=</span> <span class="str">'foo.txt'</span> </span><span class="r"></span></p>
<p id="t45" class="mis show_mis"><span class="n"><a href="#t45">45</a></span><span class="t"> <span class="nam">notfname</span> <span class="op">=</span> <span class="str">'not_here.txt'</span> </span><span class="r"></span></p>
<p id="t46" class="mis show_mis"><span class="n"><a href="#t46">46</a></span><span class="t"> <span class="nam">d</span> <span class="op">=</span> <span class="op">{</span> <span class="nam">fname</span><span class="op">:</span> <span class="str">"howdy"</span> <span class="op">}</span> </span><span class="r"></span></p>
<p id="t47" class="mis show_mis"><span class="n"><a href="#t47">47</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="key">not</span> <span class="nam">self</span><span class="op">.</span><span class="nam">exists</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t48" class="mis show_mis"><span class="n"><a href="#t48">48</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="key">not</span> <span class="nam">self</span><span class="op">.</span><span class="nam">exists</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">,</span> <span class="nam">notfname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t49" class="pln"><span class="n"><a href="#t49">49</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t50" class="mis show_mis"><span class="n"><a href="#t50">50</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">makeFiles</span><span class="op">(</span><span class="nam">d</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t51" class="mis show_mis"><span class="n"><a href="#t51">51</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">exists</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t52" class="mis show_mis"><span class="n"><a href="#t52">52</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="key">not</span> <span class="nam">self</span><span class="op">.</span><span class="nam">exists</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">,</span> <span class="nam">notfname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t53" class="pln"><span class="n"><a href="#t53">53</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t54" class="mis show_mis"><span class="n"><a href="#t54">54</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">removeFiles</span><span class="op">(</span><span class="nam">d</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t55" class="mis show_mis"><span class="n"><a href="#t55">55</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="key">not</span> <span class="nam">self</span><span class="op">.</span><span class="nam">exists</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t56" class="mis show_mis"><span class="n"><a href="#t56">56</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="key">not</span> <span class="nam">self</span><span class="op">.</span><span class="nam">exists</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">,</span> <span class="nam">notfname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t57" class="pln"><span class="n"><a href="#t57">57</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t58" class="run"><span class="n"><a href="#t58">58</a></span><span class="t"> <span class="key">def</span> <span class="nam">testManyFiles</span><span class="op">(</span><span class="nam">self</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t59" class="mis show_mis"><span class="n"><a href="#t59">59</a></span><span class="t"> <span class="nam">d</span> <span class="op">=</span> <span class="op">{</span> </span><span class="r"></span></p>
<p id="t60" class="pln"><span class="n"><a href="#t60">60</a></span><span class="t"> <span class="str">'top1.txt'</span><span class="op">:</span> <span class="str">"howdy"</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t61" class="pln"><span class="n"><a href="#t61">61</a></span><span class="t"> <span class="str">'top2.txt'</span><span class="op">:</span> <span class="str">"hello"</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t62" class="pln"><span class="n"><a href="#t62">62</a></span><span class="t"> <span class="str">'sub'</span><span class="op">:</span> <span class="op">{</span> </span><span class="r"></span></p>
<p id="t63" class="pln"><span class="n"><a href="#t63">63</a></span><span class="t"> <span class="str">'sub1.txt'</span><span class="op">:</span> <span class="str">"inside"</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t64" class="pln"><span class="n"><a href="#t64">64</a></span><span class="t"> <span class="str">'sub2.txt'</span><span class="op">:</span> <span class="str">"inside2"</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t65" class="pln"><span class="n"><a href="#t65">65</a></span><span class="t"> <span class="op">}</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t66" class="pln"><span class="n"><a href="#t66">66</a></span><span class="t"> <span class="op">}</span> </span><span class="r"></span></p>
<p id="t67" class="pln"><span class="n"><a href="#t67">67</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t68" class="mis show_mis"><span class="n"><a href="#t68">68</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesDontExist</span><span class="op">(</span><span class="nam">d</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t69" class="mis show_mis"><span class="n"><a href="#t69">69</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">makeFiles</span><span class="op">(</span><span class="nam">d</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t70" class="mis show_mis"><span class="n"><a href="#t70">70</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesExist</span><span class="op">(</span><span class="nam">d</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t71" class="mis show_mis"><span class="n"><a href="#t71">71</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">removeFiles</span><span class="op">(</span><span class="nam">d</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t72" class="mis show_mis"><span class="n"><a href="#t72">72</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesDontExist</span><span class="op">(</span><span class="nam">d</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t73" class="pln"><span class="n"><a href="#t73">73</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t74" class="run"><span class="n"><a href="#t74">74</a></span><span class="t"> <span class="key">def</span> <span class="nam">testOverlapping</span><span class="op">(</span><span class="nam">self</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t75" class="mis show_mis"><span class="n"><a href="#t75">75</a></span><span class="t"> <span class="nam">d1</span> <span class="op">=</span> <span class="op">{</span> </span><span class="r"></span></p>
<p id="t76" class="pln"><span class="n"><a href="#t76">76</a></span><span class="t"> <span class="str">'top1.txt'</span><span class="op">:</span> <span class="str">"howdy"</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t77" class="pln"><span class="n"><a href="#t77">77</a></span><span class="t"> <span class="str">'sub'</span><span class="op">:</span> <span class="op">{</span> </span><span class="r"></span></p>
<p id="t78" class="pln"><span class="n"><a href="#t78">78</a></span><span class="t"> <span class="str">'sub1.txt'</span><span class="op">:</span> <span class="str">"inside"</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t79" class="pln"><span class="n"><a href="#t79">79</a></span><span class="t"> <span class="op">}</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t80" class="pln"><span class="n"><a href="#t80">80</a></span><span class="t"> <span class="op">}</span> </span><span class="r"></span></p>
<p id="t81" class="pln"><span class="n"><a href="#t81">81</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t82" class="mis show_mis"><span class="n"><a href="#t82">82</a></span><span class="t"> <span class="nam">d2</span> <span class="op">=</span> <span class="op">{</span> </span><span class="r"></span></p>
<p id="t83" class="pln"><span class="n"><a href="#t83">83</a></span><span class="t"> <span class="str">'top2.txt'</span><span class="op">:</span> <span class="str">"hello"</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t84" class="pln"><span class="n"><a href="#t84">84</a></span><span class="t"> <span class="str">'sub'</span><span class="op">:</span> <span class="op">{</span> </span><span class="r"></span></p>
<p id="t85" class="pln"><span class="n"><a href="#t85">85</a></span><span class="t"> <span class="str">'sub2.txt'</span><span class="op">:</span> <span class="str">"inside2"</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t86" class="pln"><span class="n"><a href="#t86">86</a></span><span class="t"> <span class="op">}</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t87" class="pln"><span class="n"><a href="#t87">87</a></span><span class="t"> <span class="op">}</span> </span><span class="r"></span></p>
<p id="t88" class="pln"><span class="n"><a href="#t88">88</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t89" class="mis show_mis"><span class="n"><a href="#t89">89</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesDontExist</span><span class="op">(</span><span class="nam">d1</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t90" class="mis show_mis"><span class="n"><a href="#t90">90</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesDontExist</span><span class="op">(</span><span class="nam">d2</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t91" class="mis show_mis"><span class="n"><a href="#t91">91</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">makeFiles</span><span class="op">(</span><span class="nam">d1</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t92" class="mis show_mis"><span class="n"><a href="#t92">92</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">makeFiles</span><span class="op">(</span><span class="nam">d2</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t93" class="mis show_mis"><span class="n"><a href="#t93">93</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesExist</span><span class="op">(</span><span class="nam">d1</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t94" class="mis show_mis"><span class="n"><a href="#t94">94</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesExist</span><span class="op">(</span><span class="nam">d2</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t95" class="mis show_mis"><span class="n"><a href="#t95">95</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">removeFiles</span><span class="op">(</span><span class="nam">d1</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t96" class="mis show_mis"><span class="n"><a href="#t96">96</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">removeFiles</span><span class="op">(</span><span class="nam">d2</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t97" class="mis show_mis"><span class="n"><a href="#t97">97</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesDontExist</span><span class="op">(</span><span class="nam">d1</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t98" class="mis show_mis"><span class="n"><a href="#t98">98</a></span><span class="t"> <span class="nam">self</span><span class="op">.</span><span class="nam">checkFilesDontExist</span><span class="op">(</span><span class="nam">d2</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t99" class="pln"><span class="n"><a href="#t99">99</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t100" class="run"><span class="n"><a href="#t100">100</a></span><span class="t"> <span class="key">def</span> <span class="nam">testContents</span><span class="op">(</span><span class="nam">self</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t101" class="mis show_mis"><span class="n"><a href="#t101">101</a></span><span class="t"> <span class="nam">fname</span> <span class="op">=</span> <span class="str">'bar.txt'</span> </span><span class="r"></span></p>
<p id="t102" class="mis show_mis"><span class="n"><a href="#t102">102</a></span><span class="t"> <span class="nam">cont0</span> <span class="op">=</span> <span class="str">"I am bar.txt"</span> </span><span class="r"></span></p>
<p id="t103" class="mis show_mis"><span class="n"><a href="#t103">103</a></span><span class="t"> <span class="nam">d</span> <span class="op">=</span> <span class="op">{</span> <span class="nam">fname</span><span class="op">:</span> <span class="nam">cont0</span> <span class="op">}</span> </span><span class="r"></span></p>
<p id="t104" class="mis show_mis"><span class="n"><a href="#t104">104</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">makeFiles</span><span class="op">(</span><span class="nam">d</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t105" class="mis show_mis"><span class="n"><a href="#t105">105</a></span><span class="t"> <span class="nam">fcont1</span> <span class="op">=</span> <span class="nam">open</span><span class="op">(</span><span class="nam">os</span><span class="op">.</span><span class="nam">path</span><span class="op">.</span><span class="nam">join</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t106" class="mis show_mis"><span class="n"><a href="#t106">106</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="nam">fcont1</span><span class="op">.</span><span class="nam">read</span><span class="op">(</span><span class="op">)</span> <span class="op">==</span> <span class="nam">cont0</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t107" class="mis show_mis"><span class="n"><a href="#t107">107</a></span><span class="t"> <span class="nam">fcont1</span><span class="op">.</span><span class="nam">close</span><span class="op">(</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t108" class="pln"><span class="n"><a href="#t108">108</a></span><span class="t"> </span><span class="r"></span></p>
<p id="t109" class="run"><span class="n"><a href="#t109">109</a></span><span class="t"> <span class="key">def</span> <span class="nam">testDedent</span><span class="op">(</span><span class="nam">self</span><span class="op">)</span><span class="op">:</span> </span><span class="r"></span></p>
<p id="t110" class="mis show_mis"><span class="n"><a href="#t110">110</a></span><span class="t"> <span class="nam">fname</span> <span class="op">=</span> <span class="str">'dedent.txt'</span> </span><span class="r"></span></p>
<p id="t111" class="mis show_mis"><span class="n"><a href="#t111">111</a></span><span class="t"> <span class="nam">d</span> <span class="op">=</span> <span class="op">{</span> </span><span class="r"></span></p>
<p id="t112" class="pln"><span class="n"><a href="#t112">112</a></span><span class="t"> <span class="nam">fname</span><span class="op">:</span> <span class="str">"""\</span> </span><span class="r"></span></p>
<p id="t113" class="pln"><span class="n"><a href="#t113">113</a></span><span class="t"><span class="str"> This is dedent.txt</span> </span><span class="r"></span></p>
<p id="t114" class="pln"><span class="n"><a href="#t114">114</a></span><span class="t"><span class="str"> \tTabbed in.</span> </span><span class="r"></span></p>
<p id="t115" class="pln"><span class="n"><a href="#t115">115</a></span><span class="t"><span class="str"> spaced in.</span> </span><span class="r"></span></p>
<p id="t116" class="pln"><span class="n"><a href="#t116">116</a></span><span class="t"><span class="str"> OK.</span> </span><span class="r"></span></p>
<p id="t117" class="pln"><span class="n"><a href="#t117">117</a></span><span class="t"><span class="str"> """</span><span class="op">,</span> </span><span class="r"></span></p>
<p id="t118" class="pln"><span class="n"><a href="#t118">118</a></span><span class="t"> <span class="op">}</span> </span><span class="r"></span></p>
<p id="t119" class="mis show_mis"><span class="n"><a href="#t119">119</a></span><span class="t"> <span class="nam">makefiles</span><span class="op">.</span><span class="nam">makeFiles</span><span class="op">(</span><span class="nam">d</span><span class="op">,</span> <span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t120" class="mis show_mis"><span class="n"><a href="#t120">120</a></span><span class="t"> <span class="nam">fcont</span> <span class="op">=</span> <span class="nam">open</span><span class="op">(</span><span class="nam">os</span><span class="op">.</span><span class="nam">path</span><span class="op">.</span><span class="nam">join</span><span class="op">(</span><span class="nam">self</span><span class="op">.</span><span class="nam">tempdir</span><span class="op">,</span> <span class="nam">fname</span><span class="op">)</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t121" class="mis show_mis"><span class="n"><a href="#t121">121</a></span><span class="t"> <span class="key">assert</span><span class="op">(</span><span class="nam">fcont</span><span class="op">.</span><span class="nam">read</span><span class="op">(</span><span class="op">)</span> <span class="op">==</span> <span class="str">"This is dedent.txt\n\tTabbed in.\n spaced in.\nOK.\n"</span><span class="op">)</span> </span><span class="r"></span></p>
<p id="t122" class="mis show_mis"><span class="n"><a href="#t122">122</a></span><span class="t"> <span class="nam">fcont</span><span class="op">.</span><span class="nam">close</span><span class="op">(</span><span class="op">)</span> </span><span class="r"></span></p>
</div>
<div id="footer">
<div class="content">
<p>
<a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io">coverage.py v5.5</a>,
created at 2021-02-28 12:20 -0500
</p>
</div>
</div>
</body>
</html>
|