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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 5 18:30:51 CDT 2010


Author: jpeeler
Date: Wed May  5 18:30:48 2010
New Revision: 286

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=286
Log:
fix some standalone stuff... perhaps this functionality should be added to the testsuite itself

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=286&r1=285&r2=286
==============================================================================
--- asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test (original)
+++ asterisk/team/jpeeler/event_watcher/tests/ami-monitor/run-test Wed May  5 18:30:48 2010
@@ -1,6 +1,5 @@
 #! /usr/bin/env python
 
-import client
 import sys
 
 from twisted.application import service, internet
@@ -9,7 +8,6 @@
 import os, logging, pprint, time, sys
 
 from optparse import OptionParser
-
 
 """
 This test module should serve as a template for new event monitoring tests. A
@@ -28,26 +26,26 @@
         event_send = {'Action' : 'ping'}
         watcher.add_send_event(event_send)
 
-def main(argv=None):
+def main(argv = None):
     if argv is None:
         argv = sys.argv
 
+    if len(argv) == 1: # options are NOT being passed
+        sys.path.append("../../lib/python")
+    else:
+        sys.path.append("lib/python")
+        parser = OptionParser()
+        parser.add_option("-v", "--version", dest="ast_version",
+                              help="Asterisk version string")
+        (options, args) = parser.parse_args(argv)
+
     logging.basicConfig()
-
-    watcher = client.EventWatcher()
+    import client
+    watcher = client.EventWatcher(argv)
     tester = Test()
 
     #watcher.log.setLevel(logging.DEBUG)
     #manager.log.setLevel(logging.DEBUG)
-
-
-    if len(argv) == 1: # options are NOT being passed
-        watcher.set_standalone(True)
-    else:
-        parser = OptionParser()
-        parser.add_option("-v", "--version", dest="ast_version",
-                              help="Asterisk version string")
-        (options, args) = parser.parse_args(argv)
 
     watcher.set_test_obj(tester)
     watcher.set_timeout(5)




More information about the asterisk-commits mailing list