Refactor Test Code for Efficiency and Quality (#1100)

This commit is contained in:
Han Wang
2024-04-21 00:00:31 +01:00
committed by GitHub
parent 1f77254d71
commit 08cb018e11
29 changed files with 188 additions and 218 deletions

View File

@@ -28,6 +28,7 @@
from unittest import mock
import pytest
import requests
from json import dumps
from apprise import Apprise
@@ -111,19 +112,11 @@ def test_plugin_twist_init():
NotifyTwist() init()
"""
try:
with pytest.raises(TypeError):
NotifyTwist(email='invalid', targets=None)
assert False
except TypeError:
# Invalid email address
assert True
try:
with pytest.raises(TypeError):
NotifyTwist(email='user@domain', targets=None)
assert False
except TypeError:
# No password was specified
assert True
# Simple object initialization
result = NotifyTwist(