コード例 #1
0
 def test_retrieve_location_from_ssdp(self, url_obj):
     ctrl_location = url_obj.geturl()
     parsed_location = urlparse(ctrl_location)
     rsp = ('auth: gibberish\r\nlocation: {0}\r\n'
            'Content-Type: text/html\r\n\r\n').format(ctrl_location)
     result = upnp._retrieve_location_from_ssdp(rsp)
     assert result == parsed_location
コード例 #2
0
ファイル: TestUpnpPunch.py プロジェクト: 0-vortex/ZeroNet
 def test_retrieve_location_from_ssdp(self, url_obj):
     ctrl_location = url_obj.geturl()
     parsed_location = urlparse(ctrl_location)
     rsp = ('auth: gibberish\r\nlocation: {0}\r\n'
            'Content-Type: text/html\r\n\r\n').format(ctrl_location)
     result = upnp._retrieve_location_from_ssdp(rsp)
     assert result == parsed_location
コード例 #3
0
 def test_retrieve_location_from_ssdp_no_header(self):
     rsp = 'auth: gibberish\r\nContent-Type: application/json\r\n\r\n'
     with pytest.raises(upnp.IGDError):
         upnp._retrieve_location_from_ssdp(rsp)
コード例 #4
0
ファイル: TestUpnpPunch.py プロジェクト: 0-vortex/ZeroNet
 def test_retrieve_location_from_ssdp_no_header(self):
     rsp = 'auth: gibberish\r\nContent-Type: application/json\r\n\r\n'
     with pytest.raises(upnp.IGDError):
         upnp._retrieve_location_from_ssdp(rsp)