telepathy-rakia: Use generic function to check the direction in an sdp block

Olivier Crête tester at kemper.freedesktop.org
Tue May 8 10:03:01 PDT 2012


Module: telepathy-rakia
Branch: master
Commit: 7dc9846458c8598793b6f42f839d256367ece9f8
URL:    http://cgit.freedesktop.org/telepathy/telepathy-rakia/commit/?id=7dc9846458c8598793b6f42f839d256367ece9f8

Author: Olivier Crête <olivier.crete at collabora.com>
Date:   Wed Feb 22 16:13:38 2012 -0500

Use generic function to check the direction in an sdp block

---

 tests/twisted/voip/direction-change.py |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/tests/twisted/voip/direction-change.py b/tests/twisted/voip/direction-change.py
index d31712b..8dd57cf 100644
--- a/tests/twisted/voip/direction-change.py
+++ b/tests/twisted/voip/direction-change.py
@@ -67,7 +67,8 @@ class DirectionChange(calltest.CallTest):
             assertDoesNotContain('a=recvonly',
                                  reinvite_event.sip_message.body)
         else:
-            assertContains('a=recvonly', reinvite_event.sip_message.body)
+            self.context.check_call_sdp(reinvite_event.sip_message.body,
+                                        [('audio','recvonly')])
 
 
         self.context.check_call_sdp(reinvite_event.sip_message.body)
@@ -107,9 +108,9 @@ class DirectionChange(calltest.CallTest):
 
         acc = self.q.expect('sip-response', call_id=self.context.call_id,
                             code=200)
-        assertContains('a=recvonly', acc.sip_message.body)
 
-        self.context.check_call_sdp(acc.sip_message.body)
+        self.context.check_call_sdp(acc.sip_message.body,
+                                    [('audio','recvonly')])
         self.context.ack(acc.sip_message)
 
         self.q.unforbid_events(lss_event)
@@ -122,7 +123,8 @@ class DirectionChange(calltest.CallTest):
             EventPattern('dbus-signal', signal='LocalSendingStateChanged'))
         assertEquals(cs.CALL_SENDING_STATE_PENDING_SEND, lss.args[0])
         assertEquals(self.remote_handle, lss.args[1][0])
-        assertContains('a=recvonly', acc.sip_message.body)
+        self.context.check_call_sdp(acc.sip_message.body,
+                                    [('audio','recvonly')])
 
         assertEquals(cs.CALL_STREAM_FLOW_STATE_STOPPED,
                      content.stream.Properties.Get(cs.CALL_STREAM_IFACE_MEDIA,
@@ -155,8 +157,9 @@ class DirectionChange(calltest.CallTest):
         assertEquals(cs.CALL_SCR_USER_REQUESTED, o[1].args[3][1])
         reinvite_event = o[2]
 
-        assertContains('a=sendonly', reinvite_event.sip_message.body)
-        self.context.check_call_sdp(reinvite_event.sip_message.body)
+
+        self.context.check_call_sdp(reinvite_event.sip_message.body,
+                                    [('audio','sendonly')])
         if self.sending:
             body = reinvite_event.sip_message.body.replace('sendonly',
                                                            'sendrecv')
@@ -243,8 +246,8 @@ class DirectionChange(calltest.CallTest):
         assertEquals(cs.CALL_SCR_USER_REQUESTED, o[1].args[3][1])
         reinvite_event = o[2]
 
-        assertContains('a=sendonly', reinvite_event.sip_message.body)
-        self.context.check_call_sdp(reinvite_event.sip_message.body)
+        self.context.check_call_sdp(reinvite_event.sip_message.body,
+                                    [('audio','sendonly')])
         body = reinvite_event.sip_message.body.replace(
             'sendonly', self.sending and 'recvonly' or 'inactive')
         



More information about the telepathy-commits mailing list