mirror of
https://github.com/caronc/apprise.git
synced 2025-08-10 00:38:02 +02:00
Resolve ambiguity with apprise.plugins
module namespace
While the namespace is physically made of modules, it has been amended to be the namespace home for the corresponding notifier classes as well. This turned out to confuse both humans and machines on various ends. While it has apparently worked for a while, it croaks on Python 3.11 now, and is not considered to have been a good idea in general.
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
from apprise import plugins
|
||||
from apprise.plugins.NotifyDingTalk import NotifyDingTalk
|
||||
from helpers import AppriseURLTester
|
||||
|
||||
# Disable logging for a cleaner testing output
|
||||
@ -41,27 +41,27 @@ apprise_url_tests = (
|
||||
}),
|
||||
('dingtalk://12345678', {
|
||||
# access token
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'instance': NotifyDingTalk,
|
||||
|
||||
# Our expected url(privacy=True) startswith() response:
|
||||
'privacy_url': 'dingtalk://1...8',
|
||||
}),
|
||||
('dingtalk://{}/{}'.format('a' * 8, '1' * 14), {
|
||||
# access token + phone number
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'instance': NotifyDingTalk,
|
||||
}),
|
||||
('dingtalk://{}/{}/invalid'.format('a' * 8, '1' * 3), {
|
||||
# access token + 2 invalid phone numbers
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'instance': NotifyDingTalk,
|
||||
}),
|
||||
('dingtalk://{}/?to={}'.format('a' * 8, '1' * 14), {
|
||||
# access token + phone number using 'to'
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'instance': NotifyDingTalk,
|
||||
}),
|
||||
# Test secret via user@
|
||||
('dingtalk://secret@{}/?to={}'.format('a' * 8, '1' * 14), {
|
||||
# access token + phone number using 'to'
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'instance': NotifyDingTalk,
|
||||
# Our expected url(privacy=True) startswith() response:
|
||||
'privacy_url': 'dingtalk://****@a...a',
|
||||
}),
|
||||
@ -69,7 +69,7 @@ apprise_url_tests = (
|
||||
('dingtalk://?token={}&to={}&secret={}'.format(
|
||||
'b' * 8, '1' * 14, 'a' * 15), {
|
||||
# access token + phone number using 'to'
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'instance': NotifyDingTalk,
|
||||
'privacy_url': 'dingtalk://****@b...b',
|
||||
}),
|
||||
# Invalid secret
|
||||
@ -78,16 +78,16 @@ apprise_url_tests = (
|
||||
}),
|
||||
('dingtalk://{}?format=markdown'.format('a' * 8), {
|
||||
# access token
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'instance': NotifyDingTalk,
|
||||
}),
|
||||
('dingtalk://{}'.format('a' * 8), {
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'instance': NotifyDingTalk,
|
||||
# throw a bizzare code forcing us to fail to look it up
|
||||
'response': False,
|
||||
'requests_response_code': 999,
|
||||
}),
|
||||
('dingtalk://{}'.format('a' * 8), {
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'instance': NotifyDingTalk,
|
||||
# Throws a series of connection and transfer exceptions when this flag
|
||||
# is set and tests that we gracfully handle them
|
||||
'test_requests_exceptions': True,
|
||||
|
Reference in New Issue
Block a user