[asterisk-commits] dlee: branch dlee/ASTERISK-22451-ari-subscribe-tests r4196 - /asterisk/team/d...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 16 15:59:45 CDT 2013


Author: dlee
Date: Mon Sep 16 15:59:43 2013
New Revision: 4196

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4196
Log:
Better messages on HTTP errors

Modified:
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/lib/python/asterisk/ari.py

Modified: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/lib/python/asterisk/ari.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/lib/python/asterisk/ari.py?view=diff&rev=4196&r1=4195&r2=4196
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/lib/python/asterisk/ari.py (original)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/lib/python/asterisk/ari.py Mon Sep 16 15:59:43 2013
@@ -386,7 +386,8 @@
         :param resp: requests.models.Response object
         :returns: resp
         '''
-        if not self.allow_errors:
+        if not self.allow_errors and resp.status_code / 100 != 2:
+            LOGGER.error('%s (%d %s): %r' % (resp.url, resp.status_code, resp.reason, resp.text))
             resp.raise_for_status()
         return resp
 
@@ -440,7 +441,8 @@
         :param args: Ignored arguments.
         '''
         if not self.count_range.contains(self.count):
-            LOGGER.error("Expected %d <= count <= %d; was %d (%r)",
+            # max could be int or float('inf'); format with %r
+            LOGGER.error("Expected %d <= count <= %r; was %d (%r)",
                          self.count_range.min, self.count_range.max,
                          self.count, self.conditions)
             self.passed = False




More information about the asterisk-commits mailing list