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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 27 16:18:42 CDT 2010


Author: jpeeler
Date: Tue Apr 27 16:18:38 2010
New Revision: 255

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=255
Log:
rename stopMonitoring since that was before multiple tests were supported

Modified:
    asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py

Modified: asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py?view=diff&rev=255&r1=254&r2=255
==============================================================================
--- asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py (original)
+++ asterisk/team/jpeeler/event_watcher/tests/ami-monitor/client.py Tue Apr 27 16:18:38 2010
@@ -129,7 +129,7 @@
                         self.log.critical("new event %s" % next_event)
                         self.count = self.count - 1
                         if self.count == 0:
-                            self.stopMonitoring(ami)
+                            self.execNextTest(ami)
                     #else:
                         #self.log.critical("??????????? NO MATCH ")
         else:
@@ -140,7 +140,7 @@
                     self.log.critical("new event %s" % next_event)
                     self.count = self.count - 1
                     if self.count == 0:
-                        self.stopMonitoring(ami)
+                        self.execNextTest(ami)
                     continue
 
     def end_test(self):
@@ -148,13 +148,8 @@
             reactor.stop()
         self.log.critical("DEBUG: DONE, end_test")
 
-    def stopMonitoring(self, ami):
+    def execNextTest(self, ami):
         self.log.debug("About to shut down all monitoring")
-
-        #self.ami = None
-        #ami.deregisterEvent(None, None)
-        #self.end_test()
-
         ami.deregisterEvent(None, None)
 
         passed = self.check_events()
@@ -171,21 +166,18 @@
         print "DEBUG: res %s from exec %s" % (res, toexec)
         if res == -1:
             self.ami = None
-            ami.deregisterEvent(None, None)
             self.end_test()
             return
         self.testcount = self.testcount + 1
         ami.registerEvent(None, self.onAnyEvent)
         self.sendEvents(ami)
 
-
-        # TODO: need to have reactor call later rescheduling
-
     def onStatus(self, events, ami=None):
         self.log.debug("Initial channel status retrieved")
         if events:
             self.log.critical("Test expects no channels to have started yet, aborting!")
-            self.stopMonitoring(ami)
+            ami.deregisterEvent(None, None)
+            self.end_test()
             for event in events:
                 self.log.debug("Received event: %s", event)
 




More information about the asterisk-commits mailing list