summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Laban <david.laban@collabora.co.uk>2011-01-26 14:09:47 +0000
committerDavid Laban <david.laban@collabora.co.uk>2011-01-26 17:17:47 +0000
commite5bf266a20d817a22c70efc31fc5d34913c1f3df (patch)
tree3ba2db72df9856baffd10794ac9baa0c84136171
parentc40b48866b7bd04308b26725368304c555cc69fd (diff)
Fix review comments for tests.
-rw-r--r--tests/twisted/sofiatest.py6
-rw-r--r--tests/twisted/voip/voip_test.py4
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/twisted/sofiatest.py b/tests/twisted/sofiatest.py
index a9ae28d..23142b9 100644
--- a/tests/twisted/sofiatest.py
+++ b/tests/twisted/sofiatest.py
@@ -33,9 +33,9 @@ class SipProxy(sip.RegisterProxy):
def handle_request(self, message, addr):
if message.method == 'REGISTER':
return sip.RegisterProxy.handle_request(self, message, addr)
- elif message.method == 'OPTIONS':
- # FIXME: work out why sofiasip keeps sending s:REGISTRATION PROBE
- return
+ elif message.method == 'OPTIONS' and \
+ 'REGISTRATION PROBE' == message.headers.get('subject','')[0]:
+ self.deliverResponse(self.responseFromRequest(200, message))
else:
headers = {}
for key, values in message.headers.items():
diff --git a/tests/twisted/voip/voip_test.py b/tests/twisted/voip/voip_test.py
index 2de6995..0b41828 100644
--- a/tests/twisted/voip/voip_test.py
+++ b/tests/twisted/voip/voip_test.py
@@ -4,6 +4,8 @@ import uuid
import twisted.protocols.sip
+from servicetest import assertContains
+
class VoipTestContext(object):
# Default audio codecs for the remote end
audio_codecs = [ ('GSM', 3, 8000, {}),
@@ -115,7 +117,7 @@ class VoipTestContext(object):
def check_call_sdp(self, sdp_string):
codec_id_list = []
for name, codec_id, rate, _misc in self.audio_codecs:
- assert self._aline_template % locals() in sdp_string
+ assertContains (self._aline_template % locals(), sdp_string)
codec_id_list.append(str(codec_id))
codec_ids = ' '.join(codec_id_list)