Exemple #1
0
 def test_parse_for_errors_error(self, httplib_response):
     soap_error = ('<document>'
                   '<errorCode>500</errorCode>'
                   '<errorDescription>Bad request</errorDescription>'
                   '</document>')
     rsp = httplib_response(status=500, body=soap_error)
     with pytest.raises(upnp.IGDError) as exc:
         upnp._parse_for_errors(rsp)
     assert 'SOAP request error' in exc.value.message
Exemple #2
0
 def test_parse_for_errors_error(self, httplib_response):
     soap_error = ('<document>'
                   '<errorCode>500</errorCode>'
                   '<errorDescription>Bad request</errorDescription>'
                   '</document>')
     rsp = httplib_response(status=500, body=soap_error)
     with pytest.raises(upnp.IGDError) as exc:
         upnp._parse_for_errors(rsp)
     assert 'SOAP request error' in exc.value.message
Exemple #3
0
 def test_parse_for_errors_good_rsp(self, httplib_response):
     rsp = httplib_response(status=200)
     assert rsp == upnp._parse_for_errors(rsp)
Exemple #4
0
 def test_parse_for_errors_bad_rsp(self, httplib_response):
     rsp = httplib_response(status=500)
     with pytest.raises(upnp.IGDError) as exc:
         upnp._parse_for_errors(rsp)
     assert 'Unable to parse' in exc.value.message
Exemple #5
0
 def test_parse_for_errors_good_rsp(self, httplib_response):
     rsp = httplib_response(status=200)
     assert rsp == upnp._parse_for_errors(rsp)
Exemple #6
0
 def test_parse_for_errors_bad_rsp(self, httplib_response):
     rsp = httplib_response(status=500)
     with pytest.raises(upnp.IGDError) as exc:
         upnp._parse_for_errors(rsp)
     assert 'Unable to parse' in exc.value.message