[asterisk-commits] dlee: branch dlee/ASTERISK-22451-ari-subscribe-tests r4160 - in /asterisk/tea...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 11 12:58:41 CDT 2013


Author: dlee
Date: Wed Sep 11 12:58:39 2013
New Revision: 4160

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4160
Log:
Channel subscription test passes

Modified:
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/lib/python/asterisk/ari.py
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml

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=4160&r1=4159&r2=4160
==============================================================================
--- 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 Wed Sep 11 12:58:39 2013
@@ -384,7 +384,7 @@
             self.callback = getattr(module, callback['method'])
         else:
             # No callback; just use a no-op
-            self.callback = lambda **kwargs: None
+            self.callback = lambda *args, **kwargs: True
 
         test_object.register_stop_observer(self.on_stop)
 

Modified: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf?view=diff&rev=4160&r1=4159&r2=4160
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf (original)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf Wed Sep 11 12:58:39 2013
@@ -3,5 +3,5 @@
 exten => s,1,NoOp()
 	same => n,Answer()
 	same => n,Stasis(testsuite)
-	same => n,UserEvent(CanYouSeeMe)
+	same => n,UserEvent(CanYouSeeMe,foo: bar)
 	same => n,Hangup()

Modified: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py?view=diff&rev=4160&r1=4159&r2=4160
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py (original)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py Wed Sep 11 12:58:39 2013
@@ -22,19 +22,22 @@
 def on_start(ari, event):
     LOGGER.debug("on_start(%r)" % event)
     test_data.channel_id = event["channel"]["id"]
+    res = ari.get("applications")
+    LOGGER.error("Apps: %r", res.json())
+
     ari.post("applications", "testsuite", "subscription",
              eventSource="channel:%s" % test_data.channel_id)
-    ari.post("chanels", test_data.channel_id, "continue")
+    ari.post("channels", test_data.channel_id, "continue")
     return True
 
 
 def on_end(ari, event):
     LOGGER.debug("on_end(%r)" % event)
-    self.has_ended = True
+    test_data.has_ended = True
     return True
 
 
 def on_state_change(ari, event):
     LOGGER.debug("on_state_change(%r)" % event)
-    assert self.has_ended, "Expected no state changes before StasisEnd"
+    assert test_data.has_ended, "Expected no state changes before StasisEnd"
     return True

Modified: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml?view=diff&rev=4160&r1=4159&r2=4160
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml (original)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml Wed Sep 11 12:58:39 2013
@@ -38,9 +38,9 @@
                 method: on_end
         -   conditions:
                 match:
-                    type: ChannelStateChange
+                    type: ChannelUserevent
                     application: testsuite
-                    args: []
+                    eventname: CanYouSeeMe
             count: 1
             callback:
                 module: subscribe_channel




More information about the asterisk-commits mailing list