Open dwhswenson opened 10 months ago
Attention: 71 lines
in your changes are missing coverage. Please review.
Comparison is base (
cd85036
) 34.55% compared to head (722a3ff
) 34.79%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This will introduce a new task, which checks that all the authorization is working. This is likely to be an occasional source of errors in all the automated workflows, so it is worth creating an easy tool to check it.
The main idea here is to use a abstract mix-in on the three classes that have some sort of authorization (
Bot
,Inbox
, andSMTP
). Subclasses need to define a method that raises exceptions if authorization fails, or returnsTrue
if it succeeds. They also need to define which exception classes are expected as indicators of authorization failure.The reason to pass the exception along instead of just returning
False
is that the exception will usually contain more information about the nature of the failure. This is probably something we want to report to the user.Testing is going to be a bit tricky, I think, because I want this to actually be an integration test. We'll have to skip these in cases where the necessary environment variables aren't provided.