Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] delivery_postlogistics: raise exception when no token received #898

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

ajaniszewska-dev
Copy link
Contributor

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.

Copy link

@twalter-c2c twalter-c2c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ajaniszewska-dev ajaniszewska-dev force-pushed the postlog_token_err_impr branch 12 times, most recently from 73da793 to 758a53a Compare October 31, 2024 08:59
@ajaniszewska-dev
Copy link
Contributor Author

do not merge ATM, seems this exception is not correctly raised (raised when service works fine)

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖


def test_postlogistics_get_token_error(self):
with recorder.use_cassette("test_token_error") as cassette:
with self.assertRaises(UserError):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's always better to use assertRaisesRegex w/ a pattern matching the error msg.
Too often I've seen an exception raised somewhere else 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @simahawk , updated test.

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.
@simahawk
Copy link
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-898-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 8e93836 into OCA:16.0 Nov 11, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 1c61d7b. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants