Ejemplo n.º 1
0
 def testRoundtrip(self):
     for url in [
             "sip:[email protected]",
             "sip:j.doe:[email protected];transport=tcp",
             "sip:[email protected]?subject=project",
             "sip:example.com",
     ]:
         self.assertEqual(sip.parseURL(url).toString(), url)
Ejemplo n.º 2
0
 def testRoundtrip(self):
     for url in [
         "sip:[email protected]",
         "sip:j.doe:[email protected];transport=tcp",
         "sip:[email protected]?subject=project",
         "sip:example.com",
         ]:
         self.assertEqual(sip.parseURL(url).toString(), url)
Ejemplo n.º 3
0
 def testComplex(self):
     s = ("sip:user:pass@hosta:123;transport=udp;user=phone;method=foo;"
          "ttl=12;maddr=1.2.3.4;blah;goo=bar?a=b&c=d")
     url = sip.parseURL(s)
     for k, v in [("username", "user"), ("password", "pass"),
                  ("host", "hosta"), ("port", 123),
                  ("transport", "udp"), ("usertype", "phone"),
                  ("method", "foo"), ("ttl", 12),
                  ("maddr", "1.2.3.4"), ("other", ["blah", "goo=bar"]),
                  ("headers", {"a": "b", "c": "d"})]:
         self.assertEqual(getattr(url, k), v)
Ejemplo n.º 4
0
 def testComplex(self):
     s = ("sip:user:pass@hosta:123;transport=udp;user=phone;method=foo;"
          "ttl=12;maddr=1.2.3.4;blah;goo=bar?a=b&c=d")
     url = sip.parseURL(s)
     for k, v in [("username", "user"), ("password", "pass"),
                  ("host", "hosta"), ("port", 123),
                  ("transport", "udp"), ("usertype", "phone"),
                  ("method", "foo"), ("ttl", 12),
                  ("maddr", "1.2.3.4"), ("other", ["blah", "goo=bar"]),
                  ("headers", {"a": "b", "c": "d"})]:
         self.assertEqual(getattr(url, k), v)