def test_multipart_crack(self): # cisco creates multipart/mixed messages. I shit you not. from twisted.protocols import sip as tpsip from shtoom.sip import buildSDP ae = self.assertEqual l = [] parser = tpsip.MessagesParser(l.append) parser.dataReceived(cisco_multipart_crack) parser.dataDone() ae(len(l), 1) message = l.pop() sdp = buildSDP(message) # some very basic testing rtpmap = sdp.getMediaDescription('audio').rtpmap k = rtpmap.keys() ; k.sort() ae(k, [0,13])
def setUp(self): self.l = [] self.parser = sip.MessagesParser(self.l.append)