test.generic.test_io.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>test.generic.test_io module &#8212; Python(P)DEVS-BBL documentation</title>
  8. <link rel="stylesheet" href="_static/nature.css" type="text/css" />
  9. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  10. <link rel="stylesheet" type="text/css" href="_static/custom.css" />
  11. <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
  12. <script type="text/javascript" src="_static/jquery.js"></script>
  13. <script type="text/javascript" src="_static/underscore.js"></script>
  14. <script type="text/javascript" src="_static/doctools.js"></script>
  15. <script type="text/javascript" src="_static/language_data.js"></script>
  16. <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  17. <link rel="index" title="Index" href="genindex.html" />
  18. <link rel="search" title="Search" href="search.html" />
  19. <link rel="next" title="test.generic.test_math module" href="test.generic.test_math.html" />
  20. <link rel="prev" title="test.generic.test_generators module" href="test.generic.test_generators.html" />
  21. </head><body>
  22. <div class="related" role="navigation" aria-label="related navigation">
  23. <h3>Navigation</h3>
  24. <ul>
  25. <li class="right" style="margin-right: 10px">
  26. <a href="genindex.html" title="General Index"
  27. accesskey="I">index</a></li>
  28. <li class="right" >
  29. <a href="py-modindex.html" title="Python Module Index"
  30. >modules</a> |</li>
  31. <li class="right" >
  32. <a href="test.generic.test_math.html" title="test.generic.test_math module"
  33. accesskey="N">next</a> |</li>
  34. <li class="right" >
  35. <a href="test.generic.test_generators.html" title="test.generic.test_generators module"
  36. accesskey="P">previous</a> |</li>
  37. <li class="nav-item nav-item-0"><a href="index.html">Python(P)DEVS-BBL documentation</a> &#187;</li>
  38. <li class="nav-item nav-item-1"><a href="test.html" >test package</a> &#187;</li>
  39. <li class="nav-item nav-item-2"><a href="test.generic.html" accesskey="U">test.generic package</a> &#187;</li>
  40. </ul>
  41. </div>
  42. <div class="document">
  43. <div class="documentwrapper">
  44. <div class="bodywrapper">
  45. <div class="body" role="main">
  46. <div class="section" id="module-test.generic.test_io">
  47. <span id="test-generic-test-io-module"></span><h1>test.generic.test_io module<a class="headerlink" href="#module-test.generic.test_io" title="Permalink to this headline">¶</a></h1>
  48. <p>Tests the Input/Output building blocks to prove validity w.r.t. these tests.</p>
  49. <div class="admonition note">
  50. <p class="first admonition-title">Note</p>
  51. <p class="last">The <code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.io.Sound</span></code> block cannot be tested in a unit test,
  52. but it has been checked that the sounds will be played. To test this yourself,
  53. execute the <a class="reference internal" href="pypdevsbbl.generic.io.html#module-pypdevsbbl.generic.io" title="pypdevsbbl.generic.io"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pypdevsbbl.generic.io</span></code></a> module.</p>
  54. </div>
  55. <div class="admonition seealso">
  56. <p class="first admonition-title">See also</p>
  57. <p class="last"><a class="reference internal" href="pypdevsbbl.generic.io.html#module-pypdevsbbl.generic.io" title="pypdevsbbl.generic.io"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pypdevsbbl.generic.io</span></code></a></p>
  58. </div>
  59. <dl class="class">
  60. <dt id="test.generic.test_io.StubLogger">
  61. <em class="property">class </em><code class="descclassname">test.generic.test_io.</code><code class="descname">StubLogger</code><a class="reference internal" href="_modules/test/generic/test_io.html#StubLogger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.StubLogger" title="Permalink to this definition">¶</a></dt>
  62. <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
  63. <p>Helper class to <em>cheat</em> the usage of an actual logger.</p>
  64. <dl class="method">
  65. <dt id="test.generic.test_io.StubLogger.debug">
  66. <code class="descname">debug</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#StubLogger.debug"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.StubLogger.debug" title="Permalink to this definition">¶</a></dt>
  67. <dd></dd></dl>
  68. <dl class="method">
  69. <dt id="test.generic.test_io.StubLogger.info">
  70. <code class="descname">info</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#StubLogger.info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.StubLogger.info" title="Permalink to this definition">¶</a></dt>
  71. <dd></dd></dl>
  72. <dl class="method">
  73. <dt id="test.generic.test_io.StubLogger.notice">
  74. <code class="descname">notice</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#StubLogger.notice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.StubLogger.notice" title="Permalink to this definition">¶</a></dt>
  75. <dd></dd></dl>
  76. <dl class="method">
  77. <dt id="test.generic.test_io.StubLogger.warn">
  78. <code class="descname">warn</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#StubLogger.warn"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.StubLogger.warn" title="Permalink to this definition">¶</a></dt>
  79. <dd></dd></dl>
  80. <dl class="method">
  81. <dt id="test.generic.test_io.StubLogger.error">
  82. <code class="descname">error</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#StubLogger.error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.StubLogger.error" title="Permalink to this definition">¶</a></dt>
  83. <dd></dd></dl>
  84. <dl class="method">
  85. <dt id="test.generic.test_io.StubLogger.critical">
  86. <code class="descname">critical</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#StubLogger.critical"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.StubLogger.critical" title="Permalink to this definition">¶</a></dt>
  87. <dd></dd></dl>
  88. <dl class="method">
  89. <dt id="test.generic.test_io.StubLogger.alert">
  90. <code class="descname">alert</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#StubLogger.alert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.StubLogger.alert" title="Permalink to this definition">¶</a></dt>
  91. <dd></dd></dl>
  92. <dl class="method">
  93. <dt id="test.generic.test_io.StubLogger.emerg">
  94. <code class="descname">emerg</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#StubLogger.emerg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.StubLogger.emerg" title="Permalink to this definition">¶</a></dt>
  95. <dd></dd></dl>
  96. </dd></dl>
  97. <dl class="class">
  98. <dt id="test.generic.test_io.IOModel">
  99. <em class="property">class </em><code class="descclassname">test.generic.test_io.</code><code class="descname">IOModel</code><span class="sig-paren">(</span><em>table</em>, <em>block</em>, <em>inp</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#IOModel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.IOModel" title="Permalink to this definition">¶</a></dt>
  100. <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevs.DEVS.CoupledDEVS</span></code></p>
  101. <p>Simple model constructor for the tests.</p>
  102. <table class="docutils field-list" frame="void" rules="none">
  103. <col class="field-name" />
  104. <col class="field-body" />
  105. <tbody valign="top">
  106. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  107. <li><strong>table</strong> (<em>list</em>) – A list with all events that should happen.</li>
  108. <li><strong>block</strong> – The block to connect to the
  109. <a class="reference internal" href="pypdevsbbl.generic.generators.html#pypdevsbbl.generic.generators.TableGenerator" title="pypdevsbbl.generic.generators.TableGenerator"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.generators.TableGenerator</span></code></a>.</li>
  110. <li><strong>inp</strong> – The input port to connect the generator on.</li>
  111. </ul>
  112. </td>
  113. </tr>
  114. </tbody>
  115. </table>
  116. </dd></dl>
  117. <dl class="function">
  118. <dt id="test.generic.test_io.simulate">
  119. <code class="descclassname">test.generic.test_io.</code><code class="descname">simulate</code><span class="sig-paren">(</span><em>table</em>, <em>block</em>, <em>inp</em>, <em>tt=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#simulate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.simulate" title="Permalink to this definition">¶</a></dt>
  120. <dd><p>Simulates the model.</p>
  121. <table class="docutils field-list" frame="void" rules="none">
  122. <col class="field-name" />
  123. <col class="field-body" />
  124. <tbody valign="top">
  125. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  126. <li><strong>table</strong> (<em>list</em>) – A list with all events that should happen.</li>
  127. <li><strong>block</strong> – The block to connect to the
  128. <a class="reference internal" href="pypdevsbbl.generic.generators.html#pypdevsbbl.generic.generators.TableGenerator" title="pypdevsbbl.generic.generators.TableGenerator"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.generators.TableGenerator</span></code></a>.</li>
  129. <li><strong>inp</strong> – The input port to connect the generator on.</li>
  130. <li><strong>tt</strong> (<em>numeric</em>) – The termination time or <code class="docutils literal notranslate"><span class="pre">None</span></code> if
  131. no termination time needs to be set.
  132. Defaults to <code class="docutils literal notranslate"><span class="pre">None</span></code>.</li>
  133. </ul>
  134. </td>
  135. </tr>
  136. </tbody>
  137. </table>
  138. </dd></dl>
  139. <dl class="class">
  140. <dt id="test.generic.test_io.TestIO">
  141. <em class="property">class </em><code class="descclassname">test.generic.test_io.</code><code class="descname">TestIO</code><span class="sig-paren">(</span><em>methodName='runTest'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#TestIO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.TestIO" title="Permalink to this definition">¶</a></dt>
  142. <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">unittest.case.TestCase</span></code></p>
  143. <dl class="method">
  144. <dt id="test.generic.test_io.TestIO.setUp">
  145. <code class="descname">setUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#TestIO.setUp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.TestIO.setUp" title="Permalink to this definition">¶</a></dt>
  146. <dd></dd></dl>
  147. <dl class="method">
  148. <dt id="test.generic.test_io.TestIO.test_logger">
  149. <code class="descname">test_logger</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#TestIO.test_logger"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.TestIO.test_logger" title="Permalink to this definition">¶</a></dt>
  150. <dd><p>Tests the <a class="reference internal" href="pypdevsbbl.generic.io.html#pypdevsbbl.generic.io.Logger" title="pypdevsbbl.generic.io.Logger"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.io.Logger</span></code></a> and all its subclasses.</p>
  151. </dd></dl>
  152. <dl class="method">
  153. <dt id="test.generic.test_io.TestIO.test_file_writer">
  154. <code class="descname">test_file_writer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#TestIO.test_file_writer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.TestIO.test_file_writer" title="Permalink to this definition">¶</a></dt>
  155. <dd><p>Tests the <a class="reference internal" href="pypdevsbbl.generic.io.html#pypdevsbbl.generic.io.FileWriter" title="pypdevsbbl.generic.io.FileWriter"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.io.FileWriter</span></code></a>.</p>
  156. </dd></dl>
  157. <dl class="method">
  158. <dt id="test.generic.test_io.TestIO.test_file_reader">
  159. <code class="descname">test_file_reader</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#TestIO.test_file_reader"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.TestIO.test_file_reader" title="Permalink to this definition">¶</a></dt>
  160. <dd><p>Tests the <a class="reference internal" href="pypdevsbbl.generic.io.html#pypdevsbbl.generic.io.FileReader" title="pypdevsbbl.generic.io.FileReader"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.io.FileReader</span></code></a>.</p>
  161. </dd></dl>
  162. <dl class="method">
  163. <dt id="test.generic.test_io.TestIO.test_listener">
  164. <code class="descname">test_listener</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/test/generic/test_io.html#TestIO.test_listener"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#test.generic.test_io.TestIO.test_listener" title="Permalink to this definition">¶</a></dt>
  165. <dd><p>Tests the <a class="reference internal" href="pypdevsbbl.generic.io.html#pypdevsbbl.generic.io.Listener" title="pypdevsbbl.generic.io.Listener"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.io.Listener</span></code></a>.</p>
  166. </dd></dl>
  167. </dd></dl>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  173. <div class="sphinxsidebarwrapper">
  174. <h4>Previous topic</h4>
  175. <p class="topless"><a href="test.generic.test_generators.html"
  176. title="previous chapter">test.generic.test_generators module</a></p>
  177. <h4>Next topic</h4>
  178. <p class="topless"><a href="test.generic.test_math.html"
  179. title="next chapter">test.generic.test_math module</a></p>
  180. <div id="searchbox" style="display: none" role="search">
  181. <h3>Quick search</h3>
  182. <div class="searchformwrapper">
  183. <form class="search" action="search.html" method="get">
  184. <input type="text" name="q" />
  185. <input type="submit" value="Go" />
  186. <input type="hidden" name="check_keywords" value="yes" />
  187. <input type="hidden" name="area" value="default" />
  188. </form>
  189. </div>
  190. </div>
  191. <script type="text/javascript">$('#searchbox').show(0);</script>
  192. </div>
  193. </div>
  194. <div class="clearer"></div>
  195. </div>
  196. <div class="related" role="navigation" aria-label="related navigation">
  197. <h3>Navigation</h3>
  198. <ul>
  199. <li class="right" style="margin-right: 10px">
  200. <a href="genindex.html" title="General Index"
  201. >index</a></li>
  202. <li class="right" >
  203. <a href="py-modindex.html" title="Python Module Index"
  204. >modules</a> |</li>
  205. <li class="right" >
  206. <a href="test.generic.test_math.html" title="test.generic.test_math module"
  207. >next</a> |</li>
  208. <li class="right" >
  209. <a href="test.generic.test_generators.html" title="test.generic.test_generators module"
  210. >previous</a> |</li>
  211. <li class="nav-item nav-item-0"><a href="index.html">Python(P)DEVS-BBL documentation</a> &#187;</li>
  212. <li class="nav-item nav-item-1"><a href="test.html" >test package</a> &#187;</li>
  213. <li class="nav-item nav-item-2"><a href="test.generic.html" >test.generic package</a> &#187;</li>
  214. </ul>
  215. </div>
  216. <div class="footer" role="contentinfo">
  217. &#169; Copyright 2020, Randy Paredis.
  218. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.5.
  219. </div>
  220. </body>
  221. </html>