示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)