[svn-commits] dlee: branch dlee/ASTERISK-22451-ari-subscribe-tests r4195 - /asterisk/team/d...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Sep 16 15:11:14 CDT 2013
Author: dlee
Date: Mon Sep 16 15:11:12 2013
New Revision: 4195
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4195
Log:
Endpoint test
Added:
asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/subscribe_endpoint.py (with props)
Modified:
asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml
Added: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/subscribe_endpoint.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/subscribe_endpoint.py?view=auto&rev=4195
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/subscribe_endpoint.py (added)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/subscribe_endpoint.py Mon Sep 16 15:11:12 2013
@@ -1,0 +1,27 @@
+'''
+Copyright (C) 2013, Digium, Inc.
+David M. Lee, II <dlee at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import logging
+
+LOGGER = logging.getLogger(__name__)
+
+class SubscribeEndpoint(object):
+ def __init__(self):
+ self.channels = None
+ self.endpoint_id = 'SIP/1000'
+
+
+TEST = SubscribeEndpoint()
+
+
+def on_start(ari, event):
+ assert event['channel']['name'].startswith(self.endpoint_id)
+ TEST.channel_id = event['channel']['id']
+ ari.post('applications', 'testsuite', 'subscription',
+ eventSource='endpoint:%s' % TEST.endpoint_id)
+ ari.delete('channels', TEST.channel_id)
Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/subscribe_endpoint.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/subscribe_endpoint.py
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/subscribe_endpoint.py
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml?view=diff&rev=4195&r1=4194&r2=4195
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml (original)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml Mon Sep 16 15:11:12 2013
@@ -13,9 +13,6 @@
- config-section: ari-config
typename: ari.WebSocketEventModule
-test-object-config:
-
-
ari-config:
events:
- conditions:
@@ -25,8 +22,17 @@
args: []
count: 1
callback:
- module:
+ module: subscribe_endpoint
method: on_start
+ - conditions:
+ match:
+ type: EndpointStateChange
+ application: testsuite
+ endpoint:
+ technology: SIP
+ resource: 1000
+ channel_ids: []
+ count: 1
properties:
minversion: '12.0.0'
More information about the svn-commits
mailing list