<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/en/2172/18/9/_/styles/combined.css?spaceKey=AST&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/AST/SimpleTestCase">SimpleTestCase</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://wiki.asterisk.org/wiki/display/~mjordan">Matt Jordan</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h1><a name="SimpleTestCase-Description"></a>Description</h1>

<p>SimpleTestCase is a class that inherits from TestCase and acts as a test object in the pluggable framework.  SimpleTestCase has the following characteristics:</p>
<ul>
        <li>It controls a single instance of Asterisk.</li>
        <li>It can originate <em>n</em> calls into Asterisk in a successive sequence.</li>
        <li>It can determine the success of an originated call either by a UserEvent or by a Hangup event.</li>
        <li>Pass/failure is typically determined by other modules, or by classes that derive from SimpleTestCase.  Classes that derive from SimpleTestCase can override the verify_event method, which is called when all channels have hung up (or all expected UserEvents have been received).</li>
</ul>


<h1><a name="SimpleTestCase-ClassDescription"></a>Class Description</h1>

<ul>
        <li><b>Module:</b> SimpleTestCase</li>
        <li><b>Class:</b> SimpleTestCase : TestCase</li>
</ul>


<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Name</th>
<th class='confluenceTh'>Parameter</th>
<th class='confluenceTh'>Description</th>
<th class='confluenceTh'>Default</th>
</tr>
<tr>
<td class='confluenceTd'>_<em>init</em>_</td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Constructor </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'>test_path</td>
<td class='confluenceTd'> Optional.  Full path to the directory executing the test.  If used in the pluggable framework, this value will be populated.</td>
<td class='confluenceTd'> ''</td>
</tr>
<tr>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> test_config </td>
<td class='confluenceTd'> Optional.  An object populated with values from the YAML configuration file.  If used in the pluggable framework, this value will be populated.</td>
<td class='confluenceTd'>None</td>
</tr>
<tr>
<td class='confluenceTd'>ami_connect</td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Called when an AMI connection is made with the instance of Asterisk </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> ami </td>
<td class='confluenceTd'> The starpy AMI object </td>
<td class='confluenceTd'>&nbsp;</td>
</tr>
<tr>
<td class='confluenceTd'>hangup</td>
<td class='confluenceTd'> A twisted deferred callback function that is called when all channels have hung up</td>
</tr>
<tr>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> result </td>
</tr>
<tr>
<td class='confluenceTd'>verify_event</td>
</tr>
<tr>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> event </td>
</tr>
<tr>
<td class='confluenceTd'>run</td>
</tr>
</tbody></table>
</div>


<h1><a name="SimpleTestCase-Configuration"></a>Configuration</h1>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;" class="grey">
                        <a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
       <a href="https://wiki.asterisk.org/wiki/display/AST/SimpleTestCase">View Online</a>
              |
       <a href="https://wiki.asterisk.org/wiki/display/AST/SimpleTestCase?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>