-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add calc prazo method to correios client
- Loading branch information
1 parent
21b5592
commit e554442
Showing
4 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tests/fixtures/cassettes/test_calculate_delivery_time.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
interactions: | ||
- request: | ||
body: <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" | ||
xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Header/><ns0:Body><ns1:CalcPrazo><ns1:nCdServico>04162</ns1:nCdServico><ns1:sCepOrigem>07192100</ns1:sCepOrigem><ns1:sCepDestino>80030001</ns1:sCepDestino></ns1:CalcPrazo></ns0:Body></SOAP-ENV:Envelope> | ||
headers: | ||
Accept: ['*/*'] | ||
Accept-Encoding: ['gzip, deflate'] | ||
Connection: [keep-alive] | ||
Content-Length: ['468'] | ||
Content-Type: [text/xml;charset=UTF-8] | ||
SOAPAction: | ||
- !!binary | | ||
Imh0dHA6Ly90ZW1wdXJpLm9yZy9DYWxjUHJhem8i | ||
User-Agent: [python-requests/2.13.0] | ||
method: POST | ||
uri: http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx | ||
response: | ||
body: {string: '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CalcPrazoResponse | ||
xmlns="http://tempuri.org/"><CalcPrazoResult><Servicos><cServico><Codigo>4162</Codigo><PrazoEntrega>1</PrazoEntrega><EntregaDomiciliar>S</EntregaDomiciliar><EntregaSabado>S</EntregaSabado><Erro | ||
/><MsgErro /><obsFim /><DataMaxEntrega>31/07/2017</DataMaxEntrega></cServico></Servicos></CalcPrazoResult></CalcPrazoResponse></soap:Body></soap:Envelope>'} | ||
headers: | ||
Cache-Control: ['private, max-age=0'] | ||
Content-Length: ['585'] | ||
Content-Type: [text/xml; charset=utf-8] | ||
Date: ['Fri, 28 Jul 2017 12:58:41 GMT'] | ||
Server: [Microsoft-IIS/7.5] | ||
X-AspNet-Version: [4.0.30319] | ||
X-Powered-By: [ASP.NET] | ||
status: {code: 200, message: OK} | ||
version: 1 |
34 changes: 34 additions & 0 deletions
34
tests/fixtures/cassettes/test_calculate_delivery_time_except.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
interactions: | ||
- request: | ||
body: <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" | ||
xmlns:ns1="http://tempuri.org/"><SOAP-ENV:Header/><ns0:Body><ns1:CalcPrazo><ns1:nCdServico>04669</ns1:nCdServico><ns1:sCepOrigem>01311300</ns1:sCepOrigem><ns1:sCepDestino>01311300</ns1:sCepDestino></ns1:CalcPrazo></ns0:Body></SOAP-ENV:Envelope> | ||
headers: | ||
Accept: ['*/*'] | ||
Accept-Encoding: ['gzip, deflate'] | ||
Connection: [keep-alive] | ||
Content-Length: ['468'] | ||
Content-Type: [text/xml;charset=UTF-8] | ||
SOAPAction: | ||
- !!binary | | ||
Imh0dHA6Ly90ZW1wdXJpLm9yZy9DYWxjUHJhem8i | ||
User-Agent: [python-requests/2.13.0] | ||
method: POST | ||
uri: http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx | ||
response: | ||
body: {string: "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"\ | ||
http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\ | ||
\ xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body><CalcPrazoResponse\ | ||
\ xmlns=\"http://tempuri.org/\"><CalcPrazoResult><Servicos><cServico><Codigo>4669</Codigo><PrazoEntrega>0</PrazoEntrega><EntregaDomiciliar\ | ||
\ /><EntregaSabado /><Erro>008</Erro><MsgErro>Servi\xE7o indispon\xEDvel para\ | ||
\ o trecho informado.</MsgErro><obsFim /><DataMaxEntrega /></cServico></Servicos></CalcPrazoResult></CalcPrazoResponse></soap:Body></soap:Envelope>"} | ||
headers: | ||
Cache-Control: ['private, max-age=0'] | ||
Content-Length: ['589'] | ||
Content-Type: [text/xml; charset=utf-8] | ||
Date: ['Fri, 28 Jul 2017 13:09:43 GMT'] | ||
Server: [Microsoft-IIS/7.5] | ||
X-AspNet-Version: [4.0.30319] | ||
X-Powered-By: [ASP.NET] | ||
status: {code: 200, message: OK} | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters