-
-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] delivery_postlogistics: raise exception when no token received
Sometimes due to API error it may happen we don't receive anything back when requesting token. In this case we want to show meaningful message.
- Loading branch information
1 parent
85bdccb
commit 0f996fa
Showing
5 changed files
with
63 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
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
36 changes: 36 additions & 0 deletions
36
delivery_postlogistics/tests/fixtures/cassettes/test_token_error.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,36 @@ | ||
interactions: | ||
- request: | ||
body: client_secret=c70e3696ae5146e7fe317434e50a90cd&grant_type=client_credentials&client_id=865783331e39e91e633c3916fe892d92 | ||
headers: | ||
Accept: | ||
- "*/*" | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- "144" | ||
User-Agent: | ||
- python-requests/2.20.0 | ||
content-type: | ||
- application/x-www-form-urlencoded | ||
method: POST | ||
uri: https://wedecint.post.ch/WEDECOAuth/token | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
Cache-Control: | ||
- no-cache; private | ||
Connection: | ||
- Close | ||
Content-Length: | ||
- "0" | ||
Content-Type: | ||
- text/html; charset=UTF-8 | ||
Date: | ||
- Tue, 13 Oct 2020 10:52:26 GMT | ||
status: | ||
code: 503 | ||
message: Service Unavailable | ||
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# generated from manifests external_dependencies | ||
requests==2.27.0 | ||
roulier | ||
unidecode | ||
zeep |