Verified Commit 1714996c authored by Baptiste Beauplat's avatar Baptiste Beauplat
Browse files

Add unit test to cover MaintainerEmail plugin failing on invalid email

parent d9ebbcae
......@@ -27,9 +27,11 @@
# OTHER DEALINGS IN THE SOFTWARE.
from tests import TestController
from types import SimpleNamespace
from debexpo.plugins.models import PluginManager, BasePlugin, PluginSeverity, \
PluginResults
PluginResults, ExceptionPlugin
from debexpo.plugins.maintaineremail import PluginMaintainerEmail
class PluginBad(BasePlugin):
......@@ -103,3 +105,15 @@ class TestPluginResults(TestController):
result = PluginResults()
self.assertEquals(result.data, {})
class TestPluginMaintainerEmail(TestController):
def test_maintainer_email_emtpy(self):
changes = SimpleNamespace()
changes.maintainer = ''
plugin = PluginMaintainerEmail()
with self.assertRaises(ExceptionPlugin) as e:
plugin.run(changes, None)
self.assertIn('No maintainer address found', str(e.exception))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment