[asterisk-commits] mjordan: testsuite/asterisk/trunk r2980 - /asterisk/trunk/tests/udptl/run-test

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 6 08:39:07 CST 2012


Author: mjordan
Date: Fri Jan  6 08:39:02 2012
New Revision: 2980

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2980
Log:
Tweaked logging statements; moved stop reactor to end of UserEvent handling

Modified:
    asterisk/trunk/tests/udptl/run-test

Modified: asterisk/trunk/tests/udptl/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/udptl/run-test?view=diff&rev=2980&r1=2979&r2=2980
==============================================================================
--- asterisk/trunk/tests/udptl/run-test (original)
+++ asterisk/trunk/tests/udptl/run-test Fri Jan  6 08:39:02 2012
@@ -9,10 +9,13 @@
 import sys
 from twisted.internet import reactor
 from starpy import manager
+import logging
 
 sys.path.append("lib/python")
 from asterisk.asterisk import Asterisk
 from asterisk.TestCase import TestCase
+
+logger = logging.getLogger(__name__)
 
 class UdptlTest(TestCase):
     def __init__(self):
@@ -32,16 +35,16 @@
     def check_recv_fax_result(self, ami, event):
         if event.get("userevent").lower() != "recvstatus":
             return
-        self.stop_reactor()
 
         status = event.get("status")
-        print ("Status of FAX is %s" % (status))
+        logger.debug("Status of FAX is %s" % (status))
         if status == "SUCCESS":
             self.passed = True
-            print "UDPTL test passed!"
+            logger.debug("UDPTL test passed!")
         else:
             self.passed = False
-            print "UDPTL test failed!"
+            logger.warn("UDPTL test failed!")
+        self.stop_reactor()
 
     def run(self):
         TestCase.run(self)
@@ -54,6 +57,7 @@
     test.start_asterisk()
     reactor.run()
     test.stop_asterisk()
+
     if not test.passed:
         return 1
     return 0




More information about the asterisk-commits mailing list