Ask for the push API key again when validation fails #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greet before asking questions
It's just common courtesy.
Do not use @cached_property for prompts
Using
@cached_property
to define these prompting functions (whichare, fundamentally, not really properties at all) makes it a lot
harder to reason about what happens when you invoke them. Furthermore,
as far as I'm aware, there's no documented way to clear the cache for
a cached property.
This change is, in the wise words of Mickey Mouse, "a surprise tool
that will help us later".
Ask for the push API key again if it's invalid
If the push API key does not validate, ask for it again instead of
kicking the user out of the installer.
Move the logic out of the install command and to its own function.
Spice it up with some emojis (they're free!)
Handle unexpected validation errors
Handle unexpected validation errors, such as AppSignal's servers
not being reachable.
Test asking again for API key
Make it so that the
mock_input
context manager can indicate theexpectation of an unanswered prompt by using
None
instead of ananswer.
When this happens, the expected
StopIteration
that indicates thata prompt was asked for which no answer was given is not raised as an
error.
Delete several duplicates of
mock_input
and move it to a singleutils.py
file.