def test_retrieve_igd_profile_timeout(self, url_obj): with mock.patch('urllib2.urlopen') as mock_urlopen: mock_urlopen.side_effect = socket.error('Timeout error') with pytest.raises(upnp.IGDError): upnp._retrieve_igd_profile(url_obj)
def test_retrieve_igd_profile_timeout(self, url_obj): with mock.patch('urllib2.urlopen') as mock_urlopen: mock_urlopen.side_effect = socket.error('Timeout error') with pytest.raises(upnp.IGDError): upnp._retrieve_igd_profile(url_obj)
def test_retrieve_igd_profile(self, url_obj): with mock.patch('urllib2.urlopen') as mock_urlopen: upnp._retrieve_igd_profile(url_obj) mock_urlopen.assert_called_with(url_obj.geturl(), timeout=5)
def test_retrieve_igd_profile(self, url_obj): with mock.patch('urllib2.urlopen') as mock_urlopen: upnp._retrieve_igd_profile(url_obj) mock_urlopen.assert_called_with(url_obj.geturl(), timeout=5)