[svn-commits] jpeeler: branch jpeeler/event_watcher r300 - in /asterisk/team/jpeeler/event_...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed May 19 13:01:28 CDT 2010
Author: jpeeler
Date: Wed May 19 13:01:24 2010
New Revision: 300
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=300
Log:
remove unnecessary setter methods
Modified:
asterisk/team/jpeeler/event_watcher/lib/python/client.py
asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test
Modified: asterisk/team/jpeeler/event_watcher/lib/python/client.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/jpeeler/event_watcher/lib/python/client.py?view=diff&rev=300&r1=299&r2=300
==============================================================================
--- asterisk/team/jpeeler/event_watcher/lib/python/client.py (original)
+++ asterisk/team/jpeeler/event_watcher/lib/python/client.py Wed May 19 13:01:24 2010
@@ -9,16 +9,15 @@
from asterisk.asterisk import Asterisk
"""
-This module is meant to be instantiated and then the following methods
-run to set up proper operation:
-
- set_timeout(5)
- set_test_obj(<Test class instance>)
-
-set_timeout simply sets the number of seconds before a test is considered to
-have timed out.
-
-set_test_obj gives the watcher class the necessary information to call
+This module is meant to be instantiated with the following parameters:
+def __init__(self, myargv, myasterisk, mytester, mytimeout = 5)
+myargv - the arguments passed to main
+myasterisk - the Asterisk instance created from the Asterisk class
+mytester - an instance of the created test class
+mytimeout - (optional) number of seconds before a test is considered to have
+timed out
+
+The mytester param gives the watcher class the necessary information to call
each test method. Each test method is defined in a class of your choosing
similar to below. 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
@@ -106,15 +105,16 @@
self.send_event_list = list()
self.ordered = False
- def __init__(self, myargv, myasterisk):
+ def __init__(self, myargv, myasterisk, mytester, mytimeout = 5):
self.log = logging.getLogger('TestAMI')
self.log.setLevel(logging.INFO)
self.ami = None
self.testcount = 0
self.passed = True
self.call_id = None
- self.timeout_sec = 5
self.working_dir = os.path.dirname(myargv[0])
+ self.testobj = mytester
+ self.timeout_sec = mytimeout
if len(myargv) == 1:
self.standalone = True
@@ -136,18 +136,6 @@
return
self.start_asterisk()
-
- def set_standalone(self, value):
- if value == True:
- self.log.debug("Running in standalone mode")
- print "Running in standalone mode"
- self.standalone = value
-
- def set_timeout(self, seconds):
- self.timeout_sec = seconds
-
- def set_test_obj(self, testobj):
- self.testobj = testobj
def set_ordered(self, ordered):
self.ordered = ordered
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=300&r1=299&r2=300
==============================================================================
--- asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test (original)
+++ asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test Wed May 19 13:01:24 2010
@@ -50,14 +50,11 @@
logging.basicConfig()
import client
- watcher = client.EventWatcher(argv, asterisk)
tester = Test()
+ watcher = client.EventWatcher(argv, asterisk, tester, 5)
#watcher.log.setLevel(logging.DEBUG)
#manager.log.setLevel(logging.DEBUG)
-
- watcher.set_test_obj(tester)
- watcher.set_timeout(5)
reactor.callWhenRunning(watcher.start)
reactor.run()
More information about the svn-commits
mailing list