[asterisk-commits] jpeeler: branch jpeeler/event_watcher r273 - /asterisk/team/jpeeler/event_wat...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 29 18:16:22 CDT 2010


Author: jpeeler
Date: Thu Apr 29 18:16:19 2010
New Revision: 273

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=273
Log:
add some documentation which should be helpful

Modified:
    asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test

Modified: asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test?view=diff&rev=273&r1=272&r2=273
==============================================================================
--- asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test (original)
+++ asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test Thu Apr 29 18:16:19 2010
@@ -7,6 +7,40 @@
 from twisted.internet import reactor
 from starpy import manager, fastagi, utilapplication, menu
 import os, logging, pprint, time, sys
+
+"""
+Some info from author:
+This test module should serve as a template for new event monitoring tests. A
+test class is created with sequential test methods named testX, where X starts
+at 0. The purpose of each test method is to set the events to be monitored for
+as well as optionally events to send which also need events monitored.
+
+Events are described using dictionaries very similar to how they would appear
+in a manager session. Only the portion of the event you want to match should
+be specified.
+
+Events to monitor are added via add_event. Add_event takes a list of
+dictionaries. The reason it is a list is to cover the case where you want to
+specify either event may be considered as a successful match.
+
+Events to send are added via add_send_event. Add_send_event takes a dictionary
+representing the event to send.
+
+The client module contains a set_ordered method which may either be set True or
+False, depending on whether or not the order of the event matching matters.
+
+These are the supported event monitoring scenarios:
+
+S1: unordered
+[SEND] -> 3 -> 1 -> 2
+
+S2: ordered
+[SEND] -> 1 -> 2 ->3
+
+S3: optional events
+[SEND] -> 1 -> {2, 3} -> 4
+
+"""
 
 class Test():
 
@@ -49,10 +83,12 @@
 def main():
     logging.basicConfig()
     
-    manager.log.setLevel(logging.DEBUG)
     watcher = client.EventWatcher()
     tester = Test()
-    watcher.log.setLevel(logging.DEBUG)
+
+    #watcher.log.setLevel(logging.DEBUG)
+    #manager.log.setLevel(logging.DEBUG)
+
     watcher.set_test_obj(tester)
     watcher.set_timeout(5)
    




More information about the asterisk-commits mailing list