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
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)